Skip to content

Commit 2190731

Browse files
committed
make password auth optional
1 parent afd06e9 commit 2190731

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ docker create \
5959
-e PUID=1000 \
6060
-e PGID=1000 \
6161
-e TZ=Europe/London \
62-
-e PASSWORD=password \
62+
-e PASSWORD=password `#optional` \
6363
-p 8443:8443 \
6464
-v /path/to/appdata/config:/config \
6565
--restart unless-stopped \
@@ -82,7 +82,7 @@ services:
8282
- PUID=1000
8383
- PGID=1000
8484
- TZ=Europe/London
85-
- PASSWORD=password
85+
- PASSWORD=password #optional
8686
volumes:
8787
- /path/to/appdata/config:/config
8888
ports:
@@ -100,7 +100,7 @@ Container images are configured using parameters passed at runtime (such as thos
100100
| `-e PUID=1000` | for UserID - see below for explanation |
101101
| `-e PGID=1000` | for GroupID - see below for explanation |
102102
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
103-
| `-e PASSWORD=password` | Specify a web gui password |
103+
| `-e PASSWORD=password` | Optional web gui password, if not provided, there will be no auth |
104104
| `-v /config` | Contains all relevant configuration files. |
105105

106106
## User / Group Identifiers

readme-vars.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ param_ports:
4343
param_usage_include_env: true
4444
param_env_vars:
4545
- { env_var: "TZ", env_value: "Europe/London", desc: "Specify a timezone to use EG Europe/London"}
46-
- { env_var: "PASSWORD", env_value: "password", desc: "Specify a web gui password"}
4746

4847
# optional container parameters
49-
opt_param_usage_include_env: false
48+
opt_param_usage_include_env: true
5049
opt_param_env_vars:
51-
- { env_var: "", env_value: "", desc: "" }
50+
- { env_var: "PASSWORD", env_value: "password", desc: "Optional web gui password, if not provided, there will be no auth"}
5251

5352
optional_block_1: false
5453
optional_block_1_items: ""

root/etc/services.d/code-server/run

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,19 @@
22

33
cd /opt/code-server || exit
44

5+
if [ -n "${PASSWORD}" ]; then
6+
PASSARG="-P ${PASSWORD}"
7+
else
8+
PASSARG="-N"
9+
echo "starting with no password"
10+
fi
11+
512
exec \
6-
s6-setuidgid abc /opt/code-server/code-server -H -P ${PASSWORD} -d /config/data -e /config/extensions --disable-telemetry /config/workspace
13+
s6-setuidgid abc \
14+
/opt/code-server/code-server \
15+
-H \
16+
${PASSARG} \
17+
-d /config/data \
18+
-e /config/extensions \
19+
--disable-telemetry \
20+
/config/workspace

0 commit comments

Comments
 (0)