Unverified Commit 61f6efa1 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: Make VNC port configurable (#850)

parent 4eae42c8
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -8,14 +8,15 @@ set -Eeuo pipefail
: "${DISPLAY:="web"}"   # Display type
: "${RENDERNODE:="/dev/dri/renderD128"}"  # Render node

port=$(( VNC_PORT - 5900 ))
[[ "$DISPLAY" == ":0" ]] && DISPLAY="web"

case "${DISPLAY,,}" in
  "vnc" )
    DISPLAY_OPTS="-display vnc=:0 -vga $VGA"
    DISPLAY_OPTS="-display vnc=:$port -vga $VGA"
    ;;
  "web" )
    DISPLAY_OPTS="-display vnc=:0,websocket=$WSS_PORT -vga $VGA"
    DISPLAY_OPTS="-display vnc=:$port,websocket=$WSS_PORT -vga $VGA"
    ;;
  "disabled" )
    DISPLAY_OPTS="-display none -vga $VGA"
@@ -42,8 +43,8 @@ fi
DISPLAY_OPTS="-display egl-headless,rendernode=$RENDERNODE"
DISPLAY_OPTS+=" -device $VGA"

[[ "${DISPLAY,,}" == "vnc" ]] && DISPLAY_OPTS+=" -vnc :0"
[[ "${DISPLAY,,}" == "web" ]] && DISPLAY_OPTS+=" -vnc :0,websocket=$WSS_PORT"
[[ "${DISPLAY,,}" == "vnc" ]] && DISPLAY_OPTS+=" -vnc :$port"
[[ "${DISPLAY,,}" == "web" ]] && DISPLAY_OPTS+=" -vnc :$port,websocket=$WSS_PORT"

[ ! -d /dev/dri ] && mkdir -m 755 /dev/dri

@@ -65,5 +66,3 @@ fi

addPackage "xserver-xorg-video-intel" "Intel GPU drivers"
addPackage "qemu-system-modules-opengl" "OpenGL module"

return 0
+6 −0
Original line number Diff line number Diff line
@@ -161,11 +161,17 @@ addPackage() {
: "${WEB_PORT:="8006"}"    # Webserver port
: "${WSS_PORT:="5700"}"    # Websockets port

if (( VNC_PORT < 5900 )); then
  warn "VNC port cannot be set lower than 5900, ignoring value $VNC_PORT."
  VNC_PORT="5900"
fi

cp -r /var/www/* /run/shm
html "Starting $APP for Docker..."

if [[ "${WEB:-}" != [Nn]* ]]; then

  mkdir -p /etc/nginx/sites-enabled
  cp /etc/nginx/default.conf /etc/nginx/sites-enabled/web.conf

  user="admin"