Skip to content

Commit 397972c

Browse files
committed
feat: add code-server app customization
1 parent fb15bd3 commit 397972c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/code-server/devcontainer-feature.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,22 @@
156156
"description": "Path to the workspace or folder to open on startup. Can be a directory or a .code-workspace file."
157157
}
158158
},
159+
"customizations": {
160+
"coder": {
161+
"apps": [
162+
{
163+
"slug": "code-server",
164+
"displayName": "code-server",
165+
"url": "http://${containerEnv:CODE_SERVER_HOST}:${containerEnv:CODE_SERVER_PORT}/${containerEnv:CODE_SERVER_WORKSPACE}",
166+
"openIn": "tab",
167+
"share": "owner",
168+
"icon": "/icons/web.svg",
169+
"order": 1,
170+
"group": "Web Editors"
171+
}
172+
]
173+
}
174+
},
159175
"entrypoint": "/usr/local/bin/code-server-entrypoint",
160176
"dependsOn": {
161177
"ghcr.io/devcontainers/features/common-utils:2": {}

src/code-server/install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ if [[ -n $WORKSPACE ]]; then
2222
CODE_SERVER_WORKSPACE="$WORKSPACE"
2323
fi
2424

25+
# Serialize these options in the container environment for reference in JSON.
26+
cat <<<EOF > /etc/environment
27+
CODE_SERVER_HOST=$HOST
28+
CODE_SERVER_PORT=$PORT
29+
CODE_SERVER_WORKSPACE=$CODE_SERVER_WORKSPACE
30+
EOF
31+
2532
FLAGS=()
2633
FLAGS+=(--auth "$AUTH")
2734
FLAGS+=(--bind-addr "$HOST:$PORT")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy