forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #306
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.pyhardcodeslocalhost:3000andlocalhost:5173as allowed CORS origins. This means the dashboard cannot be served from a real domain without a code change.Work Required
api.pyCORS_ALLOWED_ORIGINSenvironment variable (comma-separated)localhost:3000,localhost:5173when the variable is unset (preserving dev behaviour).env.examplewith a comment explaining the formatAcceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to only allow that origindocker-compose.ymlpasses the variable through from the host environmentThis issue has already been resolved in the fork's main branch. Already implemented in PR #27 (feat(security): configurable CORS). See SPARC/config.py CORS_ORIGINS env var.
Closing as completed.