Proxies Github webhooks to internal servers.
make
base64EncodedSecret=$(echo -n "foobar" | base64)
curl -X POST \
-d '{"name": "receive-all-hook", "team": "my-team-name", "secret": "'$base64EncodedSecret'", "url": "http://internal-server.org/myapp"}' \
http://localhost:8080/hooks
The response will be something like:
{
"id":"368a1500082a071a7629c6ad704f7289e220fcc9",
"name":"receive-all-hook",
"team":"my-team-name",
"url":"http://internal-server.org/myapp",
"proxy_url":"/hooks/368a1500082a071a7629c6ad704f7289e220fcc9",
"created_at":"2018-05-16T10:54:58.1838475Z"
}
Use proxy_url
as webhook url when creating the webhook in GitHub and use the secret that you generated when
creating the webhook proxy endpoint (in the example above, this would be foobar
).
curl http://localhost:8080/hooks
[
{
"id":"368a1500082a071a7629c6ad704f7289e220fcc9",
"name":"receive-all-hook",
"team":"my-team-name",
"url":"http://internal-server.org/myapp",
"proxy_url":"/hooks/368a1500082a071a7629c6ad704f7289e220fcc9",
"created_at":"2018-05-16T10:54:58.1838475Z"
}
]
curl http://localhost:8080/hooks/368a1500082a071a7629c6ad704f7289e220fcc9
{
"id":"368a1500082a071a7629c6ad704f7289e220fcc9",
"name":"receive-all-hook",
"team":"my-team-name",
"url":"http://internal-server.org/myapp",
"proxy_url":"/hooks/368a1500082a071a7629c6ad704f7289e220fcc9",
"created_at":"2018-05-16T10:54:58.1838475Z"
}
curl -X DELETE http://localhost:8080/hooks/368a1500082a071a7629c6ad704f7289e220fcc9
Server responds with 204 No Content
if ok.
Code/project related questions can be sent to:
- David Steinsland, [email protected]
- André Roaldseth, [email protected]
We are also available on the slack channel #github-webhooks for internal communication.