README.md 4.7 KB
Newer Older
A
Asher 已提交
1
# code-server · [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cdr/code-server/blob/master/LICENSE) [!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest) [![Build Status](https://img.shields.io/travis/com/cdr/code-server/master)](https://github.com/cdr/code-server)
A
Asher 已提交
2

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

6
Try it out:
7

8
```bash
9
docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" codercom/code-server
10 11
```

A
Asher 已提交
12
- **Consistent environment:** Code on your Chromebook, tablet, and laptop with a
A
Asher 已提交
13 14
  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.
A
Asher 已提交
15 16 17
- **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.
K
Kyle Carberry 已提交
18

19
![Screenshot](/doc/assets/ide.gif)
K
Kyle Carberry 已提交
20

A
Asher 已提交
21 22 23 24 25
## VS Code

- See [our VS Code readme](./src/vscode) for more information about how
  code-server and VS Code work together.

K
Kyle Carberry 已提交
26
## Getting Started
27 28 29

### Requirements

A
Asher 已提交
30 31 32
- 64-bit host.
- At least 1GB of RAM.
- 2 cores or more are recommended (1 core works but not optimally).
A
Asher 已提交
33 34
- Secure connection over HTTPS or localhost (required for service workers and
  clipboard support).
A
Asher 已提交
35
- For Linux: GLIBC 2.17 or later and GLIBCXX 3.4.15 or later.
36 37
- Docker (for Docker versions of `code-server`).

K
Kyle Carberry 已提交
38
### Run over SSH
39

K
Kyle Carberry 已提交
40
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
K
Kyle Carberry 已提交
41

42
### Docker
43

A
Asher 已提交
44
See the Docker one-liner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
45

A
Asher 已提交
46
### Digital Ocean
47

A
Asher 已提交
48 49
[![Create a Droplet](./doc/assets/droplet.svg)](https://marketplace.digitalocean.com/apps/code-server?action=deploy)

A
Asher 已提交
50
### Binaries
51

A
Asher 已提交
52
1. [Download a binary](https://github.com/cdr/code-server/releases). (Linux and
53
   OS X supported. Windows coming soon)
A
Asher 已提交
54
2. Unpack the downloaded file then run the binary.
A
Asher 已提交
55
3. In your browser navigate to `localhost:8080`.
A
Asher 已提交
56

A
Asher 已提交
57 58
- 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).
K
Kyle Carberry 已提交
59

A
Asher 已提交
60 61
### Build

A
Asher 已提交
62
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
A
Asher 已提交
63 64

```shell
A
Asher 已提交
65 66 67 68
yarn
yarn build
node build/out/entry.js # You can run the built JavaScript with Node.
yarn binary             # Or you can package it into a binary.
A
Asher 已提交
69 70
```

A
Asher 已提交
71 72 73
If changes are made to the patch and you've built previously you must manually
reset VS Code then run `yarn patch:apply`.

A
Asher 已提交
74 75 76
## Security

### Authentication
A
Anmol Sethi 已提交
77

A
Asher 已提交
78 79 80
By default `code-server` enables password authentication using a randomly
generated password. You can set the `PASSWORD` environment variable to use your
own instead or use `--auth none` to disable password authentication.
A
Asher 已提交
81 82 83 84 85

Do not expose `code-server` to the open internet without some form of
authentication.

### Encrypting traffic with HTTPS
A
Anmol Sethi 已提交
86

A
Asher 已提交
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
If you aren't doing SSL termination elsewhere you can directly give
`code-server` a certificate with `code-server --cert` followed by the path to
your certificate. Additionally, you can use certificate keys with `--cert-key`
followed by the path to your key. If you pass `--cert` without any path
`code-server` will generate a self-signed certificate.

If `code-server` has been passed a certificate it will also respond to HTTPS
requests and will redirect all HTTP requests to HTTPS. Otherwise it will respond
only to HTTP requests.

You can use [Let's Encrypt](https://letsencrypt.org/) to get an SSL certificate
for free.

Do not expose `code-server` to the open internet without SSL, whether built-in
or through a proxy.

103
## Future
104

A
Asher 已提交
105
- **Stay up to date!** Get notified about new releases of `code-server`.
106
  ![Screenshot](/doc/assets/release.gif)
M
Mike Hatch 已提交
107
- Electron and Chrome OS applications to bridge the gap between local<->remote.
108

109
## Telemetry
110

A
Asher 已提交
111 112
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
data collected to improve code-server.
113

K
Kyle Carberry 已提交
114
## Contributing
115

A
Asher 已提交
116
### Development
117

A
Asher 已提交
118
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
A
Asher 已提交
119

A
Asher 已提交
120
```shell
A
Asher 已提交
121
yarn
A
Asher 已提交
122
yarn watch # Visit http://localhost:8080 once completed.
A
Asher 已提交
123 124
```

A
Asher 已提交
125
If you run into issues about a different version of Node being used, try running
A
Asher 已提交
126
`npm rebuild` in the VS Code directory.
A
Asher 已提交
127

A
Asher 已提交
128 129
If changes are made to the patch and you've built previously you must manually
reset VS Code then run `yarn patch:apply`.
130

A
Asher 已提交
131
## License
132

K
Kyle Carberry 已提交
133
[MIT](LICENSE)
A
Asher 已提交
134

K
Kyle Carberry 已提交
135
## Enterprise
136

A
Asher 已提交
137 138
Visit [our enterprise page](https://coder.com) for more information about our
enterprise offering.
A
Asher 已提交
139 140

## Commercialization
141

142 143
If you would like to commercialize code-server, please contact
contact@coder.com.