P1-7(完成): Redis密码轮换(硬编码→.env注入,32位新密码已生效,老密码WRONGPASS验证失效)+ APP_ENV=production传入容器(修复生产UA校验和IP白名单未生效)

This commit is contained in:
Simon
2026-07-18 02:16:56 +08:00
parent f9be3547d9
commit 6cbee00dc0
+6 -3
View File
@@ -48,7 +48,7 @@ services:
image: redis:7-alpine
container_name: wecom_it_redis
restart: unless-stopped
command: redis-server --appendonly yes --save 900 1 --save 300 10 --requirepass 'R3d!s@2026#Secure'
command: redis-server --appendonly yes --save 900 1 --save 300 10 --requirepass "${REDIS_PASSWORD:?REDIS_PASSWORD must be set in .env}"
volumes:
- redis_data:/data
healthcheck:
@@ -116,8 +116,11 @@ services:
# 数据库(Docker 内部网络,用容器名通信)
- DATABASE_URL=postgresql://${POSTGRES_USER:-wecom}:${POSTGRES_PASSWORD:-wecom_secret}@postgres:5432/${POSTGRES_DB:-wecom_it_desk}
# RedisDocker 内部网络)
# Redis URL - 密码中的特殊字符需要URL编码 (#→%23)
- REDIS_URL=redis://:R3d%21s%402026%23Secure@redis:6379/0
# v4.0 P1-7:密码改为 .env 注入(原硬编码已入 git 历史,2026-07-18 轮换)
# 新密码为 32 位字母数字,无需 URL 编码;若含特殊字符必须用 REDIS_PASSWORD_ENCODED
- REDIS_URL=redis://:${REDIS_PASSWORD_ENCODED:-${REDIS_PASSWORD}}@redis:6379/0
# 应用环境(v4.0 P1-7 修复:生产 UA 校验和 IP 白名单依赖此变量,此前未传入容器)
- APP_ENV=${APP_ENV:-production}
# CORS
- CORS_ORIGINS=${CORS_ORIGINS:-http://itsupport.servyou.com.cn}
# AI 服务(Dify