From c1085de1a0d745774d1745e5156080c8c4585f7b Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 25 Oct 2026 10:03:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(launch):=20=E4=B8=8A=E7=BA=BF=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=84=9A=E6=9C=AC=20sudo=20=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E4=B8=A4=E5=A4=84=E8=87=B4=E5=91=BD=E4=BC=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 深度扫描从 server_name 行起算须以 depth=1 为初值(server{ 开栏在 该行之前;0 起算在下一行即误判闭合,块切片只剩一行导致 location / 永不匹配——Phase 0 artalk 插入带同款 bug 但恰好落在块顶部而无害) - STAGING 写死 /home/wait4x 绝对路径(sudo 下 /home/wait4x=/root,计划行 曾显示 /root/docker_apps/...) 验证: 只读模拟 start=94 end=128(真实闭合行),regex 命中,块内 artalk/halo 双 location 齐全;用户首跑在断言处安全中止(写入 前拦截),nginx 配置未受影响 Spec: none (上线脚本热修复,Phase 4 归档后用户执行面缺陷) Co-authored-by: GLM-5.3 --- infra/deploy/launch.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/infra/deploy/launch.sh b/infra/deploy/launch.sh index f4d021d..3014030 100755 --- a/infra/deploy/launch.sh +++ b/infra/deploy/launch.sh @@ -6,7 +6,8 @@ set -eu DRY=1 [ "${1:-}" = "--exec" ] && DRY=0 NGINX_DEFAULT=/etc/nginx/sites-available/default -STAGING="$HOME/docker_apps/blog/www-staging" +# sudo 下 $HOME=/root:路径必须写死用户绝对路径,不能用 $HOME +STAGING="/home/wait4x/docker_apps/blog/www-staging" TS=$(date +%Y%m%d-%H%M%S) # 目标:wait4x.online server 块内 location / 的 proxy_pass 换为静态 root。 @@ -35,7 +36,9 @@ path = sys.argv[1] s = open(path, encoding="utf-8").read() lines = s.splitlines(keepends=True) start = next(i for i, l in enumerate(lines) if "server_name wait4x.online;" in l) -depth = 0 +# server{ 开栏在 server_name 之前——从这行起算时已身处一层花括号内, +# 深度须从 1 起算(0 起算会在下一行误判块闭合,切片只剩一行) +depth = 1 for i in range(start, len(lines)): depth += lines[i].count("{") - lines[i].count("}") if i > start and depth == 0: