# Server runtime environment file example. # Copy to env/staging.env for preproduction or prepare production runtime configuration. # Pure local development uses env/local.env copied from env/local.example.env. PORT=3000 APP_ENV=staging # APP_ENV=local enables unauthenticated /api/dev/resources. Never use it with remote data. # LLM 路由表:provider[/model][:weight],... # 单供应商单模型:alibaba 或 alibaba/qwen3.7-flash # 单供应商多模型:alibaba/qwen3.7-flash:70,alibaba/qwen-plus:30 # 多供应商单模型:alibaba/qwen3.7-flash:70,deepseek/deepseek-v4-flash:30 # 多供应商多模型:alibaba/qwen3.7-flash:50,alibaba/qwen-plus:20,deepseek/deepseek-v4-flash:30 # 省略 /model 时用该供应商默认模型;省略 :weight 时等权。 # 多条路由按用户 id hash 粘滞,同一用户始终命中同一条 provider+model。 # 未设置时自动回退:有 ALIBABA_API_KEY 用 alibaba,否则有 DEEPSEEK_API_KEY 用 deepseek LLM_PROVIDER= # 阿里云百炼(Qwen) ALIBABA_API_KEY=your-alibaba-api-key ALIBABA_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1 # DeepSeek DEEPSEEK_API_KEY=your-deepseek-api-key # Persistence, coordination and domain events DATABASE_URL=postgresql://user:password@db-host:5432/daoyou DB_MAX_CONNECTIONS=4 REDIS_URL=redis://:password@redis-host:6379/0 # Required. The checked-in local NATS compose file uses these development credentials. # Production must inject its own credentials and must not reuse this password. NATS_SERVERS=nats://127.0.0.1:4222 NATS_USER=app NATS_PASSWORD=local-nats-password # Optional name shown by the NATS monitoring endpoint. NATS_CLIENT_NAME= API_IP_RATE_LIMIT_WINDOW_SECONDS=60 API_IP_RATE_LIMIT_MAX_REQUESTS=300 # Required in production for /internal/cron/* bearer auth and manual backfills. CRON_SECRET=replace-with-a-random-secret # Better Auth BETTER_AUTH_SECRET=replace-with-a-random-secret BETTER_AUTH_URL=https://api.daoyou.example.com # Exact frontend origins, comma-separated; no paths or wildcard domains. PUBLIC_WEB_ORIGINS=https://app.daoyou.example.com # Set true for different-site frontends calling one HTTPS API directly. # Requires HTTPS BETTER_AUTH_URL; third-party cookie blocking may prevent login. BETTER_AUTH_CROSS_SITE_COOKIES=false # Optional for same-site subdomains only. Leave unset when cross-site cookies are enabled. # BETTER_AUTH_COOKIE_DOMAIN=.daoyou.example.com GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= # Captcha # 留空或不配置时关闭人机验证;配置后注册、登录等接口强制验证。 ALTCHA_HMAC_SECRET=replace-with-a-random-secret # Admin ADMIN_EMAILS= # Stable Better Auth user IDs allowed to use account-management operations. ADMIN_USER_IDS= # Mail SMTP_HOST= SMTP_PORT=465 SMTP_SECURE=true SMTP_USER= SMTP_PASS= MAIL_FROM="万界道友官方 " # Feature flags ENABLE_LLM_NAMING= DISABLE_LLM_NAMING= # SponsorKit / Afdian synchronization (maintenance and CI only; not app runtime) SPONSORKIT_AFDIAN_USER_ID= SPONSORKIT_AFDIAN_TOKEN= SPONSORKIT_AFDIAN_EXCHANGE_RATE=6.5 # In-game 功德簿 / Afdian Webhook # Set provider to afdian only after the migration, Redis and NATS are ready. SPONSORSHIP_PROVIDER=disabled SPONSORSHIP_FULFILLMENT_ENABLED=false AFDIAN_USER_ID= AFDIAN_TOKEN= # Frontend public build variables # Configure these in GitHub Actions Environment/Repository vars, not in the # server runtime env file passed to `docker run --env-file`. # VITE_API_BASE_URL=https://api.daoyou.example.com