fix: improve Reality compatibility for v2rayN/Xray clients

Add empty short_id, SpiderX in share links, and post-keygen render reminder so server config stays in sync with .env.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 11:49:53 +08:00
parent abbaac9520
commit 5685b869dc
5 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ def build_links(node: dict, env: dict | None = None) -> dict[str, str]:
f"vless://{node['uuid']}@{vps_ip}:443"
f"?encryption=none&flow=xtls-rprx-vision&security=reality"
f"&sni={reality_sni}&fp=chrome&pbk={public_key}&sid={short_id}"
f"&type=tcp#{name}"
f"&spx=%2F&type=tcp#{name}"
)
hy2 = f"hy2://{node['hy2_password']}@{domain}:{port}?sni={domain}#{name}-Hy2"
return {"vless": vless, "hy2": hy2}
+3
View File
@@ -67,6 +67,9 @@ if [[ -f "$ENV_FILE" ]]; then
echo "PANEL_USERNAME=dekun" >> "$ENV_FILE"
fi
echo "已写入 $ENV_FILE"
echo ""
echo "重要: 密钥已变更,必须重新生成 sing-box 配置并重启:"
echo " python3 ${ROOT_DIR}/scripts/render-server.py && systemctl restart sing-box"
else
echo "提示: 先复制 .env.example 为 .env 并填写 VPS_IP、DOMAIN 等,再重新运行本脚本" >&2
fi
+1 -1
View File
@@ -28,7 +28,7 @@ sed -e "s|\${VPS_IP}|${VPS_IP}|g" \
cat > "$OUT_DIR/share-links.txt" <<EOF
========== VLESS + Reality (主力) ==========
vless://${UUID}@${VPS_IP}:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=${REALITY_SERVER_NAME}&fp=chrome&pbk=${REALITY_PUBLIC_KEY}&sid=${REALITY_SHORT_ID}&type=tcp#Reality-Main
vless://${UUID}@${VPS_IP}:443?encryption=none&flow=xtls-rprx-vision&security=reality&sni=${REALITY_SERVER_NAME}&fp=chrome&pbk=${REALITY_PUBLIC_KEY}&sid=${REALITY_SHORT_ID}&spx=%2F&type=tcp#Reality-Main
========== Hysteria2 (备用) ==========
hy2://${HY2_PASSWORD}@${DOMAIN}:8443?sni=${DOMAIN}#Hysteria2-Backup
+2 -1
View File
@@ -73,7 +73,8 @@ def build_config(env: dict[str, str], nodes: list[dict]) -> dict:
"server_port": 443,
},
"private_key": env["REALITY_PRIVATE_KEY"],
"short_id": [env["REALITY_SHORT_ID"]],
"short_id": ["", env["REALITY_SHORT_ID"]],
"max_time_difference": "1m",
},
},
},
+2 -1
View File
@@ -25,7 +25,8 @@
"server_port": 443
},
"private_key": "${REALITY_PRIVATE_KEY}",
"short_id": ["${REALITY_SHORT_ID}"]
"short_id": ["", "${REALITY_SHORT_ID}"],
"max_time_difference": "1m"
}
}
},