feat: enable HTTPS admin panel on port 443 for new deployments

Add Nginx SSL panel config, enable-panel-https.sh, secure Flask cookies, and update docs for https login.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 00:46:08 +08:00
parent 5704ab1a0a
commit 78b85c0d83
13 changed files with 175 additions and 47 deletions
+10 -8
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# 已有 VPS:停用 Xray/VLESS仅保留 Hysteria2
# 已有 VPS:停用 Xray/VLESS并启用 HTTPS 管理面板
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -8,22 +8,24 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export JIEDIAN_ROOT="$ROOT"
echo "[1/4] 停止并禁用 Xray ..."
echo "[1/5] 停止并禁用 Xray ..."
systemctl stop xray 2>/dev/null || true
systemctl disable xray 2>/dev/null || true
echo "[2/4] 更新代码并重载 sing-box 配置 ..."
echo "[2/5] 更新代码 ..."
if [[ -d "$ROOT/.git" ]]; then
git -C "$ROOT" pull --ff-only || echo "git pull 跳过,请手动同步)"
fi
echo "[3/5] 重载 sing-box 配置 ..."
python3 "$ROOT/scripts/render-server.py"
echo "[3/4] 重启服务 ..."
echo "[4/5] 启用 HTTPS 管理面板 ..."
bash "$ROOT/scripts/enable-panel-https.sh"
echo "[5/5] 重启服务 ..."
systemctl restart sing-box jiedian-panel
echo "[4/4] 可选:关闭防火墙 443(若不再需要) ..."
ufw delete allow 443/tcp 2>/dev/null || true
echo ""
echo "完成。VLESS 已停用,面板仅显示 Hysteria2 链接。"
echo "完成。VLESS 已停用,面板请用 HTTPS 访问。"
echo "客户端请删除旧 VLESS 节点,从面板复制 hy2:// 链接导入。"