update kasm init to support egress - arch

This commit is contained in:
thelamer 2024-09-09 12:38:44 -04:00
parent 60e32bd3dc
commit b42e2ceb52
4 changed files with 41 additions and 0 deletions

View File

@ -349,6 +349,9 @@ RUN \
chown -R 1000:1000 /kasmbins && \
chown 1000:1000 /usr/share/kasmvnc/www/Downloads && \
mkdir -p /dockerstartup && \
mv \
/usr/sbin/notify-send \
/usr/sbin/notify-send-real && \
echo "**** dind support ****" && \
groupadd -r dockremap && \
useradd -r -g dockremap dockremap && \

View File

@ -351,6 +351,9 @@ RUN \
chown -R 1000:1000 /kasmbins && \
chown 1000:1000 /usr/share/kasmvnc/www/Downloads && \
mkdir -p /dockerstartup && \
mv \
/usr/sbin/notify-send \
/usr/sbin/notify-send-real && \
echo "**** dind support ****" && \
groupadd -r dockremap && \
useradd -r -g dockremap dockremap && \

View File

@ -78,6 +78,38 @@ elif ! diff -q /proot-apps/pversion ${HOME}/.local/bin/pversion > /dev/null; the
cp /proot-apps/* ${HOME}/.local/bin/
fi
## Network egress wait ##
while :; do
interfaces=$(ip link show type veth | awk -F: '/^[0-9]+: / {print $2}' | awk '{print $1}' | sed 's/@.*//')
if [ -z "$interfaces" ]; then
sleep 1
continue
fi
for interface in $interfaces; do
if [[ $interface == eth* ]]; then
break 2
fi
if [[ $interface == k-p-* ]]; then
egress_file="/dockerstartup/.egress_status"
while [ ! -f "$egress_file" ]; do
sleep 1
done
egress_status=$(cat $egress_file)
if [ "$egress_status" == "ready" ]; then
if [ -z "$KASM_PROFILE_LDR" ]; then
http_proxy="" https_proxy="" curl -k "https://${KASM_API_HOST}:${KASM_API_PORT}/api/set_kasm_session_status?token=${KASM_API_JWT}" -H 'Content-Type: application/json' -d '{"status": "running"}'
fi
break 2
fi
if [ "$egress_status" == "error" ]; then
echo "Failed to establish egress gateway. Exiting..."
exit 1
fi
fi
done
sleep 1
done
## KasmVNC init ##
# Password
if [[ -f $HOME/.kasmpasswd ]]; then

3
root/usr/bin/notify-send Executable file
View File

@ -0,0 +1,3 @@
#! /bin/bash
dbus-launch /usr/sbin/notify-send-real "$@"