Skip to content

[v2] Rewrite code-server to use new web stuff #857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 136 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
310bfe5
Delete all the things
code-asher Jul 2, 2019
4861405
Initial connection handling
code-asher Jun 27, 2019
68fe085
Add channels
code-asher Jun 28, 2019
98f0013
Add content types
code-asher Jun 28, 2019
a0121f2
Implement file provider
code-asher Jul 1, 2019
0d618bb
Use spdlog for log service
code-asher Jul 1, 2019
4e0a6d2
Partial extension host, some restructuring
code-asher Jul 1, 2019
7072bf1
Use new URI transformer everywhere
code-asher Jul 2, 2019
d808bfa
Set workspace and folder URIs
code-asher Jul 2, 2019
57a8186
Add development steps
code-asher Jul 2, 2019
a6703ec
Prevent sending disconnect if disposed
code-asher Jul 2, 2019
2e77c9d
Scan extensions
code-asher Jul 2, 2019
4685f67
Pass product configuration
code-asher Jul 2, 2019
3a78c09
Run log cleaner
code-asher Jul 2, 2019
6a35ab1
Add (unimplemented) webview server
code-asher Jul 2, 2019
770e0db
Add cli arguments
code-asher Jul 2, 2019
61c281e
Add arguments for ports
code-asher Jul 2, 2019
5677ff2
Add build scripts
code-asher Jul 3, 2019
f8f4bfd
Customize JSON files with code-server name
code-asher Jul 5, 2019
6156eb9
Don't wait to start main server
code-asher Jul 5, 2019
3ca90a5
Use nbin in forked processes
code-asher Jul 5, 2019
197d8db
Need to run `yarn compile` once
code-asher Jul 5, 2019
f51751a
Replace jq with some JavaScript
code-asher Jul 5, 2019
a20fa4a
Implement extensions channel
code-asher Jul 8, 2019
fe1d609
Make it possible to request absolute paths
code-asher Jul 8, 2019
f482087
Implement webview server
code-asher Jul 8, 2019
86e8ba1
Add gallery channel
code-asher Jul 10, 2019
54ffd1d
Make extension sidebar work
code-asher Jul 10, 2019
09e3cfd
Create extension directory on startup
code-asher Jul 10, 2019
2fdf09e
Include version when building
code-asher Jul 10, 2019
81862d4
Add back (most of) our old arguments
code-asher Jul 10, 2019
2b2aa9a
Add https server
code-asher Jul 11, 2019
97167e7
Add authentication
code-asher Jul 12, 2019
286f9a8
Implement multiple extension directories
code-asher Jul 12, 2019
e22791e
Fix interactive playground
code-asher Jul 12, 2019
8dcc1e3
Accept argument to change initial working directory
code-asher Jul 12, 2019
68c6208
Fix opening snippets
code-asher Jul 13, 2019
9446cc8
Update Dockerfile
code-asher Jul 15, 2019
9b0b337
Implement open flag
code-asher Jul 15, 2019
feabfc8
Fix different node binary warning
code-asher Jul 15, 2019
83819cb
Fix vscode-ripgrep rebuild error
code-asher Jul 15, 2019
1a3fc86
Reconnection works
code-asher Jul 15, 2019
b6fdb7d
Telemetry
code-asher Jul 16, 2019
db41f10
Fix open flag when using 0.0.0.0
code-asher Jul 17, 2019
4b0cceb
Extract ripgrep when inside binary
code-asher Jul 17, 2019
45d348b
Expose API on the client
code-asher Jul 17, 2019
b0e6c1c
Fix favicon
code-asher Jul 17, 2019
2be452d
Fix rg extraction in Docker build
code-asher Jul 17, 2019
e8cb6ff
Implement file uploads
code-asher Jul 19, 2019
9fdfacb
Quality check
code-asher Jul 19, 2019
36b8731
Add some missing development steps
code-asher Jul 19, 2019
078af59
Replace demo image with GIF (#863)
kylecarbs Jul 22, 2019
cd54aec
Fix login redirect when not using https
code-asher Jul 22, 2019
09cd1e8
Make sub-paths work
code-asher Jul 22, 2019
436ef7b
Fix VS Code version in readme and describe our changes
code-asher Jul 22, 2019
068e07b
Clean up the patch
code-asher Jul 23, 2019
92daabc
Open folder at base URL
code-asher Jul 23, 2019
7b7f5b5
Add base path argument
code-asher Jul 23, 2019
fd55139
Make flags additive and clean up docs
code-asher Jul 23, 2019
329acbb
Combine main and webview servers
code-asher Jul 24, 2019
a4f21fb
Install git during build
code-asher Jul 24, 2019
4c4a179
TLS socket still doesn't work
code-asher Jul 25, 2019
8ded89e
Firefox fixes
code-asher Jul 26, 2019
011530e
Proxy TLS sockets
code-asher Jul 30, 2019
87be3ac
Add comment explaining use of merge
code-asher Jul 30, 2019
0315b00
Add comment for the nbin shim
code-asher Jul 30, 2019
62719ab
Clean up client API
code-asher Jul 31, 2019
12af311
Use our logger instead of raw console.log
code-asher Jul 31, 2019
5944b84
Make it clearer what the tar code does
code-asher Jul 31, 2019
bd0f1d0
Support vscode-resource requests in webview
code-asher Jul 31, 2019
bce0cac
Document recent VS Code patch changes
code-asher Jul 31, 2019
60ed065
Reformat readme intro
code-asher Jul 31, 2019
712274d
Groundwork for language support
code-asher Aug 3, 2019
5b64cb3
Fix login page
code-asher Aug 3, 2019
950bfce
Add commit, date, and checksums to product.json
code-asher Aug 3, 2019
dde683d
Fix login submission when using a base path
code-asher Aug 5, 2019
590f699
Allow specifying the target
code-asher Aug 5, 2019
dc333d4
Fix extensions not being bundled into prebuilt
code-asher Aug 5, 2019
7e794bd
Fix favicon not being included in final build
code-asher Aug 5, 2019
01a9ab3
Set commit based on code-server instead of VS Code
code-asher Aug 7, 2019
f5a6f14
Implement update service
code-asher Aug 7, 2019
2b3e8e1
Don't exclude .git for Docker
code-asher Aug 7, 2019
d4ed2ef
Change default port to 8080
code-asher Aug 8, 2019
6b579d6
Fix webview address when using a proxy
code-asher Aug 8, 2019
b257c60
Fix websocket defaulting to port 80 when authority has no port
code-asher Aug 8, 2019
ba72851
Update VS Code to 1.37.0
code-asher Aug 9, 2019
2807ce4
Add tar-stream dependency
code-asher Aug 9, 2019
1d61cbe
Make release directory
code-asher Aug 10, 2019
7389d9e
Use current URL for webview
code-asher Aug 12, 2019
b566b66
Fix service worker scope when there is a base path
code-asher Aug 12, 2019
5539519
Remove extra slash when opening folder
code-asher Aug 12, 2019
90e8714
Preserve query variables when redirecting
code-asher Aug 12, 2019
c11d5fe
Fix error when passing empty extra extension dir flag
code-asher Aug 12, 2019
2470081
Exit when pipe closes
code-asher Aug 12, 2019
45ad7f0
Update logger
code-asher Aug 12, 2019
83f86a4
Load language bundles on the client
code-asher Aug 14, 2019
07ec4ca
Fix PHP syntax highlighting
code-asher Aug 14, 2019
a48c2fb
Handle webview service worker resource requests
code-asher Aug 15, 2019
72fe124
Fix loading resources in webviews
code-asher Aug 15, 2019
d1662d7
Ensure service workers are supported before use
code-asher Aug 15, 2019
f61a0ae
Set unexpected error handler on startup
code-asher Aug 15, 2019
6737384
Handle existing query when opening folder
code-asher Aug 15, 2019
b4e1a62
Fix tasks
code-asher Aug 16, 2019
ce3b7df
Use readlink -f if realpath isn't available
code-asher Aug 19, 2019
e53d6bc
Forward GitHub token to docker build if it exists
code-asher Aug 19, 2019
b9fc404
Forward minify environment variable to Docker build
code-asher Aug 19, 2019
534600c
Don't error when scanning nonexistent extension dir
code-asher Aug 21, 2019
ccc4f87
Don't package for release if we don't need to
code-asher Aug 21, 2019
c2be0ec
Fix Firefox when using extensions that insert styles
code-asher Aug 21, 2019
80050d0
Detect target automatically
code-asher Aug 21, 2019
c19223b
Fix error when building without first running yarn
code-asher Aug 21, 2019
950dad9
Simplify getting the absolute path during build
code-asher Aug 21, 2019
ddd5a9a
Update data and extension paths to match version one
code-asher Aug 21, 2019
3e2d12a
Fix scrolling on Firefox
code-asher Aug 22, 2019
4800ec6
Fix playground when behind a proxy with a sub-path
code-asher Aug 22, 2019
c4fd725
Fix built-in Typescript when bundled
code-asher Aug 22, 2019
78b6b3a
Add check for missing reconnection token
code-asher Aug 23, 2019
830ccfe
Fix toggling and hiding the menu bar
code-asher Aug 23, 2019
d33b2d2
Fix web view sometimes not loading correctly
code-asher Aug 27, 2019
a3ee7c9
Don't open cwd by default
code-asher Aug 27, 2019
c9ce9eb
Fix spawns against Node
code-asher Aug 28, 2019
624a4c0
Minify Docker build
code-asher Aug 28, 2019
b901043
Target a recent commit for VS Code
code-asher Aug 30, 2019
976a326
Update nbin
code-asher Aug 30, 2019
12bc26b
Implement status bar API
code-asher Sep 3, 2019
da7d8b0
Update VS Code
code-asher Sep 3, 2019
a26844e
Add package.json for publishing API types
code-asher Sep 3, 2019
9d8906d
Add version format flag
code-asher Sep 4, 2019
4400045
Add environment variable for telemetry endpoint
code-asher Sep 5, 2019
12e6084
Add caching
code-asher Sep 6, 2019
1164801
Keep a maximum number of connections instead of a timeout
code-asher Sep 9, 2019
e9fce80
Make extension host reconnect
code-asher Sep 9, 2019
0e1fed3
Make CI script work independently from your cwd
code-asher Sep 10, 2019
5b51999
resolve tree conflicts with master
sr229 Sep 12, 2019
8643bdc
fix further conflicts in README.md
sr229 Sep 12, 2019
cb0f9c5
re-add GH-969
sr229 Sep 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change default port to 8080
  • Loading branch information
code-asher committed Aug 8, 2019
commit d4ed2efa718d9e6c5d2c8b151e168564063641d9
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/cros-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down Expand Up @@ -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.
8 changes: 4 additions & 4 deletions doc/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand All @@ -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.
5 changes: 2 additions & 3 deletions doc/examples/kubernetes.aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
namespace: code-server
spec:
ports:
- port: 8443
- port: 8080
name: https
protocol: TCP
selector:
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
imagePullPolicy: Always
name: code-servery
ports:
- containerPort: 8443
- containerPort: 8080
name: https
volumeMounts:
- name: code-server-storage
Expand All @@ -71,4 +71,3 @@ spec:
- name: code-server-storage
persistentVolumeClaim:
claimName: code-store

4 changes: 2 additions & 2 deletions doc/examples/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
namespace: code-server
spec:
ports:
- port: 8443
- port: 8080
name: https
protocol: TCP
selector:
Expand Down Expand Up @@ -39,5 +39,5 @@ spec:
imagePullPolicy: Always
name: code-server
ports:
- containerPort: 8443
- containerPort: 8080
name: https
12 changes: 6 additions & 6 deletions doc/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand All @@ -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/

</VirtualHost>
```
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const startVscode = async (): Promise<void | void[]> => {

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);

Expand Down