forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #799
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.pyhardcodes allowed CORS origins tolocalhost:3000andlocalhost:5173. This prevents the dashboard from working when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins) toconfig.pyapi.pyto read allowed origins from config instead of the hardcoded listlocalhost:3000andlocalhost:5173.env.exampleand READMEAcceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comin the environment results in that origin being permittedReferences
Roadmap item: P1 Security hardening -- CORS allow-origins are hardcoded