Skip to content

Commit 676fa46

Browse files
committed
Telemetry
1 parent d77ba52 commit 676fa46

File tree

7 files changed

+384
-303
lines changed

7 files changed

+384
-303
lines changed

README.md

+29-30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# code-server
2-
32
[!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues)
43
[!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest)
54
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE)
@@ -23,18 +22,14 @@ docker run -it -p 127.0.0.1:8443:8443 -p 127.0.0.1:8444:8444 -v "$PWD:/home/code
2322
![Screenshot](/doc/assets/ide.png)
2423

2524
## Getting Started
26-
2725
### Run over SSH
28-
2926
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
3027

3128
### Docker
32-
3329
See docker oneliner mentioned above. Dockerfile is at
3430
[/Dockerfile](/Dockerfile).
3531

3632
### Binaries
37-
3833
1. [Download a binary](https://github.com/cdr/code-server/releases) (Linux and
3934
OS X supported. Windows coming soon)
4035
2. Start the binary with the project directory as the first argument
@@ -65,28 +60,15 @@ How to [secure your setup](/doc/security/ssl.md).
6560
compile the build directory as well.
6661
- For now `@coder/nbin` is a global dependency.
6762
- Run `yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}` in
68-
this directory (for example: `yarn build development 1.35.0 linux x64`).
63+
this directory (for example: `yarn build development 1.36.0 linux x64`).
64+
- If you target the same VS Code version our Travis builds do everything will
65+
work but if you target some other version it might not (we have to do some
66+
patching to VS Code so different versions aren't always compatible).
6967
- You can run the built code with `node path/to/build/out/vs/server/main.js` or run
7068
`yarn binary` with the same arguments in the previous step to package the
7169
code into a single binary.
7270

73-
### Development
74-
75-
```fish
76-
git clone https://github.com/microsoft/vscode
77-
cd vscode
78-
git clone https://github.com/cdr/code-server src/vs/server
79-
cd src/vs/server
80-
yarn patch:apply
81-
yarn
82-
yarn watch
83-
# Wait for the initial compilation to complete (it will say "Finished compilation").
84-
yarn start --allow-http --no-auth
85-
# Visit http://localhost:8443
86-
```
87-
8871
## Known Issues
89-
9072
- Creating custom VS Code extensions and debugging them doesn't work.
9173
- To debug Golang using
9274
[ms-vscode-go extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go),
@@ -102,31 +84,48 @@ yarn start --allow-http --no-auth
10284
- Run VS Code unit tests against our builds to ensure features work as expected.
10385

10486
## Extensions
105-
10687
At the moment we can't use the official VSCode Marketplace. We've created a
10788
custom extension marketplace focused around open-sourced extensions. However,
10889
if you have access to the `.vsix` file, you can manually install the extension.
10990

11091
## Telemetry
92+
Use the `--disable-telemetry` flag to completely disable telemetry.
11193

112-
Set the `telemetry.enableTelemetry` user setting to false to disable telemetry.
113-
114-
We use data collected to improve code-server.
94+
We use the data collected to improve code-server.
11595

11696
## Contributing
11797

118-
Development guides are coming soon.
98+
### Development
99+
```fish
100+
git clone https://github.com/microsoft/vscode
101+
cd vscode
102+
git clone https://github.com/cdr/code-server src/vs/server
103+
cd src/vs/server
104+
yarn patch:apply
105+
yarn
106+
yarn watch
107+
# Wait for the initial compilation to complete (it will say "Finished compilation").
108+
yarn start --allow-http --no-auth
109+
# Visit http://localhost:8443
110+
```
111+
112+
### Upgrading VS Code
113+
We have to patch VS Code to provide and fix some functionality. As the web
114+
portion of VS Code matures, we'll be able to shrink and maybe even entirely
115+
eliminate our patch. In the meantime, however, upgrading the VS Code version
116+
requires ensuring that the patch still applies and has the intended effects.
119117

120-
## License
118+
To generate a new patch, **stage all the changes** you want to be included in
119+
the patch in the VS Code source, then run `yarn patch:generate` in this
120+
directory.
121121

122+
## License
122123
[MIT](LICENSE)
123124

124125
## Enterprise
125-
126126
Visit [our enterprise page](https://coder.com/enterprise) for more information
127127
about our enterprise offering.
128128

129129
## Commercialization
130-
131130
If you would like to commercialize code-server, please contact
132131

doc/self-hosted/index.md

+112-93
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,144 @@
11
# Getting Started
22

3-
[code-server](https://coder.com) is used by developers at Azure, Google, Reddit, and more to give them access to VS Code in the browser.
3+
[code-server](https://coder.com) is used by developers at Azure, Google,
4+
Reddit, and more to give them access to VS Code in the browser.
45

56
## Quickstart Guide
67

7-
> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:[email protected]?subject=Self-hosted%20quickstart%20guide).
8+
> NOTE: If you get stuck or need help, [file an issue](https://github.com/cdr/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide),
9+
> [tweet (@coderhq)](https://twitter.com/coderhq) or
10+
> [email](mailto:[email protected]?subject=Self-hosted%20quickstart%20guide).
811
9-
This document pertains to Coder specific implementations of VS Code. For documentation on how to use VS Code itself, please refer to the official [documentation for VS Code](https://code.visualstudio.com/docs)
12+
This document pertains to Coder-specific implementations of VS Code. For
13+
documentation on how to use VS Code itself, please refer to the official
14+
[documentation for VS Code](https://code.visualstudio.com/docs)
1015

11-
It takes just a few minutes to get your own self-hosted server running. If you've got a machine running macOS, Windows, or Linux, you're ready to start the binary which listens on port `8443` by default.
16+
It takes just a few minutes to get your own self-hosted server running. If
17+
you've got a machine running macOS, Windows, or Linux, you're ready to start
18+
the binary which listens on ports `8443` and `8444` by default.
1219

1320
<!--
1421
DO NOT CHANGE THIS TO A CODEBLOCK.
1522
We want line breaks for readability, but backslashes to escape them do not work cross-platform.
1623
This uses line breaks that are rendered but not copy-pasted to the clipboard.
1724
-->
1825

26+
1. Visit [the releases](https://github.com/cdr/code-server/releases) page and
27+
download the latest cli for your operating system.
28+
2. Double click the executable to run in the current directory.
29+
3. Copy the password that appears in the CLI. <img src="../assets/cli.png">
30+
4. In your browser navigate to `localhost:8443`.
31+
5. Paste the password from the cli into the login window. <img src="../assets/server-password-modal.png">
1932

20-
1. Visit [the releases](https://github.com/cdr/code-server/releases) page and download the latest cli for your operating system
21-
2. Double click the executable to run in the current directory
22-
3. Copy the password that appears in the cli<img src="../assets/cli.png">
23-
4. In your browser navigate to `localhost:8443`
24-
5. Paste the password from the cli into the login window<img src="../assets/server-password-modal.png">
25-
> NOTE: Be careful with your password as sharing it will grant those users access to your server's file system
33+
> NOTE: Be careful with your password as sharing it will grant those users
34+
> access to your server's file system
2635
2736
### Things To Know
28-
- When you visit the IP for your code-server instance, you will be greeted with a page similar to the following screenshot. Code-server is using a self-signed SSL certificate for easy setup. In Chrome/Chromium, click **"Advanced"** then click **"proceed anyway"**. In Firefox, click **Advanced**, then **Add Exception**, then finally **Confirm Security Exception**.<img src ="../assets/chrome_warning.png">
37+
- When you visit the IP for your code-server instance, you will be greeted with
38+
a page similar to the following screenshot. Code-server is using a
39+
self-signed SSL certificate for easy setup. In Chrome/Chromium, click
40+
**"Advanced"** then click **"proceed anyway"**. In Firefox, click
41+
**Advanced**, then **Add Exception**, then finally **Confirm Security
42+
Exception**. <img src ="../assets/chrome_warning.png">
2943

3044
## Usage
31-
<pre class="pre-wrap"><code>code-server<span class="virtual-br"></span> --help</code></pre>
45+
```
46+
code-server --help
47+
```
48+
49+
code-server can be ran with a number of arguments to customize your working
50+
directory, host, port, and SSL certificate.
51+
52+
### Data Directory
53+
Use `code-server --user-data-dir path/to/directory` to specify the root folder
54+
that VS Code will start in.
55+
56+
### Host
57+
By default, code-server will use `127.0.0.1` for insecure connections and
58+
`0.0.0.0` for secure connections. This can be changed by using
59+
`code-server --host `.
60+
61+
> Example: `code-server --host 127.0.0.1`
62+
63+
### Open
64+
You can have the server automatically open the VS Code in your browser on
65+
startup by using the `code-server -o` or `code-server --open` flags
66+
67+
### Port
68+
By default, code-server will use `8443` as its port. This can be changed by
69+
using `code-server -p` or `code-server --port=` followed by the port you want
70+
to use.
71+
72+
> Example: `code-server -p 9000`
73+
74+
### Cert and Cert Key
75+
To encrypt the traffic between the browser and server use `code-server --cert`
76+
followed by the path to your `.cer` file. Additionally, you can use certificate
77+
keys with `code-server --cert-key` followed by the path to your `.key` file.
3278

33-
code-server can be ran with a number of arguments to customize your working directory, host, port, and SSL certificate.
79+
Example:
80+
```
81+
code-server --cert /path/to/certificate/fullchain.cer --cert-key /path/to/certificate/fullchain.key
82+
```
3483

84+
Example for Let's Encrypt:
3585
```
36-
Usage: code-server [options]
37-
38-
Run VS Code on a remote server.
39-
40-
Options:
41-
-V, --version output the version number
42-
--cert <value>
43-
--cert-key <value>
44-
-e, --extensions-dir <dir> Override the main default path for user extensions.
45-
--extra-extensions-dir [dir] Path to an extra user extension directory (repeatable). (default: [])
46-
--extra-builtin-extensions-dir [dir] Path to an extra built-in extension directory (repeatable). (default: [])
47-
-d, --user-data-dir <dir> Specifies the directory that user data is kept in, useful when running as root.
48-
-h, --host <value> Customize the hostname. (default: "0.0.0.0")
49-
-o, --open Open in the browser on startup.
50-
-p, --port <number> Port to bind on. (default: 8443)
51-
-N, --no-auth Start without requiring authentication.
52-
-H, --allow-http Allow http connections.
53-
--disable-telemetry Disables ALL telemetry.
54-
--socket <value> Listen on a UNIX socket. Host and port will be ignored when set.
55-
--trust-proxy Trust the X-Forwarded-For header, useful when using a reverse proxy.
56-
--install-extension <value> Install an extension by its ID.
57-
-h, --help output usage information
86+
code-server --cert /etc/letsencrypt/live/example.com/fullchain.pem --cert-key /etc/letsencrypt/live/example.com/privkey.key
5887
```
5988

60-
### Data Directory
61-
Use `code-server -d (path/to/directory)` or `code-server --user-data-dir=(path/to/directory)`, excluding the parentheses to specify the root folder that VS Code will start in.
62-
63-
### Host
64-
By default, code-server will use `0.0.0.0` as its address. This can be changed by using `code-server -h` or `code-server --host=` followed by the address you want to use.
65-
> Example: `code-server -h 127.0.0.1`
66-
67-
### Open
68-
You can have the server automatically open the VS Code in your browser on startup by using the `code-server -o` or `code-server --open` flags
69-
70-
### Port
71-
By default, code-server will use `8443` as its port. This can be changed by using `code-server -p` or `code-server --port=` followed by the port you want to use.
72-
> Example: `code-server -p 9000`
73-
74-
### Telemetry
75-
Disable all telemetry with `code-server --disable-telemetry`.
76-
77-
### Cert and Cert Key
78-
To encrypt the traffic between the browser and server use `code-server --cert=` followed by the path to your `.cer` file. Additionally, you can use certificate keys with `code-server --cert-key` followed by the path to your `.key` file.
79-
> Example (certificate and key): `code-server --cert /etc/letsencrypt/live/example.com/fullchain.cer --cert-key /etc/letsencrypt/live/example.com/fullchain.key`
80-
> Example (if you are using Letsencrypt or similar): `code-server --cert /etc/letsencrypt/live/example.com/fullchain.pem --cert-key /etc/letsencrypt/live/example.com/privkey.key`
81-
82-
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
83-
84-
### Nginx Reverse Proxy
85-
Below is a virtual host example that works with code-server. Please also pass `--allow-http` and `--trust-proxy` to code-server to allow the proxy to connect. You can also use Let's Encrypt to get a SSL certificates for free.
86-
```
87-
server {
88-
listen 80;
89-
listen [::]:80;
90-
server_name code.example.com code.example.org;
91-
location / {
92-
proxy_pass http://localhost:8443/;
93-
proxy_set_header Upgrade $http_upgrade;
94-
proxy_set_header Connection upgrade;
95-
proxy_set_header Accept-Encoding gzip;
96-
}
89+
To ensure the connection between you and your server is encrypted view our
90+
guide on [securing your setup](../security/ssl.md).
91+
92+
### Nginx Reverse Proxy
93+
Below is a virtual host example that works with code-server. Please also pass
94+
`--allow-http` and `--trust-proxy` to code-server to allow the proxy to
95+
connect. You can also use Let's Encrypt to get a SSL certificates for free.
96+
97+
```
98+
server {
99+
listen 80;
100+
listen [::]:80;
101+
server_name code.example.com code.example.org;
102+
location / {
103+
proxy_pass http://localhost:8443/;
104+
proxy_set_header Upgrade $http_upgrade;
105+
proxy_set_header Connection upgrade;
106+
proxy_set_header Accept-Encoding gzip;
97107
}
98-
```
108+
}
109+
```
110+
111+
### Apache Reverse Proxy
112+
Example of an HTTPS virtualhost configuration for Apache as a reverse proxy.
113+
Please also pass `--allow-http` and `--trust-proxy` to code-server to allow the
114+
proxy to connect. You can also use Let's Encrypt to get a SSL certificates for
115+
free.
99116

100-
### Apache Reverse Proxy
101-
Example of a HTTPS virtualhost configuration for Apache as a reverse proxy. Please also pass `--allow-http` and `--trust-proxy` to code-server to allow the proxy to connect. You can also use Let's Encrypt to get a SSL certificates for free.
102-
```
103-
<VirtualHost *:80>
104-
ServerName code.example.com
117+
```
118+
<VirtualHost *:80>
119+
ServerName code.example.com
105120
106-
RewriteEngine On
107-
RewriteCond %{HTTP:Upgrade} =websocket [NC]
108-
RewriteRule /(.*) ws://localhost:8443/$1 [P,L]
109-
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
110-
RewriteRule /(.*) http://localhost:8443/$1 [P,L]
121+
RewriteEngine On
122+
RewriteCond %{HTTP:Upgrade} =websocket [NC]
123+
RewriteRule /(.*) ws://localhost:8443/$1 [P,L]
124+
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
125+
RewriteRule /(.*) http://localhost:8443/$1 [P,L]
111126
112-
ProxyRequests off
127+
ProxyRequests off
113128
114-
RequestHeader set X-Forwarded-Proto https
115-
RequestHeader set X-Forwarded-Port 443
129+
RequestHeader set X-Forwarded-Proto https
130+
RequestHeader set X-Forwarded-Port 443
116131
117-
ProxyPass / http://localhost:8443/ nocanon
118-
ProxyPassReverse / http://localhost:8443/
132+
ProxyPass / http://localhost:8443/ nocanon
133+
ProxyPassReverse / http://localhost:8443/
134+
135+
</VirtualHost>
136+
```
137+
*Important:* For more details about Apache reverse proxy configuration checkout
138+
the [documentation](https://httpd.apache.org/docs/current/mod/mod_proxy.html) -
139+
especially the [Securing your Server](https://httpd.apache.org/docs/current/mod/mod_proxy.html#access)
140+
section.
119141

120-
</VirtualHost>
121-
```
122-
*Important:* For more details about Apache reverse proxy configuration checkout the [documentation](https://httpd.apache.org/docs/current/mod/mod_proxy.html) - especially the [Securing your Server](https://httpd.apache.org/docs/current/mod/mod_proxy.html#access) section
123142

124-
### Help
125-
Use `code-server --help` to view the usage for the CLI. This is also shown at the beginning of this section.
143+
### Help
144+
Use `code-server --help` to view the usage for the CLI.

0 commit comments

Comments
 (0)