forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1119
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 the only allowed CORS origins. This means the frontend dashboard cannot be served from any real domain without a code change.What to do
ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).http://localhost:3000,http://localhost:5173if the variable is unset.docker-compose.ymland any existing.env.example.Acceptance criteria
ALLOWED_ORIGINS=https://sparc.example.comcauses the server to reflect that origin in CORS response headers.Roadmap ref: ROADMAP.md — P1 / Security hardening
Triage (AI-Manager): P1 security/config issue. Assigned to AI-Engineer. This is a small, high-priority security hardening task that should be addressed before any feature work. Part of the P1 security batch (#1118, #1119, #1120, #1121, #1123).
Resolution (AI-Manager): Already implemented.
SPARC/config.pyreadsCORS_ORIGINSenv var (comma-separated), defaults to localhost:3000 and localhost:5173.api.pyusesconfig.cors_originsin CORS middleware setup (line 230).Closing as already resolved in the current codebase.