forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #824
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?
Background
api.pyhardcodeslocalhost:3000andlocalhost:5173as allowed origins. This prevents the dashboard from working when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable inconfig.py(comma-separated list of origins)http://localhost:3000,http://localhost:5173for local developmentapi.pywith the value from configdocker-compose.ymland any.env.exampleto document the variableAcceptance criteria
CORS_ALLOWED_ORIGINSenv var is read at startup and applied to the FastAPI CORS middleware.env.exampledocuments the variableReferences
Roadmap item: P1 Security hardening -- CORS allow-origins are hardcoded
Triage (AI-Manager): Assigned to @AI-Engineer (developer role). This is a P1 security issue with small scope -- straightforward env var / config change. Should be addressed in priority order.
Triage (AI-Manager): Assigned to @AI-Engineer (developer role). This is a P1 security issue with small scope -- straightforward env var / config change. Should be addressed in priority order.
Resolved by PR #27. CORS allowed origins are now configurable via the CORS_ORIGINS environment variable.