fix: improve VLESS link compatibility and add Reality repair script

Only encode SNI dots, keep pbk/sid raw, copy links via API, prefer xray keygen, and add repair-reality.sh for server-side fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-27 23:58:14 +08:00
parent 40d10a846f
commit 1fc3b8a89c
9 changed files with 127 additions and 28 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
# 一键修复 VLESS Reality:拉代码、重渲染配置、重启服务、诊断
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
[[ $EUID -eq 0 ]] || { echo "请使用 root 运行: sudo bash scripts/repair-reality.sh"; exit 1; }
export JIEDIAN_ROOT="$ROOT"
echo "[1/5] 更新代码 ..."
if [[ -d "$ROOT/.git" ]]; then
git -C "$ROOT" pull --ff-only || echo "git pull 跳过,请手动同步代码)"
fi
echo "[2/5] 检查 443 监听进程 ..."
if ss -tlnp 2>/dev/null | grep -q ':443'; then
ss -tlnp | grep ':443' || true
else
echo " 443 端口未监听"
fi
if [[ -f /etc/sing-box/config.json ]] && grep -q vless-reality /etc/sing-box/config.json 2>/dev/null; then
echo "[!] sing-box 仍含 VLESS Reality,执行迁移 ..."
bash "$ROOT/scripts/migrate-xray-reality.sh"
else
echo "[3/5] 渲染 Xray + sing-box 配置 ..."
python3 "$ROOT/scripts/render-xray.py"
python3 "$ROOT/scripts/render-server.py"
echo "[4/5] 重启服务 ..."
systemctl restart xray sing-box jiedian-panel
fi
echo "[5/5] 诊断 ..."
bash "$ROOT/scripts/verify-reality.sh"
echo ""
echo "完成。请在面板重新复制 VLESS 链接,删除 v2rayNG 旧节点后重新导入。"
echo "若仍失败,请执行: journalctl -u xray -n 50 --no-pager"