-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
128 lines (111 loc) · 5.77 KB
/
Copy path.env.example
File metadata and controls
128 lines (111 loc) · 5.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Cheers 环境变量示例
# 复制为 .env 并填写实际值。不要把本示例中的 change-me 或本地开发密钥用于生产环境。
#
# 本文件只保留真的被消费的变量:Rust gateway(server/src/config.rs 等)、
# docker compose 模板(含 TLS overlay / Caddy)、frontend 构建参数、
# opencode-bot 容器。gateway 不认识的变量不要加回来——加了也不会生效。
# Docker 宿主机端口(遇到端口冲突时可修改)
GATEWAY_HOST_PORT=8000
FRONTEND_HOST_PORT=80
POSTGRES_HOST_PORT=5432
POSTGRES_HOST_BIND=127.0.0.1
BACKEND_HOST_BIND=127.0.0.1
RUSTFS_API_HOST_PORT=9000
RUSTFS_CONSOLE_HOST_PORT=9001
RUSTFS_API_HOST_BIND=127.0.0.1
RUSTFS_CONSOLE_HOST_BIND=127.0.0.1
# 生产域名 + CORS(建议与预签名对象域名保持一致)
APP_DOMAIN=cheers.example.com
CORS_ALLOWED_ORIGINS=https://cheers.example.com
# 限流是否信任代理头(X-Real-IP / X-Forwarded-For)。compose 拓扑里 gateway
# 端口只绑定 127.0.0.1(BACKEND_HOST_BIND),外部流量一律经 frontend nginx /
# Caddy(它们覆写 X-Real-IP)→ true 是安全且必要的(否则所有用户共享代理 IP
# 一个限流桶,攻击者 10 次失败就锁死全站登录 5 分钟)。若把 gateway 绑到
# 0.0.0.0 直连暴露,必须改为 false(gateway 自身默认即 false)。
TRUST_PROXY_HEADERS=true
# Frontend (Vite) — compose 构建参数
VITE_PUBLIC_BASE_PATH=/
VITE_API_BASE_URL=/api/v1
VITE_API_PROXY_TARGET=http://localhost:8000
VITE_WS_PROXY_TARGET=ws://localhost:8000
VITE_ENABLE_MERMAID=1
# PostgreSQL
POSTGRES_USER=cheers
POSTGRES_PASSWORD=change-me-postgres-password
POSTGRES_DB=cheers
# Main database (PostgreSQL). The Rust gateway uses sqlx — plain postgresql://,
# NOT the SQLAlchemy +asyncpg dialect. In docker compose this is overridden to
# point at the postgres service; for local `cargo run` it is read as-is.
# Migrations run automatically on gateway startup (sqlx) — there is no manual step.
DATABASE_URL=postgresql://cheers:change-me-postgres-password@localhost:5432/cheers
# Redis (optional; only needed for multi-instance fan-out)
REDIS_URL=redis://localhost:6379/0
# S3 / RustFS(gateway 同时接受 S3_* 与 STORAGE_S3_* 两种前缀)
STORAGE_S3_ENDPOINT=http://rustfs:9000
STORAGE_S3_REGION=us-east-1
STORAGE_S3_ACCESS_KEY=cheers-local-access-key
STORAGE_S3_SECRET_KEY=cheers-local-secret-key
STORAGE_S3_BUCKET=cheers-files
# Office→PDF preview conversion (Gotenberg). Compose points the gateway at the
# bundled gotenberg service; unset to disable office→PDF preview.
GOTENBERG_URL=http://gotenberg:3000
# JWT RS256 密钥对(gateway 必填,缺失/为空/非法 PEM 都会启动失败)。生成:
# openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out jwt_priv.pem
# openssl rsa -in jwt_priv.pem -pubout -out jwt_pub.pem
# .env 中可写带引号的多行值,或在部署环境中导出这两个变量。
JWT_PRIVATE_KEY=
JWT_PUBLIC_KEY=
# Secret-store key (optional). Encrypts secrets saved at runtime (e.g. the
# speech-to-text API key set via admin settings). When unset, the key is derived
# from JWT_PRIVATE_KEY — so set a dedicated value if you rotate JWT keys, or the
# stored secrets can no longer be decrypted and must be re-entered.
# openssl rand -hex 32
SECRET_STORE_KEY=
# 生产 HTTPS(TLS 入站,docker-compose.production.tls.yml / Caddy)
HTTP_PORT=80
HTTPS_PORT=443
TLS_CERT_DIR=./certs
TLS_CERT_FILE=/etc/caddy/certs/fullchain.pem
TLS_KEY_FILE=/etc/caddy/certs/privkey.pem
# ===== Initial administrator (created on first startup when ADMIN_PASSWORD is set) =====
# Production/public deployments must set a strong administrator password.
# Empty/example values stop the admin from being seeded.
ADMIN_USERNAME=admin
ADMIN_PASSWORD=
ADMIN_DISPLAY_NAME=System Administrator
# 是否开放自助注册(POST /auth/register)。默认 false(安全默认:账号由种子管理
# 员或 POST /users 创建);需要公开注册时显式设为 true。
OPEN_REGISTRATION=false
# ===== Agent Bridge =====
# 外部 provider 连接 WebSocket 时使用每个 Bot 自己的 agb_... token(经运行中的
# gateway 签发,见 docs/help/docker-compose-deploy.md)。
# Onboarding 下发给外部 connector 的公网 WebSocket base。不设置则回退
# ws://localhost:8000(仅本机开发可用)。生产 TLS 部署必须设为 wss://<你的域名>,
# TLS overlay 会自动从 APP_DOMAIN 推导(见 docker-compose.production.tls.yml)。
CHEERS_CONNECTOR_PUBLIC_BASE=
# ===== Docker Compose OpenCode Bot(可选,`docker compose --profile bot`)=====
# 容器内置 OpenCode ACP,支持 ACP 图片输入和嵌入文件上下文;实际图片理解还取决于模型能力。
# Bot token(agb_...)请通过管理接口签发,见 docs/help/docker-compose-deploy.md 第 6 步。
OPENCODE_BOT_USERNAME=opencode
OPENCODE_BOT_TOKEN=
# 本地构建:docker compose build opencode-bot(或指向你自己的镜像仓库)
OPENCODE_BOT_IMAGE=cheers/opencode-bot:latest
OPENCODE_BOT_WS_BASE=ws://gateway:8000
OPENCODE_OPENAI_API_KEY=
OPENCODE_OPENAI_BASE_URL=
OPENCODE_PROVIDER=deepseek
OPENCODE_MODEL=
OPENCODE_NATIVE_PERMISSION_MODE=ask
OPENCODE_PROMPT_TIMEOUT_MS=660000
OPENCODE_REQUEST_TIMEOUT_MS=
OPENCODE_WORKSPACE_DIR=/workspace
# ===== 邮件(Brevo 事务性邮件 API;用于注册验证码 / 密码重置)=====
# 配置 BREVO_API_KEY + EMAIL_FROM_EMAIL 后,gateway 通过 Brevo HTTP API 真实发信。
# 未配置时验证码回退打印到 gateway 日志(开发用;
# `docker logs cheers-gateway-1 | grep cheers::email`)。
# API key 在 Brevo 后台 SMTP & API → API Keys 获取(xkeysib- 开头)。
BREVO_API_KEY=
# 发件地址必须是 Brevo 里已验证的发件域下的地址,如 noreply@mail.example.com。
EMAIL_FROM_EMAIL=
# 发件显示名,默认 Cheers。
EMAIL_FROM_NAME=Cheers