From d5456fae6bb1b6a676248d7148c747ce420cac5f Mon Sep 17 00:00:00 2001 From: kinghwj Date: Tue, 20 Oct 2026 14:24:20 +0800 Subject: [PATCH] =?UTF-8?q?docs(deploy):=20=E8=A1=A5=E5=85=85=20Webhook=20?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/nginx-github-webhook.conf | 5 +++++ docs/deploy-master.md | 2 +- docs/troubleshooting.md | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deploy/nginx-github-webhook.conf b/deploy/nginx-github-webhook.conf index b1e3d72..ab4dfd5 100644 --- a/deploy/nginx-github-webhook.conf +++ b/deploy/nginx-github-webhook.conf @@ -5,3 +5,8 @@ location = /github/webhook { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + +location = /github/webhook-health { + proxy_pass http://127.0.0.1:9001/health; + proxy_set_header Host $host; +} diff --git a/docs/deploy-master.md b/docs/deploy-master.md index 3f8a327..767274f 100644 --- a/docs/deploy-master.md +++ b/docs/deploy-master.md @@ -84,6 +84,6 @@ WantedBy=multi-user.target ## Nginx HTTPS 转发 -将 `deploy/nginx-github-webhook.conf` 的 `location` 放入 `laohang.space` 的 HTTPS server 块,然后执行 `sudo nginx -t && sudo systemctl reload nginx`。Webhook 服务只监听 `127.0.0.1:9001`,不要对公网开放 9001 端口。 +将 `deploy/nginx-github-webhook.conf` 的两个 `location` 放入 `laohang.space` 的 HTTPS server 块,然后执行 `sudo nginx -t && sudo systemctl reload nginx`。Webhook 服务只监听 `127.0.0.1:9001`,不要对公网开放 9001 端口。健康检查地址为 `https://laohang.space/github/webhook-health`。 `.github/workflows/deploy.yml` 只执行 Python、前端和部署脚本检查。Webhook 模式不再需要 `SERVER_HOST`、`SERVER_PORT`、`SERVER_USER`、`SERVER_SSH_KEY` 这些 Actions Secrets。 diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index b800cba..efe918d 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -81,7 +81,7 @@ Webhook 排查命令: sudo systemctl status weread-webhook.service --no-pager sudo journalctl -u weread-webhook.service -n 100 --no-pager sudo nginx -t -curl -fsS https://laohang.space/health +curl -fsS https://laohang.space/github/webhook-health ``` GitHub 显示签名错误时,确认 Webhook Secret 与 `/etc/weread-webhook.env` 完全一致;显示 202 但没有部署时,确认仓库全名、`refs/heads/master` 和部署锁状态。不要通过请求体传入 Shell 命令。