Skip to content

feat: add passwordFile, hashedPasswordFile, githubAuthTokenFile and absProxyBasePath options #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add 'absProxyBasePath' option
  • Loading branch information
DanielleMaywood committed Apr 24, 2025
commit 5a1700c5c9f07aa02cfb0d63f692c5c55e01e241
1 change: 1 addition & 0 deletions src/code-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ VS Code in the browser

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| absProxyBasePath | The base path to prefix to all absproxy requests | string | - |
| appName | The name to use in branding. Will be shown in titlebar and welcome message. | string | - |
| auth | The type of authentication to use. When 'password' is selected, code-server will auto-generate a password. 'none' disables authentication entirely. | string | password |
| cert | Path to certificate. A self signed certificate is generated if none is provided. | string | - |
Expand Down
5 changes: 5 additions & 0 deletions src/code-server/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"version": "1.0.0",
"description": "VS Code in the browser",
"options": {
"absProxyBasePath": {
"type": "string",
"default": "",
"description": "The base path to prefix to all absproxy requests"
},
"appName": {
"type": "string",
"default": "",
Expand Down
4 changes: 4 additions & 0 deletions src/code-server/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ if [[ "$PROXYDOMAIN" ]]; then
FLAGS+=(--proxy-domain "$PROXYDOMAIN")
fi

if [[ "$ABSPROXYBASEPATH" ]]; then
FLAGS+=(--abs-proxy-base-path "$ABSPROXYBASEPATH")
fi

cat > /usr/local/bin/code-server-entrypoint <<EOF
#!/usr/bin/env bash
set -e
Expand Down
15 changes: 15 additions & 0 deletions test/code-server/code-server-abs-proxy-base-path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

# Optional: Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Feature-specific tests
check "code-server version" code-server --version
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server'
check "code-server listening" lsof -i "@127.0.0.1:8080"

check "code-server locale" grep '"--abs-proxy-base-path".*"/user/123/workspace"' < /usr/local/bin/code-server-entrypoint

# Report results
reportResults
8 changes: 8 additions & 0 deletions test/code-server/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,13 @@
"githubAuthTokenFile": "/tmp/code-server-github-auth-token"
}
}
},
"code-server-abs-proxy-base-path": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"code-server": {
"absProxyBasePath": "/user/123/workspace"
}
}
}
}