Files
DadaoTask/deploy/prod/env.production.example

42 lines
2.4 KiB
Plaintext
Raw Permalink 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.
# 生产环境变量模板(部署到 openclaw-01)
# 用法:复制到 ~/.config/dadaotask/env.production(chmod 600),把 __CHANGE_ME__ 换成真实口令。
# 真实口令不进仓库;本文件只描述字段。
ENV=prod
APP_NAME=达道Task
# ── 数据库:fnsvr-01 共享 PG 上**独立的库 + 独立的角色** ──────────────
# 生产不复用 dev 的 dadao_app/dadao_owner 角色:同集群同角色 = 拿到开发口令即可连生产。
# 角色名必须在迁移前注入(迁移里的 GRANT 按它生成)。
OWNER_DB_ROLE=dadao_prod_owner
APP_DB_ROLE=dadao_prod_app
DATABASE_URL=postgresql+asyncpg://dadao_prod_app:__APP_PW__@192.168.8.160:8432/dadaotask_prod
MIGRATION_DATABASE_URL=postgresql+asyncpg://dadao_prod_owner:__OWNER_PW__@192.168.8.160:8432/dadaotask_prod
# ── Redis:fnsvr-01 共享实例,独立 db 号隔离(不使用默认 0 号库)──────
# 该实例开了 requirepass(口令见 fnsvr-01 上 `docker inspect redis`),
# URL 里的口令必须百分号编码(例如 # → %23),否则 asyncpg/redis 解析失败:
# REDIS_URL=redis://:__REDIS_PW_URLENCODED__@192.168.8.160:6379/6
REDIS_URL=redis://:__REDIS_PW_URLENCODED__@192.168.8.160:6379/6
# ── 认证 ─────────────────────────────────────────────────────────────
# 生产校验:长度 ≥ 32 且不是开发默认值
JWT_SECRET=__CHANGE_ME_32_CHARS_OR_MORE__
ACCESS_TOKEN_MINUTES=30
REFRESH_TOKEN_DAYS=14
# 内测登录:短信通道还没接(非 dev provider 直接 501),先把固定验证码显式打开。
# 只允许内网访问;短信通道接好后把这两行改成 SMS_PROVIDER=<供应商> 并删掉开关。
INTERNAL_TEST_LOGIN=true
SMS_PROVIDER=dev
SMS_DEV_CODE=123456
SMS_THROTTLE_SECONDS=60
# 同源部署(后端直接托管 web/dist),CORS 只留本机调试用。
# 注意:这是 list 字段,必须写成 JSON 数组(逗号分隔会被 pydantic-settings 当成 JSON 解析而报错)
CORS_ORIGINS='["http://192.168.8.188:8200","http://127.0.0.1:8200"]'
# ── 前端产物与上传目录(绝对路径)─────────────────────────────────────
WEB_DIST_DIR=/home/openclaw/app/dadaotask/web/dist
UPLOAD_DIR=/home/openclaw/app/dadaotask/backend/var/uploads
MAX_UPLOAD_MB=20