Spaces:
Runtime error
Runtime error
Commit History
-
Persist Chrome profile across restarts via Postgres snapshot
akashyadav758 +1: Claude Opus 4.8 (1M context)Hugging Face Spaces have an ephemeral filesystem, so the Chrome user-data dir (cookies / logins) is wiped on every restart and rebuild. Snapshot it into Postgres (Neon) instead: - profilesync: a small Go tool that tar+gzips /home/chrome/data into a Postgres bytea blob (backup) and extracts it back (restore). Cache/junk dirs are excluded so the blob stays small. Connection comes from the DATABASE_URL env var — the credential is never hardcoded. - Dockerfile: build the profilesync binary and ship it in /opt/profilesync. - start_hf.sh: restore the profile on boot, back it up on shutdown (after Chrome closes its files) and every 5 min as a safety net. All guarded by DATABASE_URL, so the Space still runs fine without the secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>69c2cb9