Files
jiedian/docs/DEPLOY.md
T
dekun ba361eb5b8 fix: prevent [No Host] panel errors behind CDN or missing Host header
Force nginx to pass the domain as Host, add PANEL_DOMAIN fallback in Flask,
and document that the admin panel must be accessed over HTTP not HTTPS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:28:00 +08:00

120 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Ubuntu 部署指南
仓库:[https://git.bz121.com/dekun/jiedian.git](https://git.bz121.com/dekun/jiedian.git)
| 项目 | 值 |
|------|-----|
| VPS IP | `47.76.87.111` |
| 域名 | `66.hyf2.cc` |
| 管理面板 | `http://66.hyf2.cc/<PANEL_PATH>/`**必须 http,不要用 https** |
| 部署目录 | `/opt/jiedian` |
| 系统 | Ubuntu 22.04 / 24.04 |
---
## 部署前准备
### 1. DNS 解析
```
66.hyf2.cc → 47.76.87.111
```
验证:
```bash
dig +short A 66.hyf2.cc
```
### 2. 阿里云安全组
放行:`22``80``443/TCP``8443/UDP`**无需 8444**
---
## 一键部署
```bash
apt update && apt install -y git
git clone https://git.bz121.com/dekun/jiedian.git /opt/jiedian
cd /opt/jiedian
bash scripts/install.sh
```
安装结束会输出:
```
管理面板: http://66.hyf2.cc/jiedian-xxxx/
面板路径: jiedian-xxxx (见 .env 中 PANEL_PATH
用户名: admin
密码: xxxxx
```
浏览器打开面板 → 登录 → **添加节点** → 复制 VLESS / Hysteria2 链接到客户端。
---
## 卸载后重装(推荐流程)
若之前部署混乱,先卸载再装:
```bash
cd /opt/jiedian
git pull
bash scripts/uninstall.sh
bash scripts/generate-keys.sh # 重新生成 Reality 密钥与面板密码
bash scripts/install.sh
```
`uninstall.sh` 会停止服务并清理配置,**保留** `/opt/jiedian` 代码与 `.env` 基础字段。
---
## 安装脚本做了什么
1. 安装 sing-box、nginx、Python 面板依赖
2. 防火墙放行 22/80/443/8443(不暴露 8444
3. acme.sh 申请 `66.hyf2.cc` 证书
4. 初始化 SQLite 节点库 + 默认管理员
5. 生成 sing-box 配置并启动服务
6. Nginx 80 端口子路径反向代理管理面板
---
## 管理面板功能
| 功能 | 说明 |
|------|------|
| 登录 | `.env``PANEL_USERNAME` / `PANEL_PASSWORD` |
| 添加节点 | 自动生成 UUID + Hy2 密码,更新 sing-box |
| 复制链接 | VLESS Reality + Hysteria2 分享链接 |
| 删除节点 | 至少保留 1 个节点 |
| 连接状态 | 在线/离线、当前连接数(Clash API) |
| 流量统计 | 实时速率 + 累计上下行(Clash API 连接统计) |
---
## 部署后验证
```bash
systemctl status sing-box jiedian-panel
ss -tlnp | grep -E '80|443|5080'
ss -ulnp | grep 8443
PANEL_PATH=$(grep ^PANEL_PATH= /opt/jiedian/.env | cut -d= -f2)
curl -I "http://66.hyf2.cc/${PANEL_PATH}/login"
```
---
## 故障排查
| 问题 | 处理 |
|------|------|
| 面板 404 | 确认 URL 含完整 `PANEL_PATH`,见 `grep PANEL_PATH .env` |
| apt 锁被占用 | 等待自动更新结束,或 `bash scripts/install.sh` 会自动等待 |
| sing-box 443 被占用 | `ss -tlnp \| grep 443`,停止占用进程后重装 |
| 忘记面板密码/路径 | `grep PANEL_ /opt/jiedian/.env` 或重新 `generate-keys.sh` |
| SSH 主机密钥变更 | 重装系统后本地执行 `ssh-keygen -R 47.76.87.111` |
更多见 [troubleshooting.md](troubleshooting.md)。