lljz66 commited on
Commit
96038fe
·
verified ·
1 Parent(s): 61b0af6

app: bind vnc+websockify to loopback

Browse files
Files changed (1) hide show
  1. start.sh +28 -0
start.sh ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ echo "[desigma] virtual display :99 (1600x1000x24)"
5
+ Xvfb :99 -screen 0 1600x1000x24 -nolisten tcp -ac &
6
+ for _ in $(seq 1 100); do
7
+ xdpyinfo -display :99 >/dev/null 2>&1 && break
8
+ sleep 0.2
9
+ done
10
+
11
+ echo "[desigma] window manager"
12
+ openbox --sm-disable >/dev/null 2>&1 &
13
+
14
+ echo "[desigma] editor"
15
+ desigma --fixture showcase 2>&1 | sed -u 's/^/[app] /' &
16
+
17
+ # VNC and its websocket bridge bind to loopback only. The sole public listener
18
+ # is nginx on :7860, which proxies the WebSocket upgrade.
19
+ echo "[desigma] vnc server (loopback only)"
20
+ x11vnc -display :99 -localhost -forever -shared -nopw -rfbport 5900 -noxdamage -quiet \
21
+ >/tmp/x11vnc.log 2>&1 &
22
+
23
+ echo "[desigma] websocket bridge 127.0.0.1:5901 -> 127.0.0.1:5900"
24
+ websockify --web /usr/share/novnc 127.0.0.1:5901 127.0.0.1:5900 \
25
+ >/tmp/websockify.log 2>&1 &
26
+
27
+ echo "[desigma] http on :7860"
28
+ exec nginx -g 'daemon off;'