README.md 5.4 KB
Newer Older
K
Kyle Carberry 已提交
1
# code-server
K
Kyle Carberry 已提交
2 3
[!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues)
[!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest)
4
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE)
5
[![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zxSwN8Z)
A
Asher 已提交
6

7 8
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a
remote server, accessible through the browser.
9

10 11
Try it out:
```bash
A
Asher 已提交
12
docker run -it -p 127.0.0.1:8443:8443 -p 127.0.0.1:8444:8444 -v "$PWD:/home/coder/project" codercom/code-server --allow-http --no-auth
13 14
```

15
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
16
  - If you have a Windows or Mac workstation, more easily develop for Linux.
17 18
- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
- Preserve battery life when you're on the go.
19 20
  - All intensive computation runs on your server.
  - You're no longer running excess instances of Chrome.
K
Kyle Carberry 已提交
21

22
![Screenshot](/doc/assets/ide.gif)
K
Kyle Carberry 已提交
23 24

## Getting Started
K
Kyle Carberry 已提交
25
### Run over SSH
K
Kyle Carberry 已提交
26
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
K
Kyle Carberry 已提交
27

28
### Docker
29 30
See docker oneliner mentioned above. Dockerfile is at
[/Dockerfile](/Dockerfile).
31 32

### Binaries
33 34
1.  [Download a binary](https://github.com/cdr/code-server/releases) (Linux and
    OS X supported. Windows coming soon)
K
Kyle Carberry 已提交
35 36
2.  Start the binary with the project directory as the first argument

37 38 39 40 41
```
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.
A
Asher 已提交
42

43 44 45
`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.
K
Kyle Carberry 已提交
46

47 48
For detailed instructions and troubleshooting, see the
[self-hosted quick start guide](doc/self-hosted/index.md).
K
Kyle Carberry 已提交
49

50 51 52
Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md),
[AWS](doc/admin/install/aws.md), and
[DigitalOcean](doc/admin/install/digitalocean.md).
A
Asher 已提交
53

K
Kyle Carberry 已提交
54 55
How to [secure your setup](/doc/security/ssl.md).

56
### Build
A
Asher 已提交
57 58 59
- If you also plan on developing, set the `OUT` environment variable:
  `export OUT=/path/to/some/directory`. Otherwise it will build in this
  directory which will cause issues because `yarn watch` will try to
A
Asher 已提交
60
  compile the build directory as well.
A
Asher 已提交
61
- For now `@coder/nbin` is a global dependency.
A
Asher 已提交
62
- Run `yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}` in
A
Asher 已提交
63 64 65 66
  this directory (for example: `yarn build development 1.36.0 linux x64`).
- 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).
A
Asher 已提交
67 68 69
- 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.
A
Asher 已提交
70

71
## Known Issues
72
- Creating custom VS Code extensions and debugging them doesn't work.
73 74 75 76 77
- 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.
K
Kyle Carberry 已提交
78

79
## Future
80 81
- **Stay up to date!** Get notified about new releases of code-server.
  ![Screenshot](/doc/assets/release.gif)
K
Kyle Carberry 已提交
82
- Windows support.
M
Mike Hatch 已提交
83
- Electron and Chrome OS applications to bridge the gap between local<->remote.
K
Kyle Carberry 已提交
84 85
- Run VS Code unit tests against our builds to ensure features work as expected.

86 87 88 89
## 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.
90

91
## Telemetry
A
Asher 已提交
92
Use the `--disable-telemetry` flag to completely disable telemetry.
93

A
Asher 已提交
94
We use the data collected to improve code-server.
95

K
Kyle Carberry 已提交
96
## Contributing
A
Asher 已提交
97

A
Asher 已提交
98 99 100 101
### Development
```fish
git clone https://github.com/microsoft/vscode
cd vscode
A
Asher 已提交
102
git checkout 1.36.0
A
Asher 已提交
103 104 105 106 107 108
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").
A
Asher 已提交
109
# Run the next command in another shell.
A
Asher 已提交
110 111 112 113 114 115 116 117 118
yarn start --allow-http --no-auth
# Visit http://localhost:8443
```

### Upgrading VS Code
We have to 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.
A
Asher 已提交
119

A
Asher 已提交
120 121 122
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.
A
Asher 已提交
123

A
Asher 已提交
124
## License
K
Kyle Carberry 已提交
125
[MIT](LICENSE)
A
Asher 已提交
126

K
Kyle Carberry 已提交
127
## Enterprise
128 129
Visit [our enterprise page](https://coder.com/enterprise) for more information
about our enterprise offering.
A
Asher 已提交
130 131

## Commercialization
132 133
If you would like to commercialize code-server, please contact
contact@coder.com.