diff --git a/panel/links.py b/panel/links.py index afc6c27..4f4f3c9 100644 --- a/panel/links.py +++ b/panel/links.py @@ -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} diff --git a/scripts/generate-keys.sh b/scripts/generate-keys.sh index 7f8d936..0487015 100644 --- a/scripts/generate-keys.sh +++ b/scripts/generate-keys.sh @@ -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 diff --git a/scripts/render-client.sh b/scripts/render-client.sh index 3ce6931..3e9cb86 100644 --- a/scripts/render-client.sh +++ b/scripts/render-client.sh @@ -28,7 +28,7 @@ sed -e "s|\${VPS_IP}|${VPS_IP}|g" \ cat > "$OUT_DIR/share-links.txt" < 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", }, }, }, diff --git a/server/sing-box.json.template b/server/sing-box.json.template index e1d9a85..78562f5 100644 --- a/server/sing-box.json.template +++ b/server/sing-box.json.template @@ -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" } } },