#!/bin/bash # 确认线上公开页面干净 + 产物完整 set -u BASE=https://relay.xxmxxs.top UA='LanRemote/1.8.0' echo "════════ 1. 线上官网有没有管理后台字样 ════════" curl -s --max-time 25 -H "User-Agent: $UA" "$BASE/" -o /tmp/site.html echo " 官网 $(wc -c < /tmp/site.html) 字节" hits=0 for kw in zhongzhuanzhan "/admin" 管理后台 管理页 管理入口 admin_password; do n=$(grep -c "$kw" /tmp/site.html 2>/dev/null || echo 0) if [ "$n" -gt 0 ]; then echo " **命中 $kw x$n**" hits=$((hits + 1)) fi done [ "$hits" = "0" ] && echo " ✓ 六个关键词一个都没有" echo echo " 官网里的所有站内链接:" grep -o 'href="/[^"]*"' /tmp/site.html | sort -u | sed 's/^/ /' echo echo "════════ 2. 三个产物在不在 ════════" for f in ykxmz-setup-1.8.0.exe ykxmz-server-1.8.0.zip ykxmz-watch-1.8.0.apk; do hdr=$(curl -sI --max-time 30 -H "User-Agent: $UA" "$BASE/download/$f") code=$(echo "$hdr" | head -1 | awk '{print $2}') len=$(echo "$hdr" | grep -i '^content-length' | tr -d '\r' | awk '{print $2}') printf " %-30s HTTP %-4s %s 字节\n" "$f" "$code" "${len:-?}" done echo echo "════════ 3. 服务端 zip 里有没有 CHANGELOG(不该有)════════" python3 - <<'PY' import zipfile, urllib.request url = "https://relay.xxmxxs.top/download/ykxmz-server-1.8.0.zip" try: data = urllib.request.urlopen(url, timeout=60).read() import io with zipfile.ZipFile(io.BytesIO(data)) as z: names = z.namelist() print(" 条目 %d 个" % len(names)) bad = [n for n in names if "CHANGELOG" in n.upper() or "RELEASE" in n.upper()] print(" %s 没有把更新日志打进包里" % ("✓" if not bad else "**有 " + str(bad) + "**")) # 运维文档里提到管理页是允许的 for n in names: if n.endswith(".txt"): try: t = z.read(n).decode("utf-8", "replace") except Exception: continue c = t.count("管理页") if c: print(" (运维文档 %s 提到管理页 %d 次 —— 按约定允许)" % (n.split("/")[-1], c)) except Exception as e: print(" 取包失败: %s" % e) PY echo echo "════════ 4. 管理页本身还正常吗(不公开提,但得能登录)════════" PASS=$(cat /root/lanremote-relay/data/admin_password.txt 2>/dev/null) curl -s -c /tmp/ck.txt -o /dev/null --max-time 20 \ -d "username=xmz7891&password=$PASS" "$BASE/admin/login" echo " 登录后访问: HTTP $(curl -s -o /dev/null -w '%{http_code}' -b /tmp/ck.txt --max-time 20 -H "User-Agent: $UA" "$BASE/zhongzhuanzhan")" echo " 未登录: HTTP $(curl -s -o /dev/null -w '%{http_code}' --max-time 20 -H "User-Agent: $UA" "$BASE/zhongzhuanzhan")" echo echo "════════ 5. 中转版本 ════════" curl -s --max-time 15 "$BASE/v1/health" | head -c 150 echo