diff --git a/doc/admin/install/aws.md b/doc/admin/install/aws.md index fbf896e2950e..11cb2eab32df 100644 --- a/doc/admin/install/aws.md +++ b/doc/admin/install/aws.md @@ -33,25 +33,13 @@ If you're just starting out, we recommend [installing code-server locally](../.. >example: `ssh -i "/Users/John/Downloads/TestInstance.pem" ubuntu@ec2-3-45-678-910.compute-1.amazonaws.co` - You should see a prompt for your EC2 instance like so - At this point it is time to download the `code-server` binary. We will of course want the linux version. -- Find the latest Linux release from this URL: +- Download the latest Linux release with this command: ``` - https://github.com/codercom/code-server/releases/latest + bash <(curl -s https://raw.githubusercontent.com/codercom/code-server/master/scripts/update.sh) ``` -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): +- Navigate to the `code-server` directory with this command: ``` - wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz - ``` -- Extract the downloaded tar.gz file with this command, for example: - ``` - tar -xvzf code-server-{version}-linux-x64.tar.gz - ``` -- Navigate to extracted directory with this command: - ``` - cd code-server-{version}-linux-x64 - ``` -- If you run into any permission errors, make the binary executable by running: - ``` - chmod +x code-server + cd ~/code-server-linux ``` > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md) - Finally, run diff --git a/doc/admin/install/digitalocean.md b/doc/admin/install/digitalocean.md index 1a1b7dd5e824..23eb5fedd157 100644 --- a/doc/admin/install/digitalocean.md +++ b/doc/admin/install/digitalocean.md @@ -15,26 +15,15 @@ If you're just starting out, we recommend [installing code-server locally](../.. - Launch your instance - Open a terminal on your computer and SSH into your instance > example: ssh root@203.0.113.0 -- Once in the SSH session, visit code-server [releases page](https://github.com/codercom/code-server/releases/) and copy the link to the download for the latest linux release -- Find the latest Linux release from this URL: - ``` - https://github.com/codercom/code-server/releases/latest - ``` -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): - ``` - wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz - ``` -- Extract the downloaded tar.gz file with this command, for example: - ``` - tar -xvzf code-server-{version}-linux-x64.tar.gz - ``` -- Navigate to extracted directory with this command: +- Once in the SSH session, run the following commands to download and install the latest linux release + +- Download the latest Linux release with this command: ``` - cd code-server-{version}-linux-x64 + bash <(curl -s https://raw.githubusercontent.com/codercom/code-server/master/scripts/update.sh) ``` -- If you run into any permission errors when attempting to run the binary: +- Navigate to the `code-server` directory with this command: ``` - chmod +x code-server + cd ~/code-server-linux ``` > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md) - Finally start the code-server diff --git a/doc/admin/install/google_cloud.md b/doc/admin/install/google_cloud.md index 91085910bcc6..d8d67a048a9c 100644 --- a/doc/admin/install/google_cloud.md +++ b/doc/admin/install/google_cloud.md @@ -24,40 +24,20 @@ If you're just starting out, we recommend [installing code-server locally](../.. ``` gcloud compute ssh --zone [region] [instance name] ``` - -- Find the latest Linux release from this URL: -``` -https://github.com/codercom/code-server/releases/latest -``` - -- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page): -``` -wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz -``` - -- Extract the downloaded tar.gz file with this command, for example: -``` -tar -xvzf code-server-{version}-linux-x64.tar.gz -``` - -- Navigate to extracted directory with this command: -``` -cd code-server-{version}-linux-x64 -``` - -- Make the binary executable if you run into any errors regarding permission: -``` -chmod +x code-server -``` - -> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md) - +- Download the latest Linux release with this command: + ``` + bash <(curl -s https://raw.githubusercontent.com/codercom/code-server/master/scripts/update.sh) + ``` +- Navigate to the `code-server` directory with this command: + ``` + cd ~/code-server-linux + ``` + > To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md) - Start the code-server ``` sudo ./code-server -p 80 ``` - -> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed + > For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed - Access code-server from the public IP of your Google Cloud instance we noted earlier in your browser. > example: 32.32.32.234 diff --git a/scripts/update.sh b/scripts/update.sh new file mode 100755 index 000000000000..5d72ae37d3a1 --- /dev/null +++ b/scripts/update.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + +# Updates Code Server to the latest version +case $(uname -s) in + Darwin) # Mac + curl -s https://api.github.com/repos/codercom/code-server/releases/latest | \ + grep "browser_download_url.*code-server.*darwin-x64.zip" | cut -d '"' -f 4 | \ + awk '{print "url = "$1""}' | curl --create-dirs -o ~/code-server-darwin.zip --progress-bar -LK - + mkdir -p ~/code-server-darwin && tar -C "$_" xpvf ~/code-server-darwin.zip + chmod +x ~/code-server-darwin/code-server + ;; + Linux) + curl -s https://api.github.com/repos/codercom/code-server/releases/latest | \ + grep "browser_download_url.*code-server.*linux-x64.tar.gz" | cut -d '"' -f 4 | \ + wget -O ~/code-server-linux.tar.gz --show-progress -qi - + mkdir -p ~/code-server-linux && tar -xzvf ~/code-server-linux.tar.gz --strip 1 -C "$_" + chmod +x ~/code-server-linux/code-server + ;; + *) + echo "Unsupported operating system" + ;; +esac