Compare commits

...

3 Commits

Author SHA1 Message Date
cb72e7c94c
Fix key-chain 2023-05-18 23:27:22 +02:00
c899ac69a4
Use Workspace var 2023-05-18 23:26:21 +02:00
59b4f07cae
Build insiders 2023-05-18 23:19:29 +02:00
13 changed files with 49 additions and 44 deletions

View File

@ -19,19 +19,19 @@ RUN \
echo "**** install runtime dependencies ****" && \
apt-get update && \
apt-get install -y \
dbus-x11 \
git \
nano \
net-tools \
netcat \
sudo && \
apt-get install -y --no-install-recommends \
dbus-x11 \
gnome-keyring \
libatomic1 \
libsecret-1-dev && \
echo "**** install vscode-server ****" && \
if [ -z ${CODE_RELEASE+x} ]; then \
CODE_RELEASE=$(curl -sLX GET "https://update.code.visualstudio.com/api/latest/server-linux-x64-web/stable" \
CODE_RELEASE=$(curl -sLX GET "https://update.code.visualstudio.com/api/latest/server-linux-x64-web/insider" \
| jq '.version' -r); \
fi && \
if [ -z ${CLI_RELEASE+x} ]; then \
@ -39,24 +39,24 @@ RUN \
| jq '.version' -r); \
fi && \
mkdir -p /usr/local/bin && \
mkdir -p /app/vscode-server/server-stable-web/bin/${CODE_RELEASE} && \
mkdir -p /app/vscode-server/server-stable/bin/${CODE_RELEASE} && \
mkdir -p /app/vscode-server/server-insiders-web/bin/${CODE_RELEASE} && \
mkdir -p /app/vscode-server/server-insiders/bin/${CODE_RELEASE} && \
curl -o \
/usr/local/bin/code-server -L \
"https://vscodeserverlauncher.blob.core.windows.net/builds/${CLI_RELEASE}/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu" && \
chmod +x /usr/local/bin/code-server && \
curl -o \
/tmp/vscode-server-web.tar.gz -L \
"https://az764295.vo.msecnd.net/stable/${CODE_RELEASE}/vscode-server-linux-x64-web.tar.gz" && \
"https://az764295.vo.msecnd.net/insider/${CODE_RELEASE}/vscode-server-linux-x64-web.tar.gz" && \
tar xf \
/tmp/vscode-server-web.tar.gz -C \
/app/vscode-server/server-stable-web/bin/${CODE_RELEASE}/ --strip-components=1 && \
/app/vscode-server/server-insiders-web/bin/${CODE_RELEASE}/ --strip-components=1 && \
curl -o \
/tmp/vscode-server.tar.gz -L \
"https://az764295.vo.msecnd.net/stable/${CODE_RELEASE}/vscode-server-linux-x64.tar.gz" && \
"https://az764295.vo.msecnd.net/insider/${CODE_RELEASE}/vscode-server-linux-x64.tar.gz" && \
tar xf \
/tmp/vscode-server.tar.gz -C \
/app/vscode-server/server-stable/bin/${CODE_RELEASE}/ --strip-components=1 && \
/app/vscode-server/server-insiders/bin/${CODE_RELEASE}/ --strip-components=1 && \
echo "**** clean up ****" && \
apt-get clean && \
rm -rf \

View File

@ -0,0 +1,16 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
mkdir -p /config/.local/share/keyrings
if [ -f /etc/machine-id ]; then
dbus-uuidgen --ensure
sleep 1
fi
echo "keyring"
eval $(s6-setuidgid abc dbus-launch --sh-syntax)
echo 'somecredstorepass' | eval $(s6-setuidgid abc gnome-keyring-daemon --daemonize --components=pkcs11,secrets,ssh --unlock)
echo -n "${DBUS_SESSION_BUS_ADDRESS}" >/run/s6/container_environment/DBUS_SESSION_BUS_ADDRESS
#echo -n "${GNOME_KEYRING_CONTROL}" >/run/s6/container_environment/GNOME_KEYRING_CONTROL
#echo -n "${SSH_AUTH_SOCK}" >/run/s6/container_environment/SSH_AUTH_SOCK

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-keyring/run

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"
@ -27,17 +30,6 @@ for f in code_tunnel.json last-used-servers.json license_consent.json token.json
fi
done
if [ -f /etc/machine-id ]; then
dbus-uuidgen --ensure
sleep 1
fi
if [ -z "${DBUS_SESSION_BUS_PID}" ]; then
eval $(s6-setuidgid abc dbus-launch)
echo -n "${DBUS_SESSION_BUS_ADDRESS}" >/run/s6/container_environment/DBUS_SESSION_BUS_ADDRESS
echo -n "${DBUS_SESSION_BUS_PID}" >/run/s6/container_environment/DBUS_SESSION_BUS_PID
fi
[[ ! -f /config/.bashrc ]] && \
cp /root/.bashrc /config/.bashrc
@ -45,7 +37,7 @@ fi
cp /root/.profile /config/.profile
echo "setting permissions::app"
lsiown -R abc:abc /app/vscode-server
lsiown abc:abc /app/vscode-server/{{server-insiders-web,server-insiders},{server-insiders-web,server-insiders}/bin}
echo "setting permissions::config"
find /config -path /config/.vscode-server -prune -o -exec chown abc:abc {} +

View File

@ -1,5 +0,0 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
exec \
dbus-daemon --system --nofork

View File

@ -1 +0,0 @@
longrun

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,9 +15,11 @@ fi
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z 127.0.0.1 8000" \
s6-setuidgid abc \
/usr/local/bin/code-server serve-local \
--accept-server-license-terms \
--host 0.0.0.0 \
--disable-telemetry \
${CODE_LOCAL_ARGS}
cd "$DEFAULT_WORKSPACE" \
s6-setuidgid abc \
/usr/local/bin/code-server serve-local \
--accept-server-license-terms\
--quality insiders \
--host 0.0.0.0 \
--disable-telemetry \
${CODE_LOCAL_ARGS}

View File

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

View File

@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
_install=(/usr/local/bin/code-server "serve-local" "--accept-server-license-terms" "--install-extension")
_install=(/usr/local/bin/code-server "serve-local" "--accept-server-license-terms" "--quality" "insiders" "--install-extension")
if [ "$(whoami)" == "abc" ]; then
"${_install[@]}" "$@"