feat(config): support multiple CORS origins and dynamic docker env vars

Parse comma-separated origins in FRONTEND_ORIGIN for Fastify CORS
Use host environment variables with fallbacks in docker-compose
Add Cloudflared tunnel deployment examples to .env.example
This commit is contained in:
2026-05-03 19:22:38 +08:00
parent 72ddae6f9d
commit 3a8a61487a
3 changed files with 26 additions and 5 deletions

View File

@@ -6,8 +6,15 @@ BACKEND_PORT=3001
TRUST_PROXY=false
FRONTEND_ORIGIN=http://localhost:20015
APP_ORIGIN=http://localhost:20015
VITE_API_BASE_URL=http://localhost:3001
BACKEND_PUBLIC_ORIGIN=http://localhost:20016
VITE_API_BASE_URL=http://localhost:20016
VITE_SITE_URL=https://pokopiawiki.tootaio.com
RESEND_API_KEY=
EMAIL_FROM="Pokopia Wiki <onboarding@resend.dev>"
AI_MODERATION_API_KEY=
# Cloudflared tunnel deployment example:
# FRONTEND_ORIGIN=https://pokopiawiki.tootaio.com,http://localhost:20015
# APP_ORIGIN=https://pokopiawiki.tootaio.com
# BACKEND_PUBLIC_ORIGIN=https://api-pokopiawiki.tootaio.com
# VITE_API_BASE_URL=https://api-pokopiawiki.tootaio.com