-
Notifications
You must be signed in to change notification settings - Fork 6k
[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
Changes from all commits
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
310bfe5
Delete all the things
code-asher 4861405
Initial connection handling
code-asher 68fe085
Add channels
code-asher 98f0013
Add content types
code-asher a0121f2
Implement file provider
code-asher 0d618bb
Use spdlog for log service
code-asher 4e0a6d2
Partial extension host, some restructuring
code-asher 7072bf1
Use new URI transformer everywhere
code-asher d808bfa
Set workspace and folder URIs
code-asher 57a8186
Add development steps
code-asher a6703ec
Prevent sending disconnect if disposed
code-asher 2e77c9d
Scan extensions
code-asher 4685f67
Pass product configuration
code-asher 3a78c09
Run log cleaner
code-asher 6a35ab1
Add (unimplemented) webview server
code-asher 770e0db
Add cli arguments
code-asher 61c281e
Add arguments for ports
code-asher 5677ff2
Add build scripts
code-asher f8f4bfd
Customize JSON files with code-server name
code-asher 6156eb9
Don't wait to start main server
code-asher 3ca90a5
Use nbin in forked processes
code-asher 197d8db
Need to run `yarn compile` once
code-asher f51751a
Replace jq with some JavaScript
code-asher a20fa4a
Implement extensions channel
code-asher fe1d609
Make it possible to request absolute paths
code-asher f482087
Implement webview server
code-asher 86e8ba1
Add gallery channel
code-asher 54ffd1d
Make extension sidebar work
code-asher 09e3cfd
Create extension directory on startup
code-asher 2fdf09e
Include version when building
code-asher 81862d4
Add back (most of) our old arguments
code-asher 2b2aa9a
Add https server
code-asher 97167e7
Add authentication
code-asher 286f9a8
Implement multiple extension directories
code-asher e22791e
Fix interactive playground
code-asher 8dcc1e3
Accept argument to change initial working directory
code-asher 68c6208
Fix opening snippets
code-asher 9446cc8
Update Dockerfile
code-asher 9b0b337
Implement open flag
code-asher feabfc8
Fix different node binary warning
code-asher 83819cb
Fix vscode-ripgrep rebuild error
code-asher 1a3fc86
Reconnection works
code-asher b6fdb7d
Telemetry
code-asher db41f10
Fix open flag when using 0.0.0.0
code-asher 4b0cceb
Extract ripgrep when inside binary
code-asher 45d348b
Expose API on the client
code-asher b0e6c1c
Fix favicon
code-asher 2be452d
Fix rg extraction in Docker build
code-asher e8cb6ff
Implement file uploads
code-asher 9fdfacb
Quality check
code-asher 36b8731
Add some missing development steps
code-asher 078af59
Replace demo image with GIF (#863)
kylecarbs cd54aec
Fix login redirect when not using https
code-asher 09cd1e8
Make sub-paths work
code-asher 436ef7b
Fix VS Code version in readme and describe our changes
code-asher 068e07b
Clean up the patch
code-asher 92daabc
Open folder at base URL
code-asher 7b7f5b5
Add base path argument
code-asher fd55139
Make flags additive and clean up docs
code-asher 329acbb
Combine main and webview servers
code-asher a4f21fb
Install git during build
code-asher 4c4a179
TLS socket still doesn't work
code-asher 8ded89e
Firefox fixes
code-asher 011530e
Proxy TLS sockets
code-asher 87be3ac
Add comment explaining use of merge
code-asher 0315b00
Add comment for the nbin shim
code-asher 62719ab
Clean up client API
code-asher 12af311
Use our logger instead of raw console.log
code-asher 5944b84
Make it clearer what the tar code does
code-asher bd0f1d0
Support vscode-resource requests in webview
code-asher bce0cac
Document recent VS Code patch changes
code-asher 60ed065
Reformat readme intro
code-asher 712274d
Groundwork for language support
code-asher 5b64cb3
Fix login page
code-asher 950bfce
Add commit, date, and checksums to product.json
code-asher dde683d
Fix login submission when using a base path
code-asher 590f699
Allow specifying the target
code-asher dc333d4
Fix extensions not being bundled into prebuilt
code-asher 7e794bd
Fix favicon not being included in final build
code-asher 01a9ab3
Set commit based on code-server instead of VS Code
code-asher f5a6f14
Implement update service
code-asher 2b3e8e1
Don't exclude .git for Docker
code-asher d4ed2ef
Change default port to 8080
code-asher 6b579d6
Fix webview address when using a proxy
code-asher b257c60
Fix websocket defaulting to port 80 when authority has no port
code-asher ba72851
Update VS Code to 1.37.0
code-asher 2807ce4
Add tar-stream dependency
code-asher 1d61cbe
Make release directory
code-asher 7389d9e
Use current URL for webview
code-asher b566b66
Fix service worker scope when there is a base path
code-asher 5539519
Remove extra slash when opening folder
code-asher 90e8714
Preserve query variables when redirecting
code-asher c11d5fe
Fix error when passing empty extra extension dir flag
code-asher 2470081
Exit when pipe closes
code-asher 45ad7f0
Update logger
code-asher 83f86a4
Load language bundles on the client
code-asher 07ec4ca
Fix PHP syntax highlighting
code-asher a48c2fb
Handle webview service worker resource requests
code-asher 72fe124
Fix loading resources in webviews
code-asher d1662d7
Ensure service workers are supported before use
code-asher f61a0ae
Set unexpected error handler on startup
code-asher 6737384
Handle existing query when opening folder
code-asher b4e1a62
Fix tasks
code-asher ce3b7df
Use readlink -f if realpath isn't available
code-asher e53d6bc
Forward GitHub token to docker build if it exists
code-asher b9fc404
Forward minify environment variable to Docker build
code-asher 534600c
Don't error when scanning nonexistent extension dir
code-asher ccc4f87
Don't package for release if we don't need to
code-asher c2be0ec
Fix Firefox when using extensions that insert styles
code-asher 80050d0
Detect target automatically
code-asher c19223b
Fix error when building without first running yarn
code-asher 950dad9
Simplify getting the absolute path during build
code-asher ddd5a9a
Update data and extension paths to match version one
code-asher 3e2d12a
Fix scrolling on Firefox
code-asher 4800ec6
Fix playground when behind a proxy with a sub-path
code-asher c4fd725
Fix built-in Typescript when bundled
code-asher 78b6b3a
Add check for missing reconnection token
code-asher 830ccfe
Fix toggling and hiding the menu bar
code-asher d33b2d2
Fix web view sometimes not loading correctly
code-asher a3ee7c9
Don't open cwd by default
code-asher c9ce9eb
Fix spawns against Node
code-asher 624a4c0
Minify Docker build
code-asher b901043
Target a recent commit for VS Code
code-asher 976a326
Update nbin
code-asher 12bc26b
Implement status bar API
code-asher da7d8b0
Update VS Code
code-asher a26844e
Add package.json for publishing API types
code-asher 9d8906d
Add version format flag
code-asher 4400045
Add environment variable for telemetry endpoint
code-asher 12e6084
Add caching
code-asher 1164801
Keep a maximum number of connections instead of a timeout
code-asher e9fce80
Make extension host reconnect
code-asher 0e1fed3
Make CI script work independently from your cwd
code-asher 5b51999
resolve tree conflicts with master
sr229 8643bdc
fix further conflicts in README.md
sr229 cb0f9c5
re-add GH-969
sr229 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
/lib | ||
node_modules | ||
dist | ||
out | ||
.DS_Store | ||
build | ||
release | ||
.vscode | ||
.cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
10.15.1 | ||
10.16.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
scripts-prepend-node-path=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,133 @@ | ||
# code-server [](https://github.com/cdr/code-server/issues) [](https://github.com/cdr/code-server/releases/latest) [](https://github.com/cdr/code-server/blob/master/LICENSE) [](https://discord.gg/zxSwN8Z) | ||
# code-server · [](https://github.com/cdr/code-server/blob/master/LICENSE) [](https://github.com/cdr/code-server/releases/latest) [](https://github.com/cdr/code-server) | ||
|
||
**code-server v2 is almost out!** | ||
[Get the preview here](https://github.com/cdr/code-server/releases). | ||
(Linux builds only at the moment.) | ||
|
||
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser. | ||
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a | ||
remote server, accessible through the browser. | ||
|
||
Try it out: | ||
```bash | ||
docker run -it -p 127.0.0.1:8443:8443 -v "${HOME}/.local/share/code-server:/home/coder/.local/share/code-server" -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth | ||
docker run -it -p 127.0.0.1:8080:8080 -v "${HOME}/.local/share/code-server:/home/coder/.local/share/code-server" -v "$PWD:/home/coder/project" codercom/code-server | ||
``` | ||
|
||
- Code on your Chromebook, tablet, and laptop with a consistent dev environment. | ||
- If you have a Windows or Mac workstation, more easily develop for Linux. | ||
- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more. | ||
- Preserve battery life when you're on the go. | ||
- All intensive computation runs on your server. | ||
- You're no longer running excess instances of Chrome. | ||
- **Consistent environment:** Code on your Chromebook, tablet, and laptop with a | ||
consistent dev environment. develop more easily for Linux if you have a | ||
Windows or Mac, and pick up where you left off when switching workstations. | ||
- **Server-powered:** Take advantage of large cloud servers to speed up tests, | ||
compilations, downloads, and more. Preserve battery life when you're on the go | ||
since all intensive computation runs on your server. | ||
|
||
 | ||
 | ||
|
||
## Getting Started | ||
|
||
[](https://marketplace.digitalocean.com/apps/code-server?action=deploy) | ||
|
||
### Run over SSH | ||
|
||
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup. | ||
|
||
### Docker | ||
See the Docker one-liner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile). | ||
|
||
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile). | ||
To debug Golang using the | ||
[ms-vscode-go extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go), | ||
you need to add `--security-opt seccomp=unconfined` to your `docker run` | ||
arguments when launching code-server with Docker. See | ||
[#725](https://github.com/cdr/code-server/issues/725) for details. | ||
|
||
### Binaries | ||
|
||
1. [Download a binary](https://github.com/cdr/code-server/releases) (Linux and OS X supported. Windows coming soon) | ||
2. Start the binary with the project directory as the first argument | ||
|
||
``` | ||
code-server <initial directory to open> | ||
``` | ||
> You will be prompted to enter the password shown in the CLI | ||
`code-server` should now be running at https://localhost:8443. | ||
|
||
> code-server uses a self-signed SSL certificate that may prompt your browser to ask you some additional questions before you proceed. Please [read here](doc/self-hosted/index.md) for more information. | ||
|
||
For detailed instructions and troubleshooting, see the [self-hosted quick start guide](doc/self-hosted/index.md). | ||
|
||
Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [DigitalOcean](doc/admin/install/digitalocean.md). | ||
|
||
How to [secure your setup](/doc/security/ssl.md). | ||
|
||
## Development | ||
|
||
### Known Issues | ||
|
||
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: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). | ||
|
||
### Build | ||
- If you also plan on developing, set the `OUT` environment variable. Otherwise | ||
it will build in this directory which will cause issues because `yarn watch` | ||
will try to compile the build directory as well. | ||
- For now `@coder/nbin` is a global dependency. | ||
- Run `yarn build ${vscodeVersion} ${codeServerVersion}` in this directory (for | ||
example: `yarn build 1.36.0 development`). | ||
- If you target the same VS Code version our Travis builds do everything will | ||
work but if you target some other version it might not (we have to do some | ||
patching to VS Code so different versions aren't always compatible). | ||
- You can run the built code with `node path/to/build/out/vs/server/main.js` or run | ||
`yarn binary` with the same arguments in the previous step to package the | ||
code into a single binary. | ||
|
||
## Known Issues | ||
- Uploading .vsix files doesn't work. | ||
- Creating custom VS Code extensions and debugging them doesn't work. | ||
- To debug Golang using [ms-vscode-go extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go), you need to add `--security-opt seccomp=unconfined` to your `docker run` arguments when launching code-server with Docker. See [#725](https://github.com/cdr/code-server/issues/725) for details. | ||
- Extension profiling and tips are currently disabled. | ||
|
||
### Future | ||
## Future | ||
- **Stay up to date!** Get notified about new releases of code-server. | ||
 | ||
- Windows support. | ||
- Electron and Chrome OS applications to bridge the gap between local<->remote. | ||
- Run VS Code unit tests against our builds to ensure features work as expected. | ||
|
||
### Extensions | ||
|
||
At the moment we can't use the official VSCode Marketplace. We've created a custom extension marketplace focused around open-sourced extensions. However, if you have access to the `.vsix` file, you can manually install the extension. | ||
## Extensions | ||
At the moment we can't use the official VS Code Marketplace. We've created a | ||
custom extension marketplace focused around open-sourced extensions. However, | ||
you can manually download the extension to your extensions directory. It's also | ||
possible to set your own marketplace URLs by setting the `SERVICE_URL` and | ||
`ITEM_URL` environment variables. | ||
|
||
## Telemetry | ||
|
||
Use the `--disable-telemetry` flag or set `DISABLE_TELEMETRY=true` to disable tracking ENTIRELY. | ||
|
||
We use data collected to improve code-server. | ||
Use the `--disable-telemetry` flag to completely disable telemetry. We use the | ||
data collected to improve code-server. | ||
|
||
## Contributing | ||
### Development | ||
```shell | ||
git clone https://github.com/microsoft/vscode | ||
cd vscode | ||
git checkout <see travis.yml for the VS Code version to use here> | ||
git clone https://github.com/cdr/code-server src/vs/server | ||
cd src/vs/server | ||
yarn patch:apply | ||
yarn | ||
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:8080 | ||
``` | ||
|
||
Development guides are coming soon. | ||
If you run into issues about a different version of Node being used, try running | ||
`npm rebuild` in the VS Code directory and ignore the error at the end from | ||
`vscode-ripgrep`. | ||
|
||
### Upgrading VS Code | ||
We patch VS Code to provide and fix some functionality. As the web portion of VS | ||
Code matures, we'll be able to shrink and maybe even entirely eliminate our | ||
patch. In the meantime, however, upgrading the VS Code version requires ensuring | ||
that the patch still applies and has the intended effects. | ||
|
||
To generate a new patch, **stage all the changes** you want to be included in | ||
the patch in the VS Code source, then run `yarn patch:generate` in this | ||
directory. | ||
|
||
Our changes include: | ||
- Change the remote schema to `code-server`. | ||
- Allow multiple extension directories (both user and built-in). | ||
- Modify the loader, websocket, webview, service worker, and asset requests to | ||
use the URL of the page as a base (and TLS if necessary for the websocket). | ||
- Send client-side telemetry through the server and get the initial log level | ||
from the server. | ||
- Add an upload service for use in editor windows and the explorer along with a | ||
file prefix to ignore for temporary files created during upload. | ||
- Make changing the display language work. | ||
- Make hiding or toggling the menu bar possible. | ||
- Make it possible for us to load code on the client. | ||
- Modify the build process to include our code. | ||
|
||
## License | ||
|
||
[MIT](LICENSE) | ||
|
||
## Enterprise | ||
|
||
Visit [our website](https://coder.com/) for more information about our enterprise offering. | ||
Visit [our enterprise page](https://coder.com/enterprise) for more information | ||
about our enterprise offering. | ||
|
||
## Commercialization | ||
|
||
If you would like to commercialize code-server, please contact contact@coder.com. | ||
If you would like to commercialize code-server, please contact | ||
contact@coder.com. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.