Handle unwritable browser volume in entrypoint
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m11s

This commit is contained in:
nocci 2025-12-30 16:54:42 +00:00
parent a477bb3327
commit e3e6a6f36c

View file

@ -16,13 +16,17 @@ rm -f /fgc/data/browser/SingletonLock
# Since this file has to be in the volume (data/browser), we can't do this in Dockerfile.
mkdir -p /fgc/data/browser
# fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830
# echo 'user_pref("privacy.resistFingerprinting", true);' > /fgc/data/browser/user.js
cat << EOT > /fgc/data/browser/user.js
# Only write the prefs file when the volume is writable (container runs as non-root).
if [ -w /fgc/data/browser ]; then
cat << EOT > /fgc/data/browser/user.js
user_pref("privacy.resistFingerprinting", true);
// user_pref("privacy.resistFingerprinting.letterboxing", true);
// user_pref("browser.contentblocking.category", "strict");
// user_pref("webgl.disabled", true);
EOT
else
echo "Warning: /fgc/data/browser is not writable; skipping user.js creation."
fi
# TODO disable session restore message?
# Remove X server display lock, fix for `docker compose up` which reuses container which made it fail after initial run, https://github.com/vogler/free-games-claimer/issues/31