Files
jiu/deploy/production.env.template
T
wangjia 145bf06ff8 devops: production.env 同步通道修复——render-env 切 ali + 发版漂移告警
2026-07-04 二维码 IP 事故复盘:env 不随发版同步(by design,密钥走
render-env 手动通道),但 render-env 还停在 EC2 时代且割接后没跑过,
线上 env 的 STORAGE_*/CORS 一直是割接临时 IP。三处修复:

- deploy/render-env.sh:目标改 ssh 别名 ali(可 JIU_DEPLOY_SSH 覆盖)、
  SECRET_KEYS 补 PAY_SECRET(旧模板缺此行,直接 deploy 会删掉线上支付
  密钥)、健康检查改 :8081、覆盖前先备份线上 env
- deploy/production.env.template:SERVER_PORT 8080→8081(对齐 ali nginx
  反代口径)、补 PAY_SECRET 占位
- scripts/ci/deploy-server.sh(ali 分支):部署后比对模板与线上 env 的
  非密钥项,漂移只告警不覆盖——手改线上配置不再长期无人发现

线上 env 已手工修正(STORAGE_BASE_URL/STORAGE_PUBLIC_URL/SERVER_CORS_ORIGIN
→ https://jiu.51yanmei.com,退役 LICENSE_* 三行清除,改前有备份)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:20:53 +08:00

16 lines
650 B
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.
SERVER_MODE=release
# ali 主站:nginx(443) 反代 127.0.0.1:80812026-07-02 割接后口径)
SERVER_PORT=8081
SERVER_CORS_ORIGIN=https://jiu.51yanmei.com
DATABASE_DSN=root:CHANGE_ME_DB_PASS@tcp(127.0.0.1:3306)/jiu_db?charset=utf8mb4&parseTime=True&loc=Local
JWT_SECRET=CHANGE_ME_RANDOM_32CHARS
JWT_ACCESS_EXPIRE_MIN=60
JWT_REFRESH_EXPIRE_H=168
STORAGE_UPLOAD_DIR=/opt/jiu/images
STORAGE_BASE_URL=https://jiu.51yanmei.com/images
STORAGE_PUBLIC_URL=https://jiu.51yanmei.com
STORAGE_WEB_DIR=/opt/jiu/web
DB_PASSWORD=CHANGE_ME_DB_PASS
# pay 回调/下单 HMAC 共享密钥(与 pay 侧一致,Bitwarden 渲染)
PAY_SECRET=CHANGE_ME_PAY_SECRET