From ca7d71325c9a72587a0f10df6161921e12bf5f53 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 1 Nov 2026 11:16:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(ops):=20seo-unblock=20v3=E2=80=94=E2=80=94?= =?UTF-8?q?=E8=A1=A5=E5=9B=9E=E5=88=A4=E5=AE=9A=E5=8F=8D=E8=BD=AC=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E5=88=B6=E4=B8=BA=20include=20=E5=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2 名单制漏 dpanel/ms365/ddns(同 default 文件 include snippet,剥 离后集体失守 noindex,实弹发现);v3 改凡 include esa-origin-ssl 且非博客主站一律补回,博客判定同步修正字符类。 验证: bash -n 语法过;判定正则对 default 实文件 server_name 复核 Spec: none (脚本热修 v3) Co-authored-by: GLM-5.3 --- scripts/ops/seo-unblock.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ops/seo-unblock.sh b/scripts/ops/seo-unblock.sh index ee26740..455932e 100755 --- a/scripts/ops/seo-unblock.sh +++ b/scripts/ops/seo-unblock.sh @@ -20,7 +20,7 @@ for f in "$SITES"/*; do names=$(sudo grep -h "server_name" "$f" 2>/dev/null || true) [ -z "$names" ] && continue # 内部服务判定:server_name 含内部子域且不含主站裸域 - if echo "$names" | grep -qE "(git|api|oj|token|fc|latex|cpa)\.wait4x\.online" && ! echo "$names" | grep -qE "server_name[^;]*(^|[[:space:]])(www\.)?wait4x\.online([[:space:]];|$)" || echo "$names" | grep -qx "server_name wait4x.online;"; then + if sudo grep -q "include snippets/esa-origin-ssl" "$f" && ! echo "$names" | grep -qE "server_name[^;]*(^|[[:space:]])(www\.)?wait4x\.online([[:space:]];|$)" || echo "$names" | grep -qx "server_name wait4x.online;"; then sudo grep -q "X-Robots-Tag" "$f" || echo " [补回] $f:server 块加 add_header X-Robots-Tag noindex always;" fi # 博客主站判定:server_name 恰含裸域 @@ -41,7 +41,7 @@ sudo sed -i '/X-Robots-Tag noindex/d' "$SNIPPET" && echo " snippet 已剥 noind for f in "$SITES"/*; do names=$(sudo grep -h "server_name" "$f" 2>/dev/null || true) [ -z "$names" ] && continue - if echo "$names" | grep -qE "(git|api|oj|token|fc|latex|cpa)\.wait4x\.online" && ! echo "$names" | grep -qE "server_name[^;]*(^|[[:space:]])(www\.)?wait4x\.online([[:space:]];|$)" || echo "$names" | grep -qx "server_name wait4x.online;"; then + if sudo grep -q "include snippets/esa-origin-ssl" "$f" && ! echo "$names" | grep -qE "server_name[^;]*(^|[[:space:]])(www\.)?wait4x\.online([[:space:]];|$)" || echo "$names" | grep -qx "server_name wait4x.online;"; then if ! sudo grep -q "X-Robots-Tag" "$f"; then sudo cp "$f" "$BAKDIR/$(basename "$f")" # 在首个 server_name 行后插入(server 块内、顶层指令位置合法)