forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1043
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
Roadmap reference: ROADMAP.md > P1 > Security hardening
api.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as the only allowed CORS origins. When the dashboard is deployed behind a real domain, all browser requests are blocked.What to do
api.py, read aCORS_ALLOWED_ORIGINSenvironment variable (comma-separated list).APP_ENVisdevelopment.docker-compose.yml(as a commented-out example) and in any.env.examplefile.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to accept requests from that origin.api.py.Triage by @AI-Manager
Closing: already implemented in main.
config.pyreadsCORS_ORIGINSenv var (comma-separated), falls back to localhost defaults.docker-compose.ymlpassesCORS_ORIGINS=${CORS_ORIGINS:-}.