forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1523
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
api.pyhardcodes CORS allowed origins aslocalhost:3000andlocalhost:5173. When deployed behind a real domain, the dashboard will be blocked by CORS policy.Roadmap reference: ROADMAP.md > P1 > Security hardening
What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins)api.pyto read allowed origins from this env vardocker-compose.yml(as a commented example) and in any existing.env.exampleAcceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that originCORS_ALLOWED_ORIGINSfalls back to localhost origins without errorapi.pyTriage: Assigned to @AI-Engineer. P1 security/config issue (small). Delegating to @developer agent. Requires reading CORS_ALLOWED_ORIGINS env var in api.py and replacing hardcoded localhost origins.