我通过adnanh/web钩子安装了web钩子服务器,并以我认为正确的方式配置了它- Github给了我200个响应,web钩子-url是可访问的,另一个执行已经在工作。我还通过CLI单独运行了.sh文件--也很有效。
指向web钩子的链接:https://webhooks.dmnktoe.de/hooks/pull-dmnktoe
这是我的钩子
{
"id": "pull-dmnktoe",
"execute-command": "/var/www/html/webhooks/commands/pull-dmnktoe-de.sh",
"command-working-directory": "/var/www/html/dmnktoe-de-webhooks/webhook",
"trigger-rule": {
"and": [{
"match": {
"type": "payload-hash-sha1",
"secret": "mysecret",
"parameter": {
"source": "header",
"name": "X-Hub-Signature"
}
}
}]
}
},这是对应的“拉-dmnkto-de.sh”-file,应该在新提交后触发:
#! /bin/bash
cd /var/www/html/dmnktoe-de/$1
git stash
git pull
gulp serve:dist我想知道为什么页面不更新。我查看了nginx错误日志,发现:
2019/01/25 15:17:33 [error] 12297#12297: *4771 connect() failed (111: Connection refused) while connecting to upstream, client: 91.42.172.89, server: webhooks.dmnktoe.de, request: "GET /hooks/pull-dmnktoe HTTP/1.1", upstream: "http://127.0.0.1:9001/hooks/pull-dmnktoe", host: "webhooks.dmnktoe.de"我想您需要服务器块来理解我的问题。这是我的webhooks.dmnktoe.de服务器块。
server {
listen 443 ssl;
server_name webhooks.dmnktoe.de;
ssl_certificate /etc/letsencrypt/live/webhooks.dmnktoe.de/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/webhooks.dmnktoe.de/privkey.pem; # managed by Certbot
location / {
try_files $uri @proxy;
}
location @proxy {
proxy_pass http://webhooks;
}
}
upstream webhooks {
server 127.0.0.1:9001;
}发布于 2019-04-19 13:47:03
正如netstat输出中所指出的,web钩子似乎在监听IPv6接口,因此您必须将上游从http://127.0.0.1/hooks/...重写为http://[::1]/hooks/...。
在启动web钩子时,通过传递-ip 127.0.0.1,告诉web钩子绑定到127.0.0.1IP。
干杯,Adnan (adnanh/web钩子的作者:-)
https://askubuntu.com/questions/1112832
复制相似问题