Skip to content

Commit a0a77e3

Browse files
committed
Add doc/guide.md
1 parent f4a7858 commit a0a77e3

File tree

11 files changed

+535
-72
lines changed

11 files changed

+535
-72
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ systemctl --user enable --now code-server
3535

3636
### npm
3737

38+
We recommend installing from `npm` if we don't have a precompiled release for your machine's
39+
platform or architecture.
40+
3841
**note:** Installing via `npm` requires certain dependencies for the native module builds.
3942
See [./doc/npm.md](./doc/npm.md) for installing these dependencies.
4043

ci/README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ Any file and directory added into this tree should be documented here.
1010

1111
Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub) installed.
1212

13-
1. Update the version of code-server in `package.json` and README.md install examples and push a commit
14-
1. GitHub actions will generate the `npm-package` and `release-packages` artifacts
15-
1. Run `yarn release:github-draft` to create a GitHub draft release from the template with
13+
1. Update the version of code-server in `package.json` and README.md/guide.md install examples and push a commit
14+
2. GitHub actions will generate the `npm-package` and `release-packages` artifacts
15+
3. Run `yarn release:github-draft` to create a GitHub draft release from the template with
1616
the updated version.
1717
1. Summarize the major changes in the release notes and link to the relevant issues.
18-
1. Wait for the artifacts in step 2 to build
19-
1. Run `yarn release:github-assets` to download the artifacts and then upload them to the draft release
20-
1. Run some basic sanity tests on one of the released packages
21-
1. Publish the release
18+
4. Wait for the artifacts in step 2 to build
19+
5. Run `yarn release:github-assets` to download the artifacts and then upload them to the draft release
20+
6. Run some basic sanity tests on one of the released packages
21+
7. Publish the release
2222
1. CI will automatically grab the artifacts and then
2323
1. Publish the NPM package
24-
1. Publish the AMD64 docker image
25-
1. Publish the ARM64 docker image
24+
2. Publish the AMD64 docker image
25+
3. Publish the ARM64 docker image
2626

2727
## dev
2828

ci/dev/fmt.sh

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ main() {
2121
)
2222
prettier --write --loglevel=warn $(git ls-files "${prettierExts[@]}")
2323

24+
doctoc --title '# FAQ' doc/FAQ.md > /dev/null
25+
doctoc --title '# Setup Guide' doc/guide.md > /dev/null
26+
2427
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
2528
echo "Files need generation or are formatted incorrectly:"
2629
git -c color.ui=always status | grep --color=no '\[31m'

doc/FAQ.md

+71-41
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13
# FAQ
24

