Skip to content

Commit 6cab256

Browse files
committed
docs: update FAQ with new hashing instructions
1 parent 659371c commit 6cab256

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed

docs/FAQ.md

+39-36
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,39 @@
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
33
# FAQ
44

5-
- [Questions?](#questions)
6-
- [iPad Status?](#ipad-status)
7-
- [Community Projects (awesome-code-server)](#community-projects-awesome-code-server)
8-
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
9-
- [Differences compared to VS Code?](#differences-compared-to-vs-code)
10-
- [Installing an extension](#installing-an-extension)
11-
- [How can I request a missing extension?](#how-can-i-request-a-missing-extension)
12-
- [Installing an extension manually](#installing-an-extension-manually)
13-
- [How do I configure the marketplace URL?](#how-do-i-configure-the-marketplace-url)
14-
- [Where are extensions stored?](#where-are-extensions-stored)
15-
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
16-
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
17-
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
18-
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
19-
- [Sub-paths](#sub-paths)
20-
- [Sub-domains](#sub-domains)
21-
- [Why does the code-server proxy strip `/proxy/<port>` from the request path?](#why-does-the-code-server-proxy-strip-proxyport-from-the-request-path)
22-
- [Proxying to Create React App](#proxying-to-create-react-app)
23-
- [Multi-tenancy](#multi-tenancy)
24-
- [Docker in code-server container?](#docker-in-code-server-container)
25-
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
26-
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
27-
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
28-
- [Heartbeat File](#heartbeat-file)
29-
- [Healthz endpoint](#healthz-endpoint)
30-
- [How does the config file work?](#how-does-the-config-file-work)
31-
- [Isn't an install script piped into sh insecure?](#isnt-an-install-script-piped-into-sh-insecure)
32-
- [How do I make my keyboard shortcuts work?](#how-do-i-make-my-keyboard-shortcuts-work)
33-
- [How do I access my Documents/Downloads/Desktop folders in code-server on OSX?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-osx)
34-
- [Differences compared to Theia?](#differences-compared-to-theia)
35-
- [`$HTTP_PROXY`, `$HTTPS_PROXY`, `$NO_PROXY`](#http_proxy-https_proxy-no_proxy)
36-
- [Enterprise](#enterprise)
5+
- [FAQ](#faq)
6+
- [Questions?](#questions)
7+
- [iPad Status?](#ipad-status)
8+
- [Community Projects (awesome-code-server)](#community-projects-awesome-code-server)
9+
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
10+
- [Differences compared to VS Code?](#differences-compared-to-vs-code)
11+
- [Installing an extension](#installing-an-extension)
12+
- [How can I request a missing extension?](#how-can-i-request-a-missing-extension)
13+
- [Installing an extension manually](#installing-an-extension-manually)
14+
- [How do I configure the marketplace URL?](#how-do-i-configure-the-marketplace-url)
15+
- [Where are extensions stored?](#where-are-extensions-stored)
16+
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
17+
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
18+
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
19+
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
20+
- [Sub-paths](#sub-paths)
21+
- [Sub-domains](#sub-domains)
22+
- [Why does the code-server proxy strip `/proxy/<port>` from the request path?](#why-does-the-code-server-proxy-strip-proxyport-from-the-request-path)
23+
- [Proxying to Create React App](#proxying-to-create-react-app)
24+
- [Multi-tenancy](#multi-tenancy)
25+
- [Docker in code-server container?](#docker-in-code-server-container)
26+
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
27+
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
28+
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
29+
- [Heartbeat File](#heartbeat-file)
30+
- [Healthz endpoint](#healthz-endpoint)
31+
- [How does the config file work?](#how-does-the-config-file-work)
32+
- [Isn't an install script piped into sh insecure?](#isnt-an-install-script-piped-into-sh-insecure)
33+
- [How do I make my keyboard shortcuts work?](#how-do-i-make-my-keyboard-shortcuts-work)
34+
- [How do I access my Documents/Downloads/Desktop folders in code-server on OSX?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-osx)
35+
- [Differences compared to Theia?](#differences-compared-to-theia)
36+
- [`$HTTP_PROXY`, `$HTTPS_PROXY`, `$NO_PROXY`](#http_proxy-https_proxy-no_proxy)
37+
- [Enterprise](#enterprise)
3738

3839
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3940

@@ -205,17 +206,19 @@ Again, please follow [./guide.md](./guide.md) for our recommendations on setting
205206

206207
Yes you can! Set the value of `hashed-password` instead of `password`. Generate the hash with:
207208

208-
```
209-
printf "thisismypassword" | sha256sum | cut -d' ' -f1
209+
```shell
210+
echo -n "password" | npx argon2-cli -e
211+
$argon2i$v=19$m=4096,t=3,p=1$wst5qhbgk2lu1ih4dmuxvg$ls1alrvdiwtvzhwnzcm1dugg+5dto3dt1d5v9xtlws4
212+
210213
```
211214

212-
Of course replace `thisismypassword` with your actual password.
215+
Of course replace `thisismypassword` with your actual password and **remember to put it inside quotes**!
213216

214217
Example:
215218

216219
```yaml
217220
auth: password
218-
hashed-password: 1da9133ab9dbd11d2937ec8d312e1e2569857059e73cc72df92e670928983ab5 # You got this from the command above
221+
hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4"
219222
```
220223
221224
## How do I securely access web services?

src/node/http.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import { field, logger } from "@coder/logger"
22
import * as express from "express"
33
import * as expressCore from "express-serve-static-core"
44
import qs from "qs"
5-
import safeCompare from "safe-compare"
65
import { HttpCode, HttpError } from "../common/http"
76
import { normalize, Options } from "../common/util"
87
import { AuthType, DefaultedArgs } from "./cli"
98
import { commit, rootPath } from "./constants"
109
import { Heart } from "./heart"
11-
import { getPasswordMethod, handlePasswordValidation, IsCookieValidArgs, isCookieValid, isHashMatch } from "./util"
10+
import { getPasswordMethod, IsCookieValidArgs, isCookieValid } from "./util"
1211

1312
declare global {
1413
// eslint-disable-next-line @typescript-eslint/no-namespace

test/unit/cli.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ describe("parser", () => {
305305
})
306306
})
307307

308-
it.only("should use env var hashed password", async () => {
308+
it("should use env var hashed password", async () => {
309309
process.env.HASHED_PASSWORD =
310310
"$argon2i$v=19$m=4096,t=3,p=1$0qR/o+0t00hsbJFQCKSfdQ$oFcM4rL6o+B7oxpuA4qlXubypbBPsf+8L531U7P9HYY" // test
311311
const args = parse([])

0 commit comments

Comments
 (0)