From 7f5226ea652c5d92a24096a126b33ac4a142f3e2 Mon Sep 17 00:00:00 2001 From: nocci Date: Wed, 31 Dec 2025 11:13:39 +0000 Subject: [PATCH] chore: add writable browser profile fallback to /tmp --- docker-entrypoint.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 51084c9..eb9e8a6 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -19,13 +19,19 @@ rm -f /fgc/data/browser/SingletonLock 2>/dev/null || true # Firefox profile directory (persistent if writable; fallback to cache when bind-mount is read-only). BROWSER_DIR=/fgc/data/browser +mkdir -p "$BROWSER_DIR" 2>/dev/null || true if [ ! -w "$BROWSER_DIR" ]; then echo "Warning: $BROWSER_DIR not writable; using fallback profile at /home/fgc/.cache/browser" BROWSER_DIR=/home/fgc/.cache/browser - mkdir -p "$BROWSER_DIR" + mkdir -p "$BROWSER_DIR" 2>/dev/null || true chown 1000:1000 "$BROWSER_DIR" 2>/dev/null || true fi -mkdir -p "$BROWSER_DIR" +if [ ! -w "$BROWSER_DIR" ]; then + echo "Warning: $BROWSER_DIR not writable; using temp profile at /tmp/browser" + BROWSER_DIR=/tmp/browser + mkdir -p "$BROWSER_DIR" + chmod 777 "$BROWSER_DIR" 2>/dev/null || true +fi # clean up stale firefox locks that can trigger "already running" rm -f "$BROWSER_DIR"/parent.lock "$BROWSER_DIR"/lock "$BROWSER_DIR"/.parentlock 2>/dev/null || true # Firefox preferences are stored in $BROWSER_DIR/pref.js and can be overridden by a file user.js