Spaces:
Paused
Paused
Arena Agent commited on
Commit ·
4be5146
1
Parent(s): e23ad3a
Accept VNC password alias for live browser
Browse files- README.md +1 -1
- 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 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 "${
|
| 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 &
|