forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #402
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?
Summary
api.pyhardcodes CORS allowed 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) toconfig.pyhttp://localhost:3000,http://localhost:5173when the variable is unsetapi.pyto read the allowed origins from config instead of hardcoding them.env.example(or equivalent) to document the new variableAcceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to only allow that originReference
Roadmap: P1 - Security hardening
Triage: Already Implemented
After reviewing the codebase, this issue has already been fully implemented in the current
mainbranch.This issue can be closed.