29 lines
705 B
Bash
29 lines
705 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
VNC_PASSWORD="${VNC_PASSWORD:-changeme}"
|
|
DISPLAY_WIDTH="${DISPLAY_WIDTH:-1920}"
|
|
DISPLAY_HEIGHT="${DISPLAY_HEIGHT:-1080}"
|
|
|
|
# Set VNC password
|
|
mkdir -p /home/designer/.vnc
|
|
echo "$VNC_PASSWORD" | vncpasswd -f > /home/designer/.vnc/passwd
|
|
chmod 600 /home/designer/.vnc/passwd
|
|
chown -R designer:designer /home/designer/.vnc
|
|
|
|
# Start VNC server
|
|
su - designer -c "vncserver :1 \
|
|
-geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} \
|
|
-depth 24 \
|
|
-SecurityTypes VncAuth \
|
|
-localhost no \
|
|
-xstartup /usr/bin/openbox-session" &
|
|
|
|
sleep 2
|
|
|
|
# Start noVNC (websockify bridge)
|
|
/usr/share/novnc/utils/novnc_proxy \
|
|
--vnc localhost:5901 \
|
|
--listen 6080 \
|
|
--web /usr/share/novnc
|