From 7412c1c08efb33c71cb122b98297c522db808a7d Mon Sep 17 00:00:00 2001 From: GongyiChuren Date: Tue, 2 Jun 2026 14:42:32 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20Docker=20=E9=83=A8=E7=BD=B2=E6=B3=A8?= =?UTF-8?q?=E6=84=8F=E4=BA=8B=E9=A1=B9=20+=20.env.example=20WEB=5FPANEL=5F?= =?UTF-8?q?HOST=20=E6=94=B9=E4=B8=BA=200.0.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 +- README.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 609a546..5bc666b 100644 --- a/.env.example +++ b/.env.example @@ -9,7 +9,7 @@ LOG_LEVEL=INFO # Web admin panel. Bind to localhost by default; use a reverse proxy / Cloudflare Tunnel if exposing it. WEB_PANEL_ENABLED=true -WEB_PANEL_HOST=127.0.0.1 +WEB_PANEL_HOST=0.0.0.0 WEB_PANEL_PORT=8765 WEB_PANEL_USER=admin WEB_PANEL_PASSWORD=change-me diff --git a/README.md b/README.md index 0dd5da5..60b2f94 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,12 @@ touch tg-watchbot.sqlite3 tg-watchbot.log docker compose up -d --build ``` -Docker 会在容器内监听 `0.0.0.0:8765`,宿主机仍然打开 `http://127.0.0.1:8765`。 +Docker 会在容器内监听 `0.0.0.0:8765`,宿主机打开 `http://127.0.0.1:8765` 即可访问面板。 + +**⚠️ 注意事项:** +- `.env.example` 里的 `WEB_PANEL_HOST` 默认为 `0.0.0.0`,Docker 容器内面板会监听所有网口。如果需要从外部访问(如公网 IP),请确保服务器防火墙/安全组已放行 `8765` 端口。 +- `.env` 文件会被容器挂载并写入(如 session secret),请勿设置为只读(`:ro`)。 +- 阿里云、腾讯云等云服务器需要在控制台的安全组/防火墙中手动放行端口,否则外部无法访问。 查看状态与日志: