feat: add web admin panel for node management

Add Flask panel with login, add/delete nodes, and share link copy.
Generate sing-box config from SQLite; add uninstall script and clean install flow.
Panel served at https://DOMAIN:8444 via nginx.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 09:10:19 +08:00
parent e8631a0e10
commit bccf6cfdce
21 changed files with 1069 additions and 305 deletions
+31 -31
View File
@@ -1,6 +1,6 @@
# jiedian — VPS 自建节点
个人/家庭自用的 **VLESS + Reality(主力)** + **Hysteria2(备用)** 双栈方案,基于 [sing-box](https://github.com/SagerNet/sing-box)。
个人/家庭自用的 **VLESS + Reality(主力)** + **Hysteria2(备用)** 双栈方案,基于 [sing-box](https://github.com/SagerNet/sing-box),带 **Web 管理面板**
**仓库**https://git.bz121.com/dekun/jiedian.git
**部署路径**`/opt/jiedian`Ubuntu
@@ -9,6 +9,7 @@
|------|-----|
| VPS IP | `47.76.87.111` |
| 域名 | `66.hyf2.cc` |
| 管理面板 | `https://66.hyf2.cc:8444` |
> 完整部署步骤见 **[docs/DEPLOY.md](docs/DEPLOY.md)**
@@ -25,50 +26,42 @@ cd /opt/jiedian
bash scripts/install.sh
```
安装完成后
```bash
cat /opt/jiedian/client/generated/share-links.txt
```
客户端导入见 [docs/client-import.md](docs/client-import.md)。
安装完成后会显示面板地址、用户名和密码。登录面板即可 **添加节点、复制分享链接**
---
## 架构
```
浏览器 ──► Nginx:8444 ──► Web 管理面板(登录、添加节点)
sing-box 配置重载
客户端 (Win/iOS/Android)
TCP 443 ─► sing-box VLESS+Reality ──► 直连出站
└─ UDP 8443 ─► sing-box Hysteria2 ─────► 直连出站
├─ TCP 443 ──► sing-box VLESS+Reality
UDP 8443 ─► sing-box Hysteria2
Nginx 127.0.0.1:8080 ← 伪装静态页(fallback
```
详细选型见 [docs/STACK.md](docs/STACK.md)。
---
## 目录结构
```
/opt/jiedian/
├── .env # 环境变量(IP/域名/密钥,已预填)
├── .env # VPS / Reality / 面板账号配置
├── data/nodes.db # 节点数据库(安装后生成)
├── panel/ # Web 管理面板(Flask
├── scripts/
│ ├── generate-keys.sh # 生成 UUID / Reality 密钥 / Hy2 密码
│ ├── install.sh # 一键部署
── render-client.sh # 本地渲染客户端配置
├── server/
── sing-box.json.template
│ └── nginx/ # fallback 伪装站
├── client/
│ └── sing-box-client.json.template
── uninstall.sh # 卸载后重装
│ ├── generate-keys.sh # 生成 Reality 密钥与面板密码
── render-server.py # 根据数据库生成 sing-box 配置
└── docs/
├── DEPLOY.md # Ubuntu 部署指南(主文档)
── client-import.md # 客户端导入
└── troubleshooting.md # 故障排查
├── DEPLOY.md
── client-import.md
```
---
@@ -78,19 +71,26 @@ Nginx 127.0.0.1:8080 ← 伪装静态页(fallback
| 端口 | 协议 | 用途 |
|------|------|------|
| 22 | TCP | SSH |
| 80 | TCP | HTTPLet's Encrypt 证书验证) |
| 80 | TCP | HTTPLet's Encrypt 验证) |
| 443 | TCP | VLESS + Reality |
| 8443 | UDP | Hysteria2 |
| 8444 | TCP | **Web 管理面板(HTTPS** |
---
## 常用运维
```bash
systemctl status sing-box
journalctl -u sing-box -f
sing-box check -c /etc/sing-box/config.json && systemctl restart sing-box
/root/.acme.sh/acme.sh --renew -d 66.hyf2.cc --force
# 面板 / 节点
https://66.hyf2.cc:8444
# 服务状态
systemctl status sing-box jiedian-panel
# 卸载后干净重装
bash scripts/uninstall.sh
bash scripts/generate-keys.sh # 可选:重置密钥与面板密码
bash scripts/install.sh
```
---
@@ -100,7 +100,7 @@ sing-box check -c /etc/sing-box/config.json && systemctl restart sing-box
1. 不要公开分享节点链接
2. Reality SNI 使用 `www.microsoft.com`,不要用 `66.hyf2.cc`
3. 客户端开启 uTLS / chrome 指纹
4. 被封后:换 serverName → 换 IP → 换 VPS 地区
4. 面板密码请妥善保管,安装后可在 `.env` 查看 `PANEL_PASSWORD`
---