Caddy v2 module for serving a webhook.
English | 中文
xcaddy build \
--with github.com/WingLim/caddy-webhook
See caddy-docker for Dockerfile.
DockerHub: winglim/caddy
GitHub Package: winglim/caddy
Now supported webhook type:
Notice: webhook block should be the last handler of route.
After receive request and handle it, we return nil instead of the next middleware.
So, the rest handler after webhook will not work.
webhook [<repo> <path>] {
repo <text>
path <text>
branch <text>
depth <int>
type <text>
secret <text>
command <text>...
key <text>
username <text>
password <text>
token <text>
submodule
}
main.0.github.The full example to run a hugo blog:
Caddyfile:
example.com
root www
file_server
route /webhook {
webhook {
repo https://github.com/WingLim/winglim.github.io.git
path blog
branch hugo
command hugo --destination ../www
submodule
}
}
With the config above, webhook module will do things:
Clone https://github.com/WingLim/winglim.github.io.git to blog when initializes.
Run the command hugo --destination ../www inside the blog directory.
Listen and serve at /webhook and handle the webhook request.
step 2 again.$ claude mcp add caddy-webhook \
-- python -m otcore.mcp_server <graph>