docker-code-server/root/etc/s6-overlay/s6-rc.d/svc-code-server/run

27 lines
757 B
Plaintext
Raw Normal View History

2019-06-24 18:03:06 +00:00
#!/usr/bin/with-contenv bash
2021-02-04 14:27:39 +00:00
if [ -n "${PASSWORD}" ] || [ -n "${HASHED_PASSWORD}" ]; then
2021-05-08 14:50:21 +00:00
AUTH="password"
2019-06-24 19:27:16 +00:00
else
2021-05-08 14:50:21 +00:00
AUTH="none"
echo "starting with no password"
2019-06-24 19:27:16 +00:00
fi
2020-05-20 03:06:47 +00:00
if [ -z ${PROXY_DOMAIN+x} ]; then
2021-05-08 14:50:21 +00:00
PROXY_DOMAIN_ARG=""
2021-02-04 14:27:39 +00:00
else
2021-05-08 14:50:21 +00:00
PROXY_DOMAIN_ARG="--proxy-domain=${PROXY_DOMAIN}"
2020-05-20 03:06:47 +00:00
fi
2019-06-24 19:27:16 +00:00
2019-06-24 18:03:06 +00:00
exec \
2022-09-29 15:47:53 +00:00
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 8443" \
2022-09-29 15:37:34 +00:00
s6-setuidgid abc \
/app/code-server/bin/code-server \
--bind-addr 0.0.0.0:8443 \
--user-data-dir /config/data \
--extensions-dir /config/extensions \
--disable-telemetry \
--auth "${AUTH}" \
"${PROXY_DOMAIN_ARG}" \
"${DEFAULT_WORKSPACE:-/config/workspace}"