forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1401
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.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as CORS allowed origins. This prevents the dashboard from functioning when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).APP_ENV=development.docker-compose.ymland any.env.exampleto document the variable.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comresults in that origin being permitted.Triage: Already resolved in main.
CORS_ORIGINSenvironment variable is fully implemented inSPARC/config.py(lines 63-70) with comma-separated parsing and localhost defaults. Used inSPARC/api.pyline 230. Also documented in.env.exampleanddocker-compose.yml. Closing as complete.