详细信息如下所示。
apt-get install webhook
vim hooks.json
----------:
[
{
"id": "plan",
"execute-command": "/opt/hooks.com/hooks.sh",
"command-working-directory": "/opt/plan",
"response-message": "Webhook is rebuilding"
},
----------:webhook -port 9500 -hooks hooks.json -verbose -hotreload -ip 10.128.22.125这里的钩子地址是https://hooks.com/hooks/plan
这将触发挂钩并在给定目录上执行bash脚本。我从GitHub调用这个webhook URL来触发推送事件。我想添加秘密到这个网络钩子,以确保从钩子URL调用时的安全性。请帮我用这个网络钩子设置密码令牌。
提前谢谢。
发布于 2018-12-06 18:58:34
在这里找到一个解决方案https://github.com/adnanh/webhook/blob/master/docs/Hook-Rules.md
vim hooks.json并填入以下内容:
[
{
"id": "plan",
"execute-command": "/opt/hooks.com/hooks.sh",
"command-working-directory": "/opt/plan",
"response-message": "Webhook is rebuilding"
"trigger-rule":
{
"and":
[
{
"match":
{
"type": "payload-hash-sha1",
"secret": "yourSecretToken",
"parameter":
{
"source": "header",
"name": "X-Hub-Signature"
}
}
}
]
}
}
]https://stackoverflow.com/questions/53557685
复制相似问题