Use Workspace var

This commit is contained in:
Roxedus 2023-05-18 23:26:21 +02:00
parent 59b4f07cae
commit c899ac69a4
No known key found for this signature in database
GPG Key ID: EBC13557C4D91D7B
3 changed files with 21 additions and 18 deletions

View File

@ -1,8 +1,11 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
mkdir -p /config/{.vscode-headless,.config,.ssh}
mkdir -p /run/dbus
mkdir -p /config/{.vscode-headless,.config,.ssh,workspace}
if [ ! -d "${DEFAULT_WORKSPACE}" ];then
echo -n "/config/workspace" >/run/s6/container_environment/DEFAULT_WORKSPACE
fi
if [ -n "${SUDO_PASSWORD}" ] || [ -n "${SUDO_PASSWORD_HASH}" ]; then
echo "setting up sudo access"

View File

@ -1,9 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
until [[ -e /run/dbus/system_bus_socket ]]; do
sleep 1s
done
env | sort > /svc-env
if [ -n "$CONNECTION_SECRET" ]; then
CODE_LOCAL_ARGS="${CODE_LOCAL_ARGS} --connection-token-file ${CONNECTION_SECRET}"
@ -17,6 +15,7 @@ fi
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 8000" \
cd "$DEFAULT_WORKSPACE" \
s6-setuidgid abc \
/usr/local/bin/code-server serve-local \
--accept-server-license-terms\

View File

@ -6,9 +6,10 @@ until [[ -e /run/dbus/system_bus_socket ]]; do
done
exec \
cd "$DEFAULT_WORKSPACE" \
s6-setuidgid abc \
/usr/local/bin/code-server serve \
--accept-server-license-terms \
--random-name \
--disable-telemetry \
${CODE_ARGS}
${CODE_ARGS} || exit 1