Arena Agent commited on
Commit
4be5146
·
1 Parent(s): e23ad3a

Accept VNC password alias for live browser

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. start-browser.sh +9 -4
README.md CHANGED
@@ -14,7 +14,7 @@ An interactive remote Chromium browser streamed through noVNC.
14
 
15
  ## Use
16
 
17
- 1. In **Settings → Variables and secrets**, create `BROWSER_PASSWORD` with at least 8 characters.
18
  2. Open the Space and click **Open live browser**.
19
  3. Enter the first 8 characters of the password when noVNC asks.
20
  4. Use the visible Chromium address bar to search, type, click, scroll, and navigate.
 
14
 
15
  ## Use
16
 
17
+ 1. In **Settings → Variables and secrets**, create `BROWSER_PASSWORD` with at least 8 characters. `VNC_PASSWORD` is also accepted as an alias.
18
  2. Open the Space and click **Open live browser**.
19
  3. Enter the first 8 characters of the password when noVNC asks.
20
  4. Use the visible Chromium address bar to search, type, click, scroll, and navigate.
start-browser.sh CHANGED
@@ -1,9 +1,14 @@
1
  #!/usr/bin/env bash
2
  set -Eeuo pipefail
3
 
4
- : "${BROWSER_PASSWORD:?Set BROWSER_PASSWORD in Space Settings Variables and secrets}"
5
- if [ "${#BROWSER_PASSWORD}" -lt 8 ]; then
6
- echo "BROWSER_PASSWORD must contain at least 8 characters. x11vnc uses the first 8 characters." >&2
 
 
 
 
 
7
  exit 1
8
  fi
9
 
@@ -12,7 +17,7 @@ export HOME=/tmp/browser-home
12
  mkdir -p "$HOME" /tmp/browser-profile
13
 
14
  # VNC authentication is required because this Space is publicly reachable.
15
- x11vnc -storepasswd "${BROWSER_PASSWORD:0:8}" /tmp/vnc.pass >/dev/null
16
 
17
  Xvfb :99 -screen 0 1440x900x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 &
18
  fluxbox -display :99 >/tmp/fluxbox.log 2>&1 &
 
1
  #!/usr/bin/env bash
2
  set -Eeuo pipefail
3
 
4
+ # Accept the recommended name plus the common VNC_PASSWORD alias.
5
+ PASSWORD="${BROWSER_PASSWORD:-${VNC_PASSWORD:-}}"
6
+ if [ -z "$PASSWORD" ]; then
7
+ echo "Set BROWSER_PASSWORD (or VNC_PASSWORD) in Space Settings → Variables and secrets." >&2
8
+ exit 1
9
+ fi
10
+ if [ "${#PASSWORD}" -lt 8 ]; then
11
+ echo "The browser password must contain at least 8 characters. x11vnc uses the first 8 characters." >&2
12
  exit 1
13
  fi
14
 
 
17
  mkdir -p "$HOME" /tmp/browser-profile
18
 
19
  # VNC authentication is required because this Space is publicly reachable.
20
+ x11vnc -storepasswd "${PASSWORD:0:8}" /tmp/vnc.pass >/dev/null
21
 
22
  Xvfb :99 -screen 0 1440x900x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 &
23
  fluxbox -display :99 >/tmp/fluxbox.log 2>&1 &