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

Allow live browser without a configured password

Browse files
Files changed (3) hide show
  1. README.md +3 -4
  2. browser-ui/index.html +1 -1
  3. start-browser.sh +13 -12
README.md CHANGED
@@ -14,9 +14,8 @@ 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. `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.
21
 
22
  The browser starts on DuckDuckGo. This Space is public, so do not enter sensitive credentials or private information. Use it only for websites you are authorized to access.
 
14
 
15
  ## Use
16
 
17
+ 1. Open the Space and click **Open live browser**.
18
+ 2. Use the visible Chromium address bar to search, type, click, scroll, and navigate.
19
+ 3. Optional: add `BROWSER_PASSWORD` or `VNC_PASSWORD` in **Settings → Variables and secrets** to protect the VNC connection. Without a password, anyone with this public URL can control the browser.
 
20
 
21
  The browser starts on DuckDuckGo. This Space is public, so do not enter sensitive credentials or private information. Use it only for websites you are authorized to access.
browser-ui/index.html CHANGED
@@ -47,7 +47,7 @@
47
  <div class="step"><strong>3 · Browse</strong><span>Search and use the browser normally.</span></div>
48
  </div>
49
  <a class="launch" href="/vnc.html?autoconnect=true&resize=scale">Open live browser →</a>
50
- <p class="note">The browser starts on DuckDuckGo. VNC authentication protects this public Space; use the first 8 characters of your <code>BROWSER_PASSWORD</code> Space secret.</p>
51
  </section>
52
  <footer>Only browse websites you are authorized to access. Do not enter banking, email, or other sensitive credentials into a shared remote browser.</footer>
53
  </main>
 
47
  <div class="step"><strong>3 · Browse</strong><span>Search and use the browser normally.</span></div>
48
  </div>
49
  <a class="launch" href="/vnc.html?autoconnect=true&resize=scale">Open live browser →</a>
50
+ <p class="note">The browser starts on DuckDuckGo. No password is required in the current configuration, so anyone with this public URL may control the session. Add <code>BROWSER_PASSWORD</code> later if you want to turn protection on.</p>
51
  </section>
52
  <footer>Only browse websites you are authorized to access. Do not enter banking, email, or other sensitive credentials into a shared remote browser.</footer>
53
  </main>
start-browser.sh CHANGED
@@ -1,24 +1,25 @@
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
 
15
  export DISPLAY=:99
16
  export HOME=/tmp/browser-home
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 &
24
  sleep 1
@@ -29,7 +30,7 @@ x11vnc \
29
  -shared \
30
  -localhost \
31
  -rfbport 5900 \
32
- -rfbauth /tmp/vnc.pass \
33
  -noxdamage \
34
  -repeat >/tmp/x11vnc.log 2>&1 &
35
 
 
1
  #!/usr/bin/env bash
2
  set -Eeuo pipefail
3
 
4
+ # Password protection is optional. If no secret is configured, the live browser
5
+ # will be public to anyone who can open this Space URL.
6
  PASSWORD="${BROWSER_PASSWORD:-${VNC_PASSWORD:-}}"
7
+ if [ -n "$PASSWORD" ]; then
8
+ if [ "${#PASSWORD}" -lt 8 ]; then
9
+ echo "The browser password must contain at least 8 characters. x11vnc uses the first 8 characters." >&2
10
+ exit 1
11
+ fi
12
+ x11vnc -storepasswd "${PASSWORD:0:8}" /tmp/vnc.pass >/dev/null
13
+ AUTH_ARGS=(-rfbauth /tmp/vnc.pass)
14
+ else
15
+ echo "WARNING: no browser password configured; the public Space can control this browser." >&2
16
+ AUTH_ARGS=(-nopw)
17
  fi
18
 
19
  export DISPLAY=:99
20
  export HOME=/tmp/browser-home
21
  mkdir -p "$HOME" /tmp/browser-profile
22
 
 
 
 
23
  Xvfb :99 -screen 0 1440x900x24 -ac +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 &
24
  fluxbox -display :99 >/tmp/fluxbox.log 2>&1 &
25
  sleep 1
 
30
  -shared \
31
  -localhost \
32
  -rfbport 5900 \
33
+ "${AUTH_ARGS[@]}" \
34
  -noxdamage \
35
  -repeat >/tmp/x11vnc.log 2>&1 &
36