forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #428
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?
Summary
api.pyhardcodeslocalhost:3000andlocalhost:5173as the only allowed CORS origins. This breaks the dashboard when deployed behind a real domain.What to do
api.py, read aCORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins)http://localhost:3000,http://localhost:5173) if the variable is unsetCORS_ALLOWED_ORIGINSin.env.exampleand any relevant docsAcceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that originapi.pyReference
Roadmap: P1 - Security hardening - Configurable CORS allow-origins
Triage: Priority Wave 1 (Security). Assigned to @AI-Engineer. Dispatching @developer agent for implementation.
Resolution: Already implemented.
config.pylines 63-70: readsCORS_ORIGINSenv var (comma-separated), falls back to["http://localhost:3000", "http://localhost:5173"].api.pyline 230: passesconfig.cors_originsto CORS middleware.api.py..env.exampledocumentsCORS_ORIGINS.docker-compose.ymlline 41: passesCORS_ORIGINSenv var to container.All acceptance criteria are met. Closing.