Spaces:
Sleeping
Sleeping
Commit History
-
Free persistent storage via HF Dataset repo (no Pro tier needed)
Piers Lyon +1: Claude Opus 4.7 (1M context)HF Spaces' free tier wipes the container filesystem on every restart — including every code push. That meant leads.db (network connections, hunt history, briefings, source health) was getting reset many times a day. The fix without paying for Pro is to use a private HF Dataset repo as a remote store for the SQLite file. state_sync.py - pull_state(): downloads leads.db from the dataset on container start - push_state(): uploads a consistent snapshot (sqlite3 backup API, safe vs. concurrent writes) — no-op if file unchanged since last push - start_periodic_sync(): background daemon thread, pushes every N min (default 5, configurable via STATE_SYNC_INTERVAL_MIN) - CLI: `python -m state_sync pull|push` for entrypoint use - Auto-creates the dataset repo (private) on first push if needed entrypoint.sh - Pulls state from HF Dataset before launching streamlit. No-op (with a logged hint) if HF_TOKEN / HF_STATE_REPO aren't set. app.py - Starts the periodic sync at st…20e93be -
Raise WebSocket message cap so file_uploader actually delivers bytes
Piers Lyon +1: Claude Opus 4.7 (1M context)User reports "Nothing after upload" — the file_uploader returns to its empty state with no toast and "0 connections loaded" still showing. With the always-rerun handler in place, this means the file bytes never reached Python at all. st.file_uploader streams the file over the Streamlit websocket. The relevant cap is server.maxMessageSize (default 200 MB but often silently capped by upstream proxies). We previously raised maxUploadSize but not maxMessageSize, so a 25 MB XLSX would be accepted by the HTTP layer then dropped at the websocket frame boundary. - .streamlit/config.toml: pin maxMessageSize=100 - entrypoint.sh: same flag on the streamlit run command for the HF Spaces container - app.py: log file_uploader state on every render so a repeat of this symptom can be diagnosed from HF runtime logs (we'll see whether the upload is reaching Python or dropping at the proxy) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ba883a4 -
Fix file_uploader 403 behind HF Spaces reverse proxy
Piers Lyon +1: Claude Opus 4.7 (1M context)Disable Streamlit XSRF + CORS and bump maxUploadSize to 100 MB. The deployed container sits behind a reverse proxy that strips the _streamlit_xsrf cookie, causing st.file_uploader to fail with AxiosError 403 (e.g. on the Network "Upload Connections" widget). The app is password-gated via auth.py, so turning off XSRF is acceptable for this internal tool. - entrypoint.sh: pass the flags to the streamlit run command in the container - .streamlit/config.toml: same settings for local dev runs Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b78517d
-
Add auth, audit logging, backup/restore, and HF Spaces deployment
Piers Lyon +1: Claude Opus 4.6 (1M context)- Two-tier auth: admin (full access) + viewer (read-only, concurrent sessions) - All Claude-spending buttons gated to admin role (HUNT, drafts, queries) - Append-only JSONL audit log for all significant actions - Scheduled hunt toggle (admin UI) + entrypoint for future automation - Database backup/restore buttons for ephemeral HF Spaces storage - Dockerfile for HF Spaces (Docker SDK, port 7860, non-root user) - Password hash generator script (bcrypt) - Deployment guides for both Azure Container Apps and Hugging Face Spaces Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>560b4ce