Skip to content

Commit 5a1700c

Browse files
feat: add 'absProxyBasePath' option
1 parent e928205 commit 5a1700c

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

src/code-server/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ VS Code in the browser
1515

1616
| Options Id | Description | Type | Default Value |
1717
|-----|-----|-----|-----|
18+
| absProxyBasePath | The base path to prefix to all absproxy requests | string | - |
1819
| appName | The name to use in branding. Will be shown in titlebar and welcome message. | string | - |
1920
| auth | The type of authentication to use. When 'password' is selected, code-server will auto-generate a password. 'none' disables authentication entirely. | string | password |
2021
| cert | Path to certificate. A self signed certificate is generated if none is provided. | string | - |

src/code-server/devcontainer-feature.json

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"version": "1.0.0",
55
"description": "VS Code in the browser",
66
"options": {
7+
"absProxyBasePath": {
8+
"type": "string",
9+
"default": "",
10+
"description": "The base path to prefix to all absproxy requests"
11+
},
712
"appName": {
813
"type": "string",
914
"default": "",

src/code-server/install.sh

+4
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ if [[ "$PROXYDOMAIN" ]]; then
106106
FLAGS+=(--proxy-domain "$PROXYDOMAIN")
107107
fi
108108

109+
if [[ "$ABSPROXYBASEPATH" ]]; then
110+
FLAGS+=(--abs-proxy-base-path "$ABSPROXYBASEPATH")
111+
fi
112+
109113
cat > /usr/local/bin/code-server-entrypoint <<EOF
110114
#!/usr/bin/env bash
111115
set -e
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Optional: Import test library bundled with the devcontainer CLI
5+
source dev-container-features-test-lib
6+
7+
# Feature-specific tests
8+
check "code-server version" code-server --version
9+
check "code-server running" pgrep -f 'code-server/lib/node.*/code-server'
10+
check "code-server listening" lsof -i "@127.0.0.1:8080"
11+
12+
check "code-server locale" grep '"--abs-proxy-base-path".*"/user/123/workspace"' < /usr/local/bin/code-server-entrypoint
13+
14+
# Report results
15+
reportResults

test/code-server/scenarios.json

+8
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,13 @@
257257
"githubAuthTokenFile": "/tmp/code-server-github-auth-token"
258258
}
259259
}
260+
},
261+
"code-server-abs-proxy-base-path": {
262+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
263+
"features": {
264+
"code-server": {
265+
"absProxyBasePath": "/user/123/workspace"
266+
}
267+
}
260268
}
261269
}

0 commit comments

Comments
 (0)