修改端口

This commit is contained in:
dekun
2026-05-27 14:23:47 +08:00
parent 62bd58d2c4
commit 95b55e41f3
5 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -39,10 +39,10 @@ chart-label-tool/
```bash ```bash
cd public cd public
python3 -m http.server 8080 python3 -m http.server 8010
``` ```
浏览器访问:<http://localhost:8080> 浏览器访问:<http://localhost:8010>
## 服务器部署(Ubuntu / 局域网) ## 服务器部署(Ubuntu / 局域网)
@@ -54,7 +54,7 @@ cd /opt/chart-label-tool
sudo bash deploy/install.sh sudo bash deploy/install.sh
``` ```
局域网访问:`http://<服务器IP>:8080` 局域网访问:`http://<服务器IP>:8010`
## 使用说明 ## 使用说明
+1 -1
View File
@@ -8,7 +8,7 @@ module.exports = {
name: "chart-label-tool", name: "chart-label-tool",
cwd: "/opt/chart-label-tool", cwd: "/opt/chart-label-tool",
script: "/opt/chart-label-tool/venv/bin/python", script: "/opt/chart-label-tool/venv/bin/python",
args: "-m http.server 8080 --bind 0.0.0.0 --directory /opt/chart-label-tool/public", args: "-m http.server 8010 --bind 0.0.0.0 --directory /opt/chart-label-tool/public",
interpreter: "none", interpreter: "none",
autorestart: true, autorestart: true,
watch: false, watch: false,
+1 -1
View File
@@ -7,7 +7,7 @@ set -euo pipefail
APP_DIR="/opt/chart-label-tool" APP_DIR="/opt/chart-label-tool"
REPO_URL="https://git.bz121.com/dekun/chart-label-tool.git" REPO_URL="https://git.bz121.com/dekun/chart-label-tool.git"
PORT=8080 PORT=8010
SERVICE_USER="root" SERVICE_USER="root"
echo "==> K线点位标注工具 部署开始" echo "==> K线点位标注工具 部署开始"
+10 -10
View File
@@ -15,7 +15,7 @@
``` ```
浏览器 (局域网) 浏览器 (局域网)
↓ HTTP :8080 ↓ HTTP :8010
PM2 → Python venv → http.server PM2 → Python venv → http.server
↓ 静态文件 ↓ 静态文件
/opt/chart-label-tool/public/ /opt/chart-label-tool/public/
@@ -42,13 +42,13 @@ sudo bash deploy/install.sh
2. 安装 Node.js 与 PM2(若未安装) 2. 安装 Node.js 与 PM2(若未安装)
3. 克隆/更新代码到 `/opt/chart-label-tool` 3. 克隆/更新代码到 `/opt/chart-label-tool`
4. 创建 Python 虚拟环境 `venv/` 4. 创建 Python 虚拟环境 `venv/`
5. 使用 PM2 启动 `chart-label-tool` 进程(监听 `0.0.0.0:8080` 5. 使用 PM2 启动 `chart-label-tool` 进程(监听 `0.0.0.0:8010`
6. 执行 `pm2 save``pm2 startup`(开机自启) 6. 执行 `pm2 save``pm2 startup`(开机自启)
部署成功后,在局域网内任意电脑浏览器访问: 部署成功后,在局域网内任意电脑浏览器访问:
```text ```text
http://<服务器局域网IP>:8080 http://<服务器局域网IP>:8010
``` ```
查看本机 IP 查看本机 IP
@@ -104,17 +104,17 @@ sudo pm2 startup
```bash ```bash
pm2 status pm2 status
curl -I http://127.0.0.1:8080 curl -I http://127.0.0.1:8010
``` ```
浏览器打开 `http://<服务器IP>:8080`,应能看到标注工具页面。 浏览器打开 `http://<服务器IP>:8010`,应能看到标注工具页面。
## 防火墙 ## 防火墙
若启用了 UFW,需放行 8080 端口: 若启用了 UFW,需放行 8010 端口:
```bash ```bash
sudo ufw allow 8080/tcp sudo ufw allow 8010/tcp
sudo ufw reload sudo ufw reload
``` ```
@@ -147,9 +147,9 @@ pm2 restart chart-label-tool
### 页面无法打开 ### 页面无法打开
1. `pm2 status` 确认进程为 `online` 1. `pm2 status` 确认进程为 `online`
2. `ss -tlnp | grep 8080` 确认端口在监听 2. `ss -tlnp | grep 8010` 确认端口在监听
3. 检查服务器与客户端是否同一局域网 3. 检查服务器与客户端是否同一局域网
4. 检查防火墙是否放行 8080 4. 检查防火墙是否放行 8010
### PM2 启动失败 ### PM2 启动失败
@@ -166,7 +166,7 @@ ls -la /opt/chart-label-tool/venv/bin/python
手动测试: 手动测试:
```bash ```bash
/opt/chart-label-tool/venv/bin/python -m http.server 8080 --bind 0.0.0.0 --directory /opt/chart-label-tool/public /opt/chart-label-tool/venv/bin/python -m http.server 8010 --bind 0.0.0.0 --directory /opt/chart-label-tool/public
``` ```
### Git 拉取失败 ### Git 拉取失败
+2 -2
View File
@@ -2,8 +2,8 @@
## 访问地址 ## 访问地址
- **局域网部署**`http://<服务器IP>:8080` - **局域网部署**`http://<服务器IP>:8010`
- **本机调试**`http://localhost:8080` - **本机调试**`http://localhost:8010`
推荐使用 **Chrome****Edge** 浏览器。 推荐使用 **Chrome****Edge** 浏览器。