forked from 0xWheatyz/SPARC
Security: Make CORS allowed origins configurable via environment variable #468
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
Problem
api.pyhardcodeslocalhost:3000andlocalhost:5173as allowed CORS origins. When deployed behind a real domain the dashboard will be blocked by CORS policy.Task
CORS_ALLOWED_ORIGINS, comma-separated).localhost:3000,localhost:5173only when the variable is unset (for local development).config.pyto expose the new setting..env.examplewith the new variable and documentation.Acceptance Criteria
CORS_ALLOWED_ORIGINSenv var controls the allowed origins list..env.exampledocuments the variable.Already implemented.
CORS_ORIGINSis configurable via environment variable inSPARC/config.py(lines 63-70). Thedocker-compose.ymlpassesCORS_ORIGINS: ${CORS_ORIGINS:-}to the API container. Closing as completed.