Files
runtipi/apps/rego-tunnel/shared/xstartup
alexz c933d6e6da
Some checks failed
Test / test (push) Has been cancelled
Fix: Import Docker env vars into VNC session
Systemd services don't inherit container environment variables.
Added sourcing from /proc/1/environ in xstartup to fix this.
2026-01-17 02:19:13 +00:00

35 lines
930 B
Bash

#!/bin/bash
# VNC xstartup - launches terminal with cisco-vpn script
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# Import environment variables from container (PID 1)
# Systemd services don't inherit Docker env vars, so we source them here
while IFS= read -r -d '' line; do
export "$line"
done < /proc/1/environ
export XDG_RUNTIME_DIR=/tmp/runtime-root
mkdir -p $XDG_RUNTIME_DIR
chmod 700 $XDG_RUNTIME_DIR
# GPU/WebKit workarounds for Cisco UI
export GDK_BACKEND=x11
export WEBKIT_DISABLE_DMABUF_RENDERER=1
# Start dbus session
[ -x /usr/bin/dbus-launch ] && eval $(dbus-launch --sh-syntax --exit-with-session)
# Start window manager
openbox &
sleep 2
# Make script executable and launch in terminal
chmod +x /shared/cisco-vpn 2>/dev/null || true
xterm -fa 'Monospace' -fs 11 -bg black -fg white -geometry 130x45+10+10 \
-title "Rego VPN Terminal" \
-e "bash -c '/shared/cisco-vpn; exec bash'" &
wait