5+
- [Questions?](#questions)
6+
- [What's the deal with extensions?](#whats-the-deal-with-extensions)
7+
- [Where are extensions stored?](#where-are-extensions-stored)
8+
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
9+
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
10+
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
11+
- [Sub-domains](#sub-domains)
12+
- [Sub-paths](#sub-paths)
13+
- [Multi Tenancy](#multi-tenancy)
14+
- [Docker in code-server docker container?](#docker-in-code-server-docker-container)
15+
- [Collaboration](#collaboration)
16+
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
17+
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
18+
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
19+
- [Heartbeat file](#heartbeat-file)
20+
- [Enterprise](#enterprise)
21+
22+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
23+
324
## Questions?
425

5-
Please file all questions and support requests at https://www.reddit.com/r/codeserver/
6-
The issue tracker is only for bugs.
26+
Please file all questions and support requests at https://www.reddit.com/r/codeserver/.
27+
28+
The issue tracker is **only** for bugs.
729

830
## What's the deal with extensions?
931

@@ -23,42 +45,53 @@ Issue [#1299](https://github.com/cdr/code-server/issues/1299) is a big one in ma
2345
better by allowing the community to submit extensions and repos to avoid waiting until the scraper finds
2446
an extension.
2547

26-
If an extension does not work, try to grab its VSIX from its Github releases or build it yourself and
27-
copy it to the extensions folder.
48+
If an extension is not available or does not work, you can grab its VSIX from its Github releases or
49+
build it yourself and [Install from VSIX](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix).
2850

29-
## How is this different from VS Code Online?
51+
Feel free to file an issue to add a missing extension to the marketplace.
3052

31-
VS Code Online is a closed source managed service by Microsoft and only runs on Azure.
53+
## Where are extensions stored?
3254

33-
code-server is open source and can be freely run on any machine.
55+
Defaults to `~/.local/share/code-server/extensions`.
3456

35-
## How should I expose code-server to the internet?
57+
If the `XDG_DATA_HOME` environment variable is set the data directory will be
58+
`$XDG_DATA_HOME/code-server/extensions`.
59+
60+
You can install an extension on the CLI with:
3661

37-
By far the most secure method of using code-server is via
38-
[sshcode](https://github.com/codercom/sshcode) as it runs code-server and then forwards
39-
its port over SSH and requires no setup on your part other than having a working SSH server.
62+
```bash
63+
# From the Coder extension marketplace
64+
code-server --install-extension ms-python.python
4065

41-
You can also forward your SSH key and GPG agent to the remote machine to securely access GitHub
42-
and securely sign commits without duplicating your keys onto the the remote machine.
66+
# From a downloaded VSIX on the file system
67+
code-server --install-extension downloaded-ms-python.python.vsix
68+
```
69+
70+
## How is this different from VS Code Codespaces?
71+
72+
VS Code Codespaces is a closed source and paid service by Microsoft. It also allows you to access
73+
VS Code via the browser.
4374

44-
1. https://developer.github.com/v3/guides/using-ssh-agent-forwarding/
45-
1. https://wiki.gnupg.org/AgentForwarding
75+
However, code-server is free, open source and can be ran on any machine without any limitations.
4676

47-
If you cannot use sshcode, then you will need to ensure there is some sort of authorization in
48-
front of code-server and that you are using HTTPS to secure all connections.
77+
While you can self host environments with VS Code Codespaces, you still need to an Azure billing
78+
account and you access VS Code via the Codespaces web dashboard instead of directly connecting to
79+
your instance.
80+
81+
## How should I expose code-server to the internet?
4982

50-
By default when listening externally, code-server enables password authentication using a
51-
randomly generated password so you can use that. You can set the `PASSWORD` environment variable
52-
to use your own instead. If you want to handle authentication yourself, use `--auth none`
53-
to disable password authentication.
83+
Please follow [./guide.md]](./guide.md) for our recommendations on setting up and using code-server.
84+
85+
code-server only supports password authentication natively.
5486

5587
**note**: code-server will rate limit password authentication attempts at 2 a minute and 12 an hour.
5688

57-
If you want to use external authentication you should handle this with a reverse
58-
proxy using something like [oauth2_proxy](https://github.com/pusher/oauth2_proxy).
89+
If you want to use external authentication (i.e sign in with Google) you should handle this
90+
with a reverse proxy using something like [oauth2_proxy](https://github.com/pusher/oauth2_proxy).
5991

60-
For HTTPS, you can use a self signed certificate by passing in just `--cert` or pass in an existing
61-
certificate by providing the path to `--cert` and the path to its key with `--cert-key`.
92+
For HTTPS, you can use a self signed certificate by passing in just `--cert` or
93+
pass in an existing certificate by providing the path to `--cert` and the path to
94+
its key with `--cert-key`.
6295

6396
If `code-server` has been passed a certificate it will also respond to HTTPS
6497
requests and will redirect all HTTP requests to HTTPS. Otherwise it will respond
@@ -67,6 +100,8 @@ only to HTTP requests.
67100
You can use [Let's Encrypt](https://letsencrypt.org/) to get an SSL certificate
68101
for free.
69102

103+
Again, Please follow [./guide.md]](./guide.md) for our recommendations on setting up and using code-server.
104+
70105
## How do I securely access web services?
71106

72107
code-server is capable of proxying to any port using either a subdomain or a
@@ -96,15 +131,6 @@ ensure your reverse proxy forwards that information if you are using one.
96131

97132
Just browse to `/proxy/<port>/`.
98133

99-
## x86 releases?
100-
101-
node has dropped support for x86 and so we decided to as well. See
102-
[nodejs/build/issues/885](https://github.com/nodejs/build/issues/885).
103-
104-
## Alpine builds?
105-
106-
Just install `libc-dev` and code-server should work.
107-
108134
## Multi Tenancy
109135

110136
If you want to run multiple code-server's on shared infrastructure, we recommend using virtual
@@ -127,8 +153,9 @@ to make volume mounts in any other directory work.
127153

128154
## Collaboration
129155

130-
At the moment we have no plans for multi user collaboration on code-server but we understand there is strong
131-
demand and will work on it when the time is right.
156+
We understand the high demand but the team is swamped right now.
157+
158+
You can follow progress at [#33](https://github.com/cdr/code-server/issues/33).
132159

133160
## How can I disable telemetry?
134161

@@ -165,13 +192,16 @@ information from the following places:
165192
Additionally, collecting core dumps (you may need to enable them first) if
166193
code-server crashes can be helpful.
167194

168-
### Where is the data directory?
195+
## Heartbeat file
169196

170-
If the `XDG_DATA_HOME` environment variable is set the data directory will be
171-
`$XDG_DATA_HOME/code-server`. Otherwise:
197+
`code-server` touches `~/.local/share/code-server/heartbeat` once a minute as long
198+
as there is an active browser connection.
199+
200+
If you want to shutdown `code-server` if there hasn't been an active connection in X minutes
201+
you can do so by continously checking the last modified time on the heartbeat file and if it is
202+
older than X minutes, you should kill `code-server`.
172203

173-
1. Unix: `~/.local/share/code-server`
174-
1. Windows: `%APPDATA%\Local\code-server\Data`
204+
[#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better.
175205

176206
## Enterprise
177207

0 commit comments

Comments
 (0)