diff --git a/apps/rego-tunnel/build/Dockerfile b/apps/rego-tunnel/build/Dockerfile index 41c7bae..0c0c6b4 100755 --- a/apps/rego-tunnel/build/Dockerfile +++ b/apps/rego-tunnel/build/Dockerfile @@ -40,6 +40,9 @@ RUN apt-get update && apt-get install -y \ iproute2 \ iputils-ping \ nano \ + x11vnc \ + xvfb \ + fluxbox \ xdotool \ oathtool \ xclip \ diff --git a/apps/rego-tunnel/build/scripts/entrypoint.sh b/apps/rego-tunnel/build/scripts/entrypoint.sh index cb53e2b..ac2852a 100644 --- a/apps/rego-tunnel/build/scripts/entrypoint.sh +++ b/apps/rego-tunnel/build/scripts/entrypoint.sh @@ -4,8 +4,17 @@ # Setup VNC password from environment variable (passed by runtipi) if [ -n "$VNC_PASSWORD" ]; then mkdir -p /root/.vnc - echo "$VNC_PASSWORD" | vncpasswd -f > /root/.vnc/passwd - chmod 600 /root/.vnc/passwd + x11vnc -storepasswd "$VNC_PASSWORD" /root/.vnc/pass >/dev/null 2>&1 || true + rm -f /tmp/.X1-lock /tmp/.X11-unix/X1 2>/dev/null || true + Xvfb "$DISPLAY" -screen 0 ${XVFB_WxHxD:-1280x800x24} +extension RANDR & + pids+=($!) + sleep 0.5 + fluxbox >/tmp/fluxbox.log 2>&1 & + pids+=($!) + x11vnc -display "$DISPLAY" -rfbauth /root/.vnc/pass -forever -shared -rfbport "$VNC_PORT" -quiet & + pids+=($!) + websockify --web=/usr/share/novnc/ 0.0.0.0:"$NOVNC_PORT" localhost:5900 >/tmp/websockify.log 2>&1 & + pids+=($!) fi # Backup current DNS config