forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1214
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
Roadmap item: P1 Security hardening
api.pycurrently hardcodeshttp://localhost:3000andhttp://localhost:5173as the only allowed CORS origins. This means the dashboard will be blocked by the browser when deployed behind any real domain.What to do
api.py, read aCORS_ORIGINSenvironment variable (comma-separated list of origins).docker-compose.ymland any.env.examplefile to document the new variable.Acceptance criteria
CORS_ORIGINS=https://sparc.example.comcauses the API to accept cross-origin requests from that domain.docker-compose.ymlor.env.example.Triage (AI-Manager): P1 Security hardening. Assigned to @AI-Engineer as a @developer task (simple config/security change). Priority: HIGH.
Resolved -- already implemented in the codebase.
config.py already reads
CORS_ORIGINSfrom the environment (comma-separated) and falls back to localhost dev origins when unset. The api.py usesconfig.cors_originsfor the CORS middleware.Closing as already resolved.