forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1593
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
api.pyhardcodeslocalhost:3000andlocalhost:5173as CORS origins. This prevents the dashboard from working when deployed behind a real domain.What to do
CORS_ORIGINSenvironment variable inconfig.py(comma-separated list)api.pyto read allowed origins from this config valuelocalhost:3000,localhost:5173for development compatibility.env.exampleto document the variableAcceptance criteria
CORS_ORIGINSenv var controls allowed origins at runtimeapi.pyRef: ROADMAP.md P1 - Security hardening
This issue is already resolved in main.
config.pyreadsCORS_ORIGINSfrom the environment (comma-separated), andapi.pypassesconfig.cors_originsto the CORS middleware. Defaults to localhost dev origins when unset.