From d4ed2efa718d9e6c5d2c8b151e168564063641d9 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 8 Aug 2019 11:21:45 -0500 Subject: [PATCH] Change default port to 8080 --- Dockerfile | 2 +- README.md | 6 +++--- doc/cros-install.md | 4 ++-- doc/deploy.md | 8 ++++---- doc/examples/kubernetes.aws.yaml | 5 ++--- doc/examples/kubernetes.yaml | 4 ++-- doc/quickstart.md | 12 ++++++------ src/cli.ts | 2 +- 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a0ab698..815f58cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,6 +52,6 @@ WORKDIR /home/coder/project VOLUME [ "/home/coder/project" ] COPY --from=0 /src/build/code-server /usr/local/bin/code-server -EXPOSE 8443 +EXPOSE 8080 ENTRYPOINT ["dumb-init", "code-server", "--host", "0.0.0.0"] diff --git a/README.md b/README.md index f1d91d25..2824d2b0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ remote server, accessible through the browser. Try it out: ```bash -docker run -it -p 127.0.0.1:8443:8443 -v "$PWD:/home/coder/project" codercom/code-server +docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" codercom/code-server ``` - **Consistent environment:** Code on your Chromebook, tablet, and laptop with a @@ -34,7 +34,7 @@ arguments when launching code-server with Docker. See 1. [Download a binary](https://github.com/cdr/code-server/releases). (Linux and OS X supported. Windows coming soon) 2. Unpack the downloaded file then run the binary. -3. In your browser navigate to `localhost:8443`. +3. In your browser navigate to `localhost:8080`. - For self-hosting and other information see [doc/quickstart.md](doc/quickstart.md). - For hosting on cloud platforms see [doc/deploy.md](doc/deploy.md). @@ -90,7 +90,7 @@ yarn watch # Wait for the initial compilation to complete (it will say "Finished compilation"). # Run the next command in another shell. yarn start -# Visit http://localhost:8443 +# Visit http://localhost:8080 ``` If you run into issues about a different version of Node being used, try running diff --git a/doc/cros-install.md b/doc/cros-install.md index fe98aa9a..0c12b6db 100644 --- a/doc/cros-install.md +++ b/doc/cros-install.md @@ -16,7 +16,7 @@ If you run R72, however, this is already enabled for you. After checking your prerequisites, follow the steps in [the self-host install guide](index.md) on installing code-server. Once done, make sure code-server works by running -it. After running it, simply go to `penguin.linux.test:8443` to access +it. After running it, simply go to `penguin.linux.test:8080` to access code-server. Now you should be greeted with this screen. If you did, congratulations, you have installed code-server in your Chromebook! @@ -69,7 +69,7 @@ enter `enter-chroot` to enter your container. Follow the instructions set in [the self-host install guide](index.md) to install code-server. After that is done, run `code-server` and verify it works -by going to `localhost:8443`. +by going to `localhost:8080`. > At this point in writing, `localhost` seems to work in this method. However, > the author is not sure if it applies still to newer Chromebooks. diff --git a/doc/deploy.md b/doc/deploy.md index f840bf46..f2505e50 100644 --- a/doc/deploy.md +++ b/doc/deploy.md @@ -6,7 +6,7 @@ on team size and number of repositories/languages enabled), then **Next: Configure Instance Details**. - Select **Next: ...** until you get to the **Configure Security Group** page, - then add a **Custom TCP Rule** rule with port range set to `8443` and source + then add a **Custom TCP Rule** rule with port range set to `8080` and source set to "Anywhere". > Rules with source of 0.0.0.0/0 allow all IP addresses to access your > instance. We recommend setting [security group rules](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html?icmpid=docs_ec2_console) @@ -51,9 +51,9 @@ to create a new droplet go to the "Networking" tab, then under network tags add "code-server". - Create your VM, and **take note** of its public IP address. - Visit "VPC network" in the console and go to "Firewall rules". Create a new - firewall rule called "http-8443". Under "Target tags" add "code-server", and + firewall rule called "http-8080". Under "Target tags" add "code-server", and under "Protocols and ports" tick "Specified protocols and ports" and "tcp". - Beside "tcp", add "8443", then create the rule. + Beside "tcp", add "8080", then create the rule. - Open a terminal on your computer and SSH into your Google Cloud VM: ``` gcloud compute ssh --zone ${region} ${instance name} @@ -68,6 +68,6 @@ to create a new droplet cd code-server{version}-linux-x64 ./code-server ``` -- Open your browser and visit http://$public_ip:8443/ where `$public_ip` is +- Open your browser and visit http://$public_ip:8080/ where `$public_ip` is your instance's public IP address. - For long-term use, set up a systemd service to run code-server. diff --git a/doc/examples/kubernetes.aws.yaml b/doc/examples/kubernetes.aws.yaml index 6f265634..55b19e2f 100644 --- a/doc/examples/kubernetes.aws.yaml +++ b/doc/examples/kubernetes.aws.yaml @@ -10,7 +10,7 @@ metadata: namespace: code-server spec: ports: - - port: 8443 + - port: 8080 name: https protocol: TCP selector: @@ -62,7 +62,7 @@ spec: imagePullPolicy: Always name: code-servery ports: - - containerPort: 8443 + - containerPort: 8080 name: https volumeMounts: - name: code-server-storage @@ -71,4 +71,3 @@ spec: - name: code-server-storage persistentVolumeClaim: claimName: code-store - diff --git a/doc/examples/kubernetes.yaml b/doc/examples/kubernetes.yaml index a032d523..6e0c715b 100644 --- a/doc/examples/kubernetes.yaml +++ b/doc/examples/kubernetes.yaml @@ -10,7 +10,7 @@ metadata: namespace: code-server spec: ports: - - port: 8443 + - port: 8080 name: https protocol: TCP selector: @@ -39,5 +39,5 @@ spec: imagePullPolicy: Always name: code-server ports: - - containerPort: 8443 + - containerPort: 8080 name: https diff --git a/doc/quickstart.md b/doc/quickstart.md index f7f3afa4..b930c5c2 100644 --- a/doc/quickstart.md +++ b/doc/quickstart.md @@ -2,7 +2,7 @@ 1. Visit the [releases page](https://github.com/cdr/code-server/releases) and download the latest binary for your operating system. 2. Unpack the downloaded file then run the binary. -3. In your browser navigate to `localhost:8443`. +3. In your browser navigate to `localhost:8080`. ## Usage Run `code-server --help` to view available options. @@ -25,7 +25,7 @@ server { listen [::]:80; server_name code.example.com code.example.org; location /some/path/ { # Or / if hosting at the root. - proxy_pass http://localhost:8443/; + proxy_pass http://localhost:8080/; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection upgrade; @@ -41,17 +41,17 @@ server { RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] - RewriteRule /(.*) ws://localhost:8443/$1 [P,L] + RewriteRule /(.*) ws://localhost:8080/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] - RewriteRule /(.*) http://localhost:8443/$1 [P,L] + RewriteRule /(.*) http://localhost:8080/$1 [P,L] ProxyRequests off RequestHeader set X-Forwarded-Proto https RequestHeader set X-Forwarded-Port 443 - ProxyPass / http://localhost:8443/ nocanon - ProxyPassReverse / http://localhost:8443/ + ProxyPass / http://localhost:8080/ nocanon + ProxyPassReverse / http://localhost:8080/ ``` diff --git a/src/cli.ts b/src/cli.ts index 6dc72b53..3ea83e8e 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -120,7 +120,7 @@ const startVscode = async (): Promise => { const server = new MainServer({ ...options, - port: typeof args.port !== "undefined" && parseInt(args.port, 10) || 8443, + port: typeof args.port !== "undefined" && parseInt(args.port, 10) || 8080, socket: args.socket, }, args);