🐐
This commit is contained in:
24
backend/core/config.py
Normal file
24
backend/core/config.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
def require(key: str) -> str:
|
||||
value = os.environ.get(key)
|
||||
if not value:
|
||||
raise RuntimeError(f"Required environment variable {key} is not set")
|
||||
return value
|
||||
|
||||
def optional(key: str, default: str = "") -> str:
|
||||
return os.environ.get(key, default)
|
||||
|
||||
# Required
|
||||
JWT_SECRET_KEY = require("JWT_SECRET_KEY")
|
||||
DATABASE_URL = require("DATABASE_URL")
|
||||
RESEND_API_KEY = require("RESEND_API_KEY")
|
||||
EMAIL_FROM = require("EMAIL_FROM")
|
||||
STRIPE_SECRET_KEY = require("STRIPE_SECRET_KEY")
|
||||
STRIPE_PUBLISHABLE_KEY = require("STRIPE_PUBLISHABLE_KEY")
|
||||
STRIPE_WEBHOOK_SECRET = require("STRIPE_WEBHOOK_SECRET")
|
||||
|
||||
# Optional with sensible defaults for local dev
|
||||
FRONTEND_URL = optional("FRONTEND_URL", "http://localhost:5173")
|
||||
CORS_ORIGINS = optional("CORS_ORIGINS", "http://localhost:5173").split(",")
|
||||
WIKIRANK_USER_AGENT = optional("WIKIRANK_USER_AGENT", "WikiTCG/1.0")
|
||||
Reference in New Issue
Block a user