File tree Expand file tree Collapse file tree 9 files changed +117
-1
lines changed Expand file tree Collapse file tree 9 files changed +117
-1
lines changed Original file line number Diff line number Diff line change 7
7
workflow_dispatch :
8
8
9
9
jobs :
10
+ test-docs :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v4
14
+
15
+ - name : " Generate documentation"
16
+ run : make -B docs
17
+
18
+ - name : " Check for unstaged"
19
+ run : ./scripts/check_unstaged.sh
20
+
10
21
test-autogenerated :
11
22
runs-on : ubuntu-latest
12
23
continue-on-error : true
Original file line number Diff line number Diff line change 1
1
.PHONY : test
2
2
test :
3
3
devcontainer features test
4
+
5
+ .PHONY : docs
6
+ docs : src/code-server/README.md
7
+ cd src && devcontainer features generate-docs -n coder/devcontainer-features
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ FILES=" $( git ls-files --other --modified --exclude-standard) "
6
+ if [[ " $FILES " != " " ]]; then
7
+ mapfile -t files <<< " $FILES"
8
+
9
+ echo
10
+ echo " The following files contain unstaged changes:"
11
+ echo
12
+ for file in " ${files[@]} " ; do
13
+ echo " - $file "
14
+ done
15
+
16
+ echo
17
+ echo " These are the changes:"
18
+ echo
19
+ for file in " ${files[@]} " ; do
20
+ git --no-pager diff " $file " 1>&2
21
+ done
22
+
23
+ echo
24
+ echo " ERROR: Unstaged changes, see above for details."
25
+ exit 1
26
+ fi
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ VS Code in the browser
30
30
| host | The address to bind to for the code-server. Use '0.0.0.0' to listen on all interfaces. | string | 127.0.0.1 |
31
31
| port | The port to bind to for the code-server. | string | 8080 |
32
32
| version | The version of code-server to install. If empty, installs the latest version. | string | - |
33
+ | socket | Path to a socket. When specified, host and port will be ignored. | string | - |
34
+ | socketMode | File mode of the socket when using the socket option. | string | - |
33
35
| workspace | Path to the workspace or folder to open on startup. Can be a directory or a .code-workspace file. | string | - |
34
36
35
37
Original file line number Diff line number Diff line change 80
80
"default" : " " ,
81
81
"description" : " The version of code-server to install. If empty, installs the latest version."
82
82
},
83
+ "socket" : {
84
+ "type" : " string" ,
85
+ "default" : " " ,
86
+ "description" : " Path to a socket. When specified, host and port will be ignored."
87
+ },
88
+ "socketMode" : {
89
+ "type" : " string" ,
90
+ "default" : " " ,
91
+ "description" : " File mode of the socket when using the socket option."
92
+ },
83
93
"workspace" : {
84
94
"type" : " string" ,
85
95
"default" : " " ,
Original file line number Diff line number Diff line change @@ -67,15 +67,26 @@ if [[ -n "$CERTKEY" ]]; then
67
67
CERT_FLAGS+=(--cert-key " $CERTKEY " )
68
68
fi
69
69
70
+ SOCKET_FLAGS=()
71
+
72
+ if [[ -n " $SOCKET " ]]; then
73
+ SOCKET_FLAGS+=(--socket " $SOCKET " )
74
+ fi
75
+
76
+ if [[ -n " $SOCKETMODE " ]]; then
77
+ SOCKET_FLAGS+=(--socket-mode " $SOCKETMODE " )
78
+ fi
79
+
70
80
cat > /usr/local/bin/code-server-entrypoint \
71
81
<< EOF
72
82
#!/usr/bin/env bash
73
83
set -e
74
84
75
85
$( declare -p DISABLE_FLAGS)
76
86
$( declare -p CERT_FLAGS)
87
+ $( declare -p SOCKET_FLAGS)
77
88
78
- su $_REMOTE_USER -c 'code-server --auth "$AUTH " --bind-addr "$HOST :$PORT " "\$ {DISABLE_FLAGS[@]}" "\$ {CERT_FLAGS[@]}" "$CODE_SERVER_WORKSPACE "'
89
+ su $_REMOTE_USER -c 'code-server --auth "$AUTH " --bind-addr "$HOST :$PORT " "\$ {DISABLE_FLAGS[@]}" "\$ {CERT_FLAGS[@]}" "\$ {SOCKET_FLAGS[@]}" " $CODE_SERVER_WORKSPACE "'
79
90
EOF
80
91
81
92
chmod +x /usr/local/bin/code-server-entrypoint
Original file line number Diff line number Diff line change
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
+ cat /usr/local/bin/code-server-entrypoint
8
+
9
+ # Feature-specific tests
10
+ check " code-server version" code-server --version
11
+ check " code-server running" pgrep -f ' code-server/lib/node.*/code-server'
12
+ check " code-server listening" lsof -i " @127.0.0.1:8080"
13
+
14
+ check " code-server socket" grep ' "--socket".*"/tmp/code-server.sock"' < /usr/local/bin/code-server-entrypoint
15
+ check " code-server socket-mode" grep ' "--socket-mode".*"777"' < /usr/local/bin/code-server-entrypoint
16
+
17
+ # Report results
18
+ reportResults
Original file line number Diff line number Diff line change
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
+ cat /usr/local/bin/code-server-entrypoint
8
+
9
+ # Feature-specific tests
10
+ check " code-server version" code-server --version
11
+ check " code-server running" pgrep -f ' code-server/lib/node.*/code-server'
12
+ check " code-server listening" lsof -i " @127.0.0.1:8080"
13
+
14
+ check " code-server socket" grep ' "--socket".*"/tmp/code-server.sock"' < /usr/local/bin/code-server-entrypoint
15
+
16
+ # Report results
17
+ reportResults
Original file line number Diff line number Diff line change 141
141
"certHost" : " coder.com"
142
142
}
143
143
}
144
+ },
145
+ "code-server-socket" : {
146
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
147
+ "features" : {
148
+ "code-server" : {
149
+ "socket" : " /tmp/code-server.sock"
150
+ }
151
+ }
152
+ },
153
+ "code-server-socket-with-mode" : {
154
+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
155
+ "features" : {
156
+ "code-server" : {
157
+ "socket" : " /tmp/code-server.sock" ,
158
+ "socketMode" : " 777"
159
+ }
160
+ }
144
161
}
145
162
}
You can’t perform that action at this time.
0 commit comments