Archived
1
0

Add FAQ entry on the config file

This commit is contained in:
Anmol Sethi 2020-05-14 18:35:35 -04:00
parent 5651201643
commit c69346a9a7
No known key found for this signature in database
GPG Key ID: 8CEF1878FF10ADEB
4 changed files with 31 additions and 9 deletions

View File

@ -17,6 +17,7 @@
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open) - [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server) - [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
- [Heartbeat file](#heartbeat-file) - [Heartbeat file](#heartbeat-file)
- [How does the config file work?](#how-does-the-config-file-work)
- [Enterprise](#enterprise) - [Enterprise](#enterprise)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -55,7 +56,7 @@ Feel free to file an issue to add a missing extension to the marketplace.
Defaults to `~/.local/share/code-server/extensions`. Defaults to `~/.local/share/code-server/extensions`.
If the `XDG_DATA_HOME` environment variable is set the data directory will be If the `XDG_DATA_HOME` environment variable is set the data directory will be
`$XDG_DATA_HOME/code-server/extensions`. `$XDG_DATA_HOME/code-server/extensions`. In general we try to follow the XDG directory spec.
You can install an extension on the CLI with: You can install an extension on the CLI with:
@ -184,9 +185,8 @@ code-server --log debug
Once this is done, replicate the issue you're having then collect logging Once this is done, replicate the issue you're having then collect logging
information from the following places: information from the following places:
1. stdout. 1. stdout
2. The most recently created directory in the `logs` directory (found in the 2. The most recently created directory in the `~/.local/share/code-server/logs` directory
data directory; see below for how to find that).
3. The browser console and network tabs. 3. The browser console and network tabs.
Additionally, collecting core dumps (you may need to enable them first) if Additionally, collecting core dumps (you may need to enable them first) if
@ -198,11 +198,31 @@ code-server crashes can be helpful.
as there is an active browser connection. as there is an active browser connection.
If you want to shutdown `code-server` if there hasn't been an active connection in X minutes If you want to shutdown `code-server` if there hasn't been an active connection in X minutes
you can do so by continously checking the last modified time on the heartbeat file and if it is you can do so by continuously checking the last modified time on the heartbeat file and if it is
older than X minutes, you should kill `code-server`. older than X minutes, you should kill `code-server`.
[#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better. [#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better.
## How does the config file work?
When `code-server` starts up, it creates a default config file in `~/.config/code-server/config.yaml` that looks
like this:
```yaml
bind-addr: 127.0.0.1:8080
auth: password
password: mewkmdasosafuio3422 # This is randomly generated for each config.yaml
cert: false
```
Each key in the file maps directly to a `code-server` flag. Run `code-server --help` to see
a listing of all the flags.
The default config here says to listen on the loopback IP port 8080, enable password authorization
and no TLS. Any flags passed to `code-server` will take priority over the config file.
The `--config` flag or `$CODE_SERVER_CONFIG` can be used to change the config file's location.
## Enterprise ## Enterprise
Visit [our enterprise page](https://coder.com) for more information about our Visit [our enterprise page](https://coder.com) for more information about our

View File

@ -218,7 +218,8 @@ Visit `https://<your-instance-ip>` to access code-server.
You'll get a warning when accessing but if you click through you should be good. You'll get a warning when accessing but if you click through you should be good.
You can also use [mkcert](https://mkcert.dev) to create a self signed certificate trusted by your You can also use [mkcert](https://mkcert.dev) to create a self signed certificate trusted by your
OS to avoid the warnings. OS to avoid the warnings and then pass it to code-server via the `cert` and `cert-key` config
fields.
### Change the password? ### Change the password?

View File

@ -338,7 +338,7 @@ export async function readConfigFile(configPath?: string): Promise<Args> {
logger.info(`Wrote default config file to ${humanPath(configPath)}`) logger.info(`Wrote default config file to ${humanPath(configPath)}`)
} }
logger.info(`Using config file from ${humanPath(configPath)}`) logger.info(`Using config file ${humanPath(configPath)}`)
const configFile = await fs.readFile(configPath) const configFile = await fs.readFile(configPath)
const config = yaml.safeLoad(configFile.toString(), { const config = yaml.safeLoad(configFile.toString(), {

View File

@ -43,8 +43,9 @@ const main = async (cliArgs: Args): Promise<void> => {
} }
} }
logger.trace(`Using extensions-dir at ${humanPath(args["extensions-dir"])}`) logger.info(`Using user-data-dir ${humanPath(args["user-data-dir"])}`)
logger.trace(`Using user-data-dir at ${humanPath(args["user-data-dir"])}`)
logger.trace(`Using extensions-dir ${humanPath(args["extensions-dir"])}`)
const envPassword = !!process.env.PASSWORD const envPassword = !!process.env.PASSWORD
const password = args.auth === AuthType.Password && (process.env.PASSWORD || args.password) const password = args.auth === AuthType.Password && (process.env.PASSWORD || args.password)