Files
openteam/.env.example
T
SakurasanandClaude 4846db9293 M3 收尾: 限流/配额 + 前端骨架屏 + 单端口托管前端
- ratelimit(内存计数): 密钥级每日请求数/Token 配额、用户级每秒速率
  (OT_RATELIMIT_USER_RPS), 超限返回 429
- 网关 Auth 前置配额/限流检查, finishUsage 累计密钥 token 用量
- 前端 Skeleton 组件 + Dashboard/管理总览加载态
- Go 服务托管 web/dist 静态资源(SPA 回退), 单端口即可访问前后端

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-15 16:13:09 +08:00

43 lines
1.3 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# openteam 服务配置示例 —— 复制为 .env 后修改
# 所有项均可用环境变量 OT_<KEY> 覆盖(点号转下划线,如 db.driver → OT_DB_DRIVER)
# 运行环境 development | production
OT_ENV=development
OT_PORT=8080
# 数据库(开发默认 SQLite;生产切 postgres)
OT_DB_DRIVER=sqlite
OT_DB_DSN=data/openteam.db
# OT_DB_DRIVER=postgres
# OT_DB_DSN=host=localhost user=openteam password=openteam dbname=openteam port=5432 sslmode=disable
# JWT(生产必须更换为随机长字符串)
OT_JWT_SECRET=change-me-to-a-long-random-string
OT_JWT_ACCESS_TTL=2h
OT_JWT_REFRESH_TTL=168h
OT_JWT_COOKIE_SECURE=false
# 注册策略:open(开放)| invite(邀请码)
OT_AUTH_REGISTRATION_MODE=open
# 渠道密钥加密主密钥(生产必须设置,32 字节以上)
OT_MASTER_KEY=change-me-master-key
# 默认上游渠道(首次启动自动创建 OpenAI 渠道)
OT_PROXY_UPSTREAM_KEY=
OT_PROXY_UPSTREAM_BASE_URL=https://api.openai.com
OT_PROXY_DEFAULT_MODEL=gpt-4o-mini
OT_PROXY_TIMEOUT=120s
# 渠道健康检查
OT_PROXY_HEALTH_INTERVAL=60s
OT_PROXY_HEALTH_FAIL_THRESHOLD=2
# 限流(内存计数,Redis 后置):用户级每秒请求数上限(0=不限制)
OT_RATELIMIT_USER_RPS=20
# 初始管理员(仅首次创建生效)
OT_ADMIN_USERNAME=admin
OT_ADMIN_EMAIL=admin@localhost
OT_ADMIN_PASSWORD=admin123