From 4b404714f9079901e23cd447e347ea9fb0f898bc Mon Sep 17 00:00:00 2001 From: alexz Date: Fri, 19 Dec 2025 12:44:30 +0000 Subject: [PATCH] Add VNC password support via QEMU monitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sets VNC password via monitor port 7100 when VNC_PASSWORD env var is set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/rego-tunnel/vpn_scripts/start.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/rego-tunnel/vpn_scripts/start.sh b/apps/rego-tunnel/vpn_scripts/start.sh index 0e1470d..b7fa9e3 100755 --- a/apps/rego-tunnel/vpn_scripts/start.sh +++ b/apps/rego-tunnel/vpn_scripts/start.sh @@ -97,6 +97,21 @@ get_container_ip() { echo "[rego-tunnel] iptables DNAT rules configured" echo "[rego-tunnel] Port forwarding ready via $CONTAINER_IP" + + # Set VNC password if VNC_PASSWORD env var is set + if [[ -n "${VNC_PASSWORD:-}" ]]; then + echo "[rego-tunnel] Setting VNC password..." + for i in {1..30}; do + if nc -z localhost 7100 2>/dev/null; then + sleep 2 + echo "set_password vnc ${VNC_PASSWORD}" | nc -q1 localhost 7100 >/dev/null 2>&1 && \ + echo "[rego-tunnel] VNC password set successfully" || \ + echo "[rego-tunnel] Failed to set VNC password" + break + fi + sleep 2 + done + fi ) & return 0