修改端口

This commit is contained in:
dekun
2026-05-22 13:09:07 +08:00
parent af5c249cf8
commit 3f0f77d450
9 changed files with 22 additions and 22 deletions
+10 -10
View File
@@ -42,7 +42,7 @@ nano .env # 至少填写 WECOM_WEBHOOK_URL
```env
WECOM_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=你的key
HOST=0.0.0.0
PORT=8000
PORT=21450
# 代理默认关闭
PROXY_ENABLED=false
@@ -91,14 +91,14 @@ docker compose up -d --force-recreate
docker compose down
# 手动测试企微推送
curl -X POST http://127.0.0.1:8000/api/push/test
curl -X POST http://127.0.0.1:21450/api/push/test
```
### 3.4 访问 Web
浏览器打开:`http://服务器IP:8000`
浏览器打开:`http://服务器IP:21450`
若前面有 Nginx,可反代到 8000 端口。
若前面有 Nginx,可反代到 21450 端口。
---
@@ -196,8 +196,8 @@ docker compose logs -f # Docker
pm2 logs binance-altcoin-monitor # PM2
# 触发刷新,观察是否拉取到数据
curl http://127.0.0.1:8000/api/refresh/today -X POST
curl http://127.0.0.1:8000/api/today/top30
curl http://127.0.0.1:21450/api/refresh/today -X POST
curl http://127.0.0.1:21450/api/today/top30
```
---
@@ -205,8 +205,8 @@ curl http://127.0.0.1:8000/api/today/top30
## 六、防火墙与 Nginx(可选)
```bash
# 开放 8000(若直接对外)
sudo ufw allow 8000/tcp
# 开放 21450(若直接对外)
sudo ufw allow 21450/tcp
```
Nginx 反代示例:
@@ -217,7 +217,7 @@ server {
server_name monitor.example.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_pass http://127.0.0.1:21450;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
@@ -283,7 +283,7 @@ pm2 restart binance-altcoin-monitor
| Web 无数据 | 检查能否访问币安;国内服务器尝试 `PROXY_ENABLED=true` |
| 企微收不到 | 检查 `WECOM_WEBHOOK_URL``curl -X POST .../api/push/test` |
| 08:10 未推送 | 确认容器/PM2 在 08:10 前已运行;查日志 |
| 端口占用 | `ss -tlnp \| grep 8000` 或改 `.env``PORT` |
| 端口占用 | `ss -tlnp \| grep 21450` 或改 `.env``PORT` |
| Docker 代理连不上 | 确认 `192.168.8.4:1081` 从容器内可达,必要时改宿主机 IP |
---