chore: add writable browser profile fallback to /tmp
This commit is contained in:
parent
0340873d91
commit
7f5226ea65
1 changed files with 8 additions and 2 deletions
|
|
@ -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).
|
# Firefox profile directory (persistent if writable; fallback to cache when bind-mount is read-only).
|
||||||
BROWSER_DIR=/fgc/data/browser
|
BROWSER_DIR=/fgc/data/browser
|
||||||
|
mkdir -p "$BROWSER_DIR" 2>/dev/null || true
|
||||||
if [ ! -w "$BROWSER_DIR" ]; then
|
if [ ! -w "$BROWSER_DIR" ]; then
|
||||||
echo "Warning: $BROWSER_DIR not writable; using fallback profile at /home/fgc/.cache/browser"
|
echo "Warning: $BROWSER_DIR not writable; using fallback profile at /home/fgc/.cache/browser"
|
||||||
BROWSER_DIR=/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
|
chown 1000:1000 "$BROWSER_DIR" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
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"
|
mkdir -p "$BROWSER_DIR"
|
||||||
|
chmod 777 "$BROWSER_DIR" 2>/dev/null || true
|
||||||
|
fi
|
||||||
# clean up stale firefox locks that can trigger "already running"
|
# 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
|
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
|
# Firefox preferences are stored in $BROWSER_DIR/pref.js and can be overridden by a file user.js
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue