Files
runtipi/apps/rego-tunnel-linux/source/rego-vpn-gui.sh
alexz a17fe5843d
Some checks failed
Test / test (push) Has been cancelled
Rebuild rego-tunnel-linux with systemd as init
2025-12-25 01:08:20 +00:00

32 lines
779 B
Bash

#!/bin/bash
# Main GUI service for Rego VPN
NOVNC_PORT="${NOVNC_PORT:-8806}"
DISPLAY_ADDR="${DISPLAY:-:1}"
# Start Xvfb
Xvfb "$DISPLAY_ADDR" -screen 0 ${XVFB_WxHxD:-1280x800x24} +extension RANDR &
XVFB_PID=$!
sleep 1
export DISPLAY="$DISPLAY_ADDR"
# Start window manager
fluxbox >/tmp/fluxbox.log 2>&1 &
# Start VNC server
x11vnc -display "$DISPLAY_ADDR" -rfbauth /root/.vnc/pass -forever -shared -rfbport 5900 -quiet &
# Start websockify for noVNC
websockify --web=/usr/share/novnc/ 0.0.0.0:"$NOVNC_PORT" localhost:5900 >/tmp/websockify.log 2>&1 &
# Start terminal
sleep 1
xterm -fa 'Monospace' -fs 11 -bg black -fg white -geometry 120x35+50+50 \
-T "Rego VPN" -e bash &
echo "Rego VPN GUI started on port $NOVNC_PORT"
# Wait for Xvfb (main process)
wait $XVFB_PID