forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1421
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 allowed CORS origins. This breaks the dashboard when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenv var (comma-separated list) inconfig.py.api.pyinstead of the hardcoded list.APP_ENV == development..env.exampleor README.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows that origin.References
Roadmap: P1 Security hardening -- configurable CORS origins.
Already implemented.
SPARC/config.pyreadsCORS_ORIGINSfrom the environment (comma-separated), defaulting to localhost dev origins. TheSPARC/api.pyCORS middleware usesconfig.cors_origins.docker-compose.ymlpassesCORS_ORIGINSthrough as well.Closing as completed.