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:
+21
-10
@@ -8,7 +8,7 @@
|
||||
| 部署目录 | `/opt/jiedian` |
|
||||
| 系统要求 | Ubuntu 22.04 / 24.04(root 或 sudo) |
|
||||
| 协议 | Hysteria2(UDP 8443+) |
|
||||
| 管理面板 | `http://域名/<PANEL_PATH>/`(**HTTP 80,不要用 HTTPS 访问面板**) |
|
||||
| 管理面板 | `https://域名/<PANEL_PATH>/`(安装完成后输出;HTTP 80 自动跳转) |
|
||||
|
||||
---
|
||||
|
||||
@@ -43,7 +43,8 @@ dig +short A your.domain.com
|
||||
| 端口 | 协议 | 用途 | 必须 |
|
||||
|------|------|------|------|
|
||||
| 22 | TCP | SSH | 是 |
|
||||
| 80 | TCP | ACME 证书验证 + 管理面板 | 是 |
|
||||
| 80 | TCP | ACME 证书验证 | 是 |
|
||||
| 443 | TCP | **HTTPS 管理面板** | 是 |
|
||||
| 8443–8499 | UDP | Hysteria2(多节点递增) | 是 |
|
||||
|
||||
> **重要**:每增加一个节点,Hy2 端口 +1(8443、8444、8445…)。安全组必须放行 **8443–8499/UDP** 整段,不能只开 8443。
|
||||
@@ -87,16 +88,17 @@ bash scripts/install.sh
|
||||
安装脚本会自动完成:
|
||||
|
||||
1. 安装 sing-box、nginx、Python 面板依赖
|
||||
2. 配置 UFW 防火墙(22/80 TCP,8443–8499 UDP)
|
||||
2. 配置 UFW 防火墙(22/80/443 TCP,8443–8499 UDP)
|
||||
3. 通过 acme.sh 为 `DOMAIN` 申请 TLS 证书
|
||||
4. 初始化 SQLite 节点库与默认管理员
|
||||
5. 生成 sing-box 配置并启动服务
|
||||
5. 生成 sing-box 配置、启用 **HTTPS 面板**并启动服务
|
||||
|
||||
安装结束输出示例:
|
||||
|
||||
```
|
||||
==========================================
|
||||
管理面板: http://66.hyf2.cc/jiedian-xxxx/
|
||||
管理面板: https://66.hyf2.cc/jiedian-xxxx/
|
||||
(HTTP 会自动跳转到 HTTPS)
|
||||
面板路径: jiedian-xxxx
|
||||
用户名: dekun
|
||||
密码: xxxxx
|
||||
@@ -121,9 +123,9 @@ sing-box check -c /etc/sing-box/config.json
|
||||
# Hy2 端口监听(默认 8443,多节点还有 8444…)
|
||||
ss -ulnp | grep 8443
|
||||
|
||||
# 面板可访问
|
||||
# 面板 HTTPS 可访问(应返回 200/302)
|
||||
PANEL_PATH=$(grep ^PANEL_PATH= /opt/jiedian/.env | cut -d= -f2)
|
||||
curl -I "http://$(grep ^DOMAIN= /opt/jiedian/.env | cut -d= -f2)/${PANEL_PATH}/login"
|
||||
curl -Ik "https://$(grep ^DOMAIN= /opt/jiedian/.env | cut -d= -f2)/${PANEL_PATH}/login"
|
||||
```
|
||||
|
||||
客户端导入 Hy2 链接后测速,应显示正常延迟(非 `-1`)。
|
||||
@@ -153,10 +155,18 @@ sudo bash scripts/remove-vless.sh
|
||||
|
||||
- 停止并禁用 Xray
|
||||
- 重载 sing-box 配置
|
||||
- **启用 HTTPS 管理面板(443)**
|
||||
- 重启面板
|
||||
- 删除防火墙 443 规则(可选)
|
||||
|
||||
完成后客户端 **删除所有 VLESS 节点**,仅从面板复制 `hy2://` 链接。
|
||||
完成后客户端 **删除所有 VLESS 节点**,从面板复制 `hy2://` 链接,并用 **HTTPS** 登录面板。
|
||||
|
||||
### 已有 VPS 仅升级 HTTPS 面板
|
||||
|
||||
```bash
|
||||
cd /opt/jiedian && git pull
|
||||
sudo bash scripts/enable-panel-https.sh
|
||||
systemctl restart jiedian-panel
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -186,7 +196,8 @@ bash scripts/install.sh
|
||||
## 七、架构说明
|
||||
|
||||
```
|
||||
浏览器 ──► Nginx:80/<PANEL_PATH>/ ──► Flask 管理面板
|
||||
浏览器 ──► Nginx:443 HTTPS/<PANEL_PATH>/ ──► Flask 管理面板
|
||||
└─► Nginx:80(ACME + 跳转 HTTPS)
|
||||
│
|
||||
▼
|
||||
render-server.py
|
||||
|
||||
Reference in New Issue
Block a user