Spaces:
Runtime error
Runtime error
Commit History
-
Chore: remove cf-worker (CF IPs also blocked by Instagram)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>374aa7f -
Fix: fast-fail on hosted URL fetch with clear error message
Instagram blocks all cloud server IPs (HF, CF Workers — returns login wall). URL feature is local Docker only. Hosted builds now immediately return a clear error instead of waiting 30s for yt-dlp to time out. CF Worker script kept in deploy/ for future reference but unused. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>54d09f0 -
Feat: Cloudflare Worker relay for hosted Instagram URL fetch
Instagram blocks all cloud server IPs (HF, Render, etc). The Worker runs on Cloudflare's edge IPs which Instagram cannot block. deploy/cf-worker/worker.js fetches /embed/captioned/ and returns {"contents": html}. Server-side: proxy path now skips yt-dlp entirely (no 15s timeout), uses _parse_embed_caption on the returned HTML. hosted.env.example documents CAPTION_PROXY_URL as the Worker URL. Local builds unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a8b1596 -
Fix: URL fetch works on hosted via Instagram's embed/captioned endpoint
Uses /embed/captioned/ (statically served for website embeds — works from any server IP, no proxy needed) as the primary caption source. The proxy path (CAPTION_PROXY_URL) is kept as an override but is no longer needed or set by default. yt-dlp remains as a local fallback that also captures geotag data. Adds 3 new unit tests for _parse_embed_caption (basic, empty page, creator fallback) bringing pipeline checks to 101. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>495ba69 -
Feat: single Instagram URL extraction via CAPTION_PROXY_URL
Re-adds the URL input on the Extract tab. Caption fetch now routes through a configurable proxy (CAPTION_PROXY_URL) on hosted builds — default allorigins.win requires no account. Local Docker skips the proxy and uses yt-dlp + direct OG scraping instead. pipeline/transcribe.py: fetch_post_metadata gains proxy_url param; _fetch_via_proxy handles allorigins.win JSON response format. web/app.py: _run_url_pipeline + /extract-url + /url-chatbot-prepare restored; reads CAPTION_PROXY_URL from env. deploy/hosted.env.example: CAPTION_PROXY_URL=https://api.allorigins.win/get TODO.md: P0 item for server-side video transcription; URL item updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>56b50ce
-
HF: shorten Space short_description to <=60 chars
HF rejected the Space push because the frontmatter short_description exceeded the 60-char limit. Shortened it. Pushing to master re-triggers the sync workflow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>8349e48 -
#17/#20: hosted smoke test + final docs (HF deploy code-complete)
#17 Smoke test (recorded): entrypoint routes past Ollama when OLLAMA_ENABLED= false; with HOSTED=1 the no-LLM chatbot/geocode-export path completes (step=done, client_geocode=True), writes KML, and leaves rows ungeocoded for the browser to pin. Full in-browser geocode + container run documented as a manual step in SETUP.md. #20 Docs: README points to deploy/hf-spaces/; TODO.md marks the HF Spaces deploy code-complete (remaining = manual Space creation). DEPLOY.md/CLAUDE.md/ hosted.env.example were kept current along the way. HF Spaces deployment is code-complete. Live deploy = create the Space + push per deploy/hf-spaces/SETUP.md, then add the URL to the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>ad41219 -
#19: public-URL hardening
For a public Space: MAX_UPLOAD_MB (25) rejects oversized uploads on /upload and /chatbot-prepare (raw + post-unzip, guarding zip-bombs); MAX_POSTS (5000) caps library size with a "use Docker/CLI locally" message; safe_err() redacts sk-ant-… keys from error messages/SSE. Guardrail test covers safe_err; CLAUDE.md env list updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>8ec40f3 -
#18: extend guardrail test for client-geocode + set-coords
Extract valid_latlng() from /set-coords (pure) and add a client-geocode section to tests/test_deployment_modes.py: client-geocode ON when the server is bulk-blocked (hosted) / OFF for local Docker, and valid_latlng accepts valid coords while rejecting non-numeric and out-of-range. Runs in the guardrails CI job. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>50e43d1 -
#16: verify hosted UI renders without Ollama
Rendered index.html with OLLAMA_ENABLED=false HOSTED=1: Ollama button + models section hidden, Claude active by default, chatbot present, _ollamaEnabled=false, _clientGeocode=true. Template already supported it — no code change, just recorded the verification in TASKS.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>977a8ea -
#15: optional GitHub→HF Space sync workflow
.github/workflows/sync-hf-space.yml mirrors master to the HF Space on push: swaps deploy/hf-spaces/README.md in as the Space root README and force-pushes to the Space's main. No-ops until HF_TOKEN (secret) + HF_SPACE (variable) are configured, so it's safe to land now. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>dedd3f6 -
#14: HF Spaces setup/deploy doc
deploy/hf-spaces/SETUP.md — create the Docker Space, push the code (swap the frontmatter README in as root), set Variables (OLLAMA_ENABLED=false, HOSTED=1; no secrets — BYOK + client-side geocoding), build/open, plus a troubleshooting table (Ollama-hang, UID-1000 perms, port, geocode guard, cold start). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9f69fae -
#13: HF Space metadata README
deploy/hf-spaces/README.md — the Space's root README: YAML frontmatter (sdk: docker, app_port: 8000, title/emoji/colors, short_description) + a user-facing usage blurb (BYOK + chatbot, browser geocoding, privacy) and a hidden deploy-notes comment listing the Space variables to set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>0b593f5 -
#12: bound multi-user concurrency on the shared container
Add MAX_CONCURRENT_JOBS (default 2) + a Semaphore; _run_pipeline and _run_geocode_export acquire a slot before running (extra uploads sit in "queued" — the SSE already renders that) and release in finally, so several simultaneous uploads can't exhaust RAM on a free HF container. CLAUDE.md: document MAX_CONCURRENT_JOBS. TASKS.md: #12 done + commit log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9bcf12a -
HF deploy: container hosted-readiness + client-side geocoding (#8–#11)
Make the app deployable to HF Spaces in hosted mode, with browser-side geocoding (decision B — no server geocoder key/quota). #8 docker-entrypoint.sh: skip the Ollama wait/pull when OLLAMA_ENABLED=false (else it hangs forever on HF, which has no Ollama). Honor PORT. #9 Dockerfile: run as non-root UID 1000 (HF requirement), /app writable, ENTRYPOINT ./docker-entrypoint.sh. Local `docker compose up` unchanged. #10 Client-side geocoding: - web/app.py: CLIENT_GEOCODE = public_bulk_blocked(HOSTED); _run_pipeline skips server geocode and marks client_geocode; new POST /set-coords/{job_id} persists browser-geocoded lat/lng (range-validated); flag exposed to template. - index.html: geocodeClientSide() ports geocode.py (country/city/proximity gates, 3-tier search) and pins ungeocoded rows live from the visitor's IP, saving via /set-coords; banner in the results view. #11 Resilience (within #10): 1.1s throttle, localStorage cache, resumable (persisted coords +…8d29bb2 -
Demarcate the two deployment modes + add guardrails, CLAUDE.md
The app ships in two web shapes over one codebase (local Docker vs hosted free web), differentiated only by env config. Make each mode's contract explicit and guard against a change to one breaking the other. Guardrails: - Extract pure helpers encoding each contract: web.app.resolve_provider() (hosted hides Ollama -> Claude; local honors it) and pipeline.geocode.public_bulk_blocked() (HOSTED=1 + public OSM refused; unset/self-hosted allowed). Behavior unchanged; now unit-testable. - tests/test_deployment_modes.py pins both columns (hosted vs local). - CI: add a fast `guardrails` job (no Ollama) running the deployment-mode + prefilter tests on every push. CI fix: benchmark.yml set working-directory/artifact path to a nonexistent nested `your_instagram_activity/saved` folder (repo root IS that folder), so the existing benchmark job could never run. Fixed both. Docs: - DEPLOY.md — the two options side-by-side + the guardrail that protects them. - deploy/hosted.env.example — hos…c68fdea