|
| 1 | +# =========================================== |
| 2 | +# 熵减 (Entropydecrease) 环境变量模板 |
| 3 | +# =========================================== |
| 4 | +# 复制此文件为 .env 并填入实际值 |
| 5 | + |
| 6 | +# --- 前端 (client/) --- |
| 7 | + |
| 8 | +# Supabase 认证(在 https://supabase.com 创建项目后获取) |
| 9 | +VITE_SUPABASE_URL=https://your-project-id.supabase.co |
| 10 | +VITE_SUPABASE_ANON_KEY=your-anon-key |
| 11 | + |
| 12 | +# 后端服务地址 |
| 13 | +VITE_API_BASE_URL=http://localhost:8080 |
| 14 | +VITE_AI_GATEWAY_URL=http://localhost:8000 |
| 15 | +VITE_API_HEALTH_URL=/api/health |
| 16 | +VITE_SYNC_SERVER_URL=http://localhost:8080 |
| 17 | + |
| 18 | +# --- 后端 (server/) --- |
| 19 | + |
| 20 | +# 应用环境(development/production) |
| 21 | +APP_ENV=development |
| 22 | + |
| 23 | +# AI 模型 API Key(在对应平台注册获取) |
| 24 | +# 通义千问:https://dashscope.aliyun.com |
| 25 | +QWEN_API_KEY=sk-your-qwen-api-key |
| 26 | + |
| 27 | +# DeepSeek:https://platform.deepseek.com |
| 28 | +DEEPSEEK_API_KEY=sk-your-deepseek-key |
| 29 | + |
| 30 | +# 智谱 GLM(可选,作为备选模型):https://open.bigmodel.cn |
| 31 | +GLM_API_KEY=sk-your-glm-api-key |
| 32 | + |
| 33 | +# Gemini(可选,用于视频分析):https://aistudio.google.com/app/apikey |
| 34 | +GEMINI_API_KEY=your-gemini-api-key |
| 35 | + |
| 36 | +# 数据库(Docker Compose 默认值,本地开发无需修改) |
| 37 | +DATABASE_URL=postgresql://keban:keban_dev@localhost:5432/keban |
| 38 | +REDIS_URL=redis://localhost:6379 |
| 39 | + |
| 40 | +# JWT 安全密钥(生产环境必须修改为随机字符串) |
| 41 | +JWT_SECRET=change-this-to-a-random-string-in-production |
| 42 | + |
| 43 | +# Supabase JWT 公钥(从 Supabase Dashboard > Settings > API > JWT Settings 获取) |
| 44 | +# 用于后端服务验证前端 Supabase Auth 签发的 RS256 JWT |
| 45 | +SUPABASE_JWT_SECRET= |
| 46 | + |
| 47 | +# Supabase 项目 URL(用于后端验证 JWT issuer) |
| 48 | +SUPABASE_URL=https://your-project-id.supabase.co |
| 49 | + |
| 50 | +# Supabase 服务端密钥(Service Role Key,仅供服务端调用,禁止暴露给前端) |
| 51 | +SUPABASE_SERVICE_KEY=your-service-role-key |
| 52 | + |
| 53 | +# Supabase JWT 签名算法(HS256/RS256/ES256) |
| 54 | +# SUPABASE_JWT_ALGORITHM=RS256 |
| 55 | + |
| 56 | +# 开发者白名单(AI 网关):逗号分隔的 Supabase user_id 或邮箱, |
| 57 | +# 命中的账号完全豁免平台配额(不限流/不限费用)并赋予 lifetime 最高身份, |
| 58 | +# 仅供开发者自测,切勿在生产环境加入普通用户。 |
| 59 | +# DEV_USER_IDS=dev@example.com,uuid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| 60 | + |
| 61 | +# 服务端口 |
| 62 | +SYNC_SERVICE_PORT=8080 |
| 63 | +AI_GATEWAY_PORT=8000 |
| 64 | + |
| 65 | +# AI 网关预算控制(每日 token/费用上限,0=不限制) |
| 66 | +# BUDGET_DAILY_TOKEN_LIMIT=100000 |
| 67 | +# BUDGET_DAILY_COST_LIMIT=10 |
| 68 | + |
| 69 | +# AI 网关开发降级模式(生产环境缺密钥时拒绝启动;仅开发环境可显式开启) |
| 70 | +# GATEWAY_ALLOW_DEV_AUTH=false |
| 71 | + |
| 72 | +# OpenTelemetry 导出端点(可选,配置后网关上报 trace 到 OTLP Collector) |
| 73 | +# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 |
| 74 | + |
| 75 | +# 付费系统(面包多,可选——未配置时付费功能禁用) |
| 76 | +# PAYMENT_PROVIDER=mianbaoduo |
| 77 | +# PAYMENT_API_KEY=your-mianbaoduo-api-key |
| 78 | +# PAYMENT_API_SECRET=your-mianbaoduo-api-secret |
| 79 | +# PAYMENT_WEBHOOK_SECRET=your-webhook-secret |
| 80 | +# PAYMENT_API_BASE_URL=https://api.mianbaoduo.com |
| 81 | +# PAYMENT_TIMEOUT_MS=5000 |
| 82 | +# PAYMENT_RETRY_COUNT=3 |
| 83 | + |
| 84 | +# --- 生产部署配置 --- |
| 85 | + |
| 86 | +# CORS 允许的前端域名(多个用逗号分隔) |
| 87 | +# CORS_ORIGINS=https://entropydecrease.com,https://www.entropydecrease.com |
| 88 | + |
| 89 | +# 前端 API 基础 URL(生产环境设置为后端服务域名) |
| 90 | +# VITE_API_BASE_URL=https://api.entropydecrease.com |
| 91 | + |
| 92 | +# 日志级别(DEBUG/INFO/WARNING/ERROR) |
| 93 | +# LOG_LEVEL=INFO |
0 commit comments