From 7548a0a1610dc2df61d04f99a8858a10158084c8 Mon Sep 17 00:00:00 2001 From: "34047007@qq.com" <34047007@qq.com> Date: Mon, 10 Aug 2026 16:52:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deploy.sh=20=E9=A2=84=E6=A3=80=E6=94=B6?= =?UTF-8?q?=E7=AA=84=E5=88=B0=20CORS=5FORIGINS=EF=BC=88REDIS=5FURL=20?= =?UTF-8?q?=E6=98=AF=20str=20=E9=9D=9E=E5=A4=8D=E6=9D=82=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8CJSON=20=E9=A2=84=E6=A3=80=E4=BC=9A=E8=AF=AF=E6=8A=A5?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/deploy.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 42c6578..191d108 100644 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -121,8 +121,10 @@ if [ ! -f "$REPO_ROOT/.env" ]; then fi set -a; source "$REPO_ROOT/.env"; set +a -# 3. .env 复杂类型预检(fail fast):pydantic-settings 会把 CORS_ORIGINS 等按 JSON 解析, -# 写成了普通字符串会在迁移时炸(8-10 事故),这里提前捕获,给出正确写法提示 +# 3. .env 复杂类型预检(fail fast):pydantic-settings 会把 list/dict 类型字段按 JSON 解析, +# 写成了逗号列表会在迁移时炸(8-10 事故),这里提前捕获,给出正确写法提示。 +# 仅检查 config.py 中的复杂类型字段(现仅 CORS_ORIGINS);str 类型(如 REDIS_URL) +# 不按 JSON 解析,预检会误报,不要加进来。 json_env_check() { local var="$1" local v="${!var:-}" @@ -133,9 +135,6 @@ json_env_check() { fi } json_env_check CORS_ORIGINS -json_env_check ALLOWED_ORIGINS -json_env_check REDIS_URL -json_env_check PUBLIC_ORIGINS # 3. flock 单实例锁(防两人/两终端并发部署) exec 9>/tmp/scilit-deploy.lock