Spaces:
Running
Running
Commit History
-
Update Dockerfile
Verified signaturePlaywright update5458a04
-
history: keep job records and result files where a restart can't reach them
Sahil Kumar +1: Claude Opus 5Every job store was in memory behind a 1h STORE_TTL sweep, and the Space wipes its disk on each rebuild, so the Excel from a run you walked away from was gone — /download_results had a "Results expired" message for exactly this. /usage was no help: it reads usage_log.csv, which is host-only and wiped with the disk. Job history now reads the Supabase usage_events table, which log_usage() has been writing all along and nothing ever read back (il_job_history.py). Result files go to a private Supabase bucket (il_artifacts.py) at completion, hooked on the log_usage() call every tool already makes, so a new tool opts in by passing artifact=(name, bytes) — one place to remember, same as the usage row. The bucket is private because result files carry question content, unlike the diagrams in the public question-images bucket. /history/file checks the key's owner segment against the caller's CMS phone before minting a 5-minute signed URL, since a signed URL bypasses the login gate by design. …e99d2d3 -
deploy: split the tree into backend/frontend/database and centralise hosts
Sahil Kumar +1: Claude Opus 5Every CMS host name now comes from backend/il_endpoints.py instead of being hardcoded across eight modules, so switching stacks is config rather than an edit. The four defaults point at PRODUCTION: .env is gitignored and dockerignored, so the Space has no IL_* variables and inherits these defaults — it will read and write live CMS content. To put the Space back on preprod, set IL_QB_API, IL_GATEWAY_API, IL_COMMUNITY_API and IL_COMMUNITY_WEB as Space secrets. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>2e740d5
-
math: ship OMML2MML.XSL so Word equations convert on the Space
Sahil Kumar +1: Claude Opus 5Word equation conversion needs Microsoft's OMML2MML.XSL, which ships with Office. A Windows desktop finds it under Program Files, but the Hugging Face image is python:3.11-slim with no Office -- and parsing is server-side, so Office on the SME's laptop does not help. Every equation in a .docx therefore degraded to "[FORMULA]" on the deployment SMEs actually use. get_omml2mml() now also honours $OMML2MML_XSL and vendor/OMML2MML.XSL, and the stylesheet is committed there so `COPY . .` bakes it into the image. It is Microsoft's file, so it exists wherever this repo is pushed: keep the Space private unless the Office licence is checked. vendor/README.md records how to back the decision out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>039fa28
-
security: remove hardcoded secrets, fix logout/session bugs, run under gunicorn
Sahil Kumar +1: Claude Opus 5The repo is public, so the committed defaults were the real problem: - SECRET_KEY defaulted to a value in this file. Flask signs session cookies with it, so anyone reading the repo could forge app_authed=True and bypass the login gate entirely. ACCESS_PASSWORD defaulted to 'ilteam2026' and was printed in the startup banner. Both now resolve: environment variable -> .env (gitignored, auto-created on first run with a generated value) -> generate and persist. Every machine gets its own key and nothing secret is committed. .env also feeds os.environ, so SUPABASE_URL/SUPABASE_KEY can live there too. - The CMS bearer token was stored in the Flask session cookie. Cookies are signed but NOT encrypted, so the token was readable by anything holding the cookie. It now lives server-side keyed by the existing tagger_cid; the cookie carries only that id. Trade-off: a restart disconnects everyone. - Zip-slip: _md_resolve used extractall() on uploaded .zip files, so a crafted …2ffca7a
-
Fix Playwright: install OS deps separately then browser binary
Sahil Kumar048740e -
Fix HF Space build: remove heavy playwright browser install from Dockerfile
Sahil Kumar331b6cb
-
Containerize for Hugging Face Spaces (Docker) deployment
Sahil Kumar48d9178