webhook¶
webhook is a lightweight incoming webhook server to run shell commands. It is used to trigger scripts automatically, for example, to update the reprepro repository when a new package is available.
Installation¶
The webhook binary can be downloaded directly from the project's GitHub releases.
Install
Config¶
webhook is configured using a hooks.yaml file that defines the webhooks and the commands they execute. It is typically run as a systemd service to ensure it's always available.
Service¶
Enable service
Hooks¶
The hooks file defines the endpoints and the commands to be executed. This example shows a hook that triggers the reprepro update script.
Usage¶
Trigger¶
To trigger a hook, send an HTTP request to the webhook URL from any machine on your network.
Trigger hook
Logs¶
Logs for the webhook service and the scripts it executes are available through journalctl. It's helpful to distinguish between the logs from the webhook server itself and the output from the scripts it triggers.
Webhook Service Logs¶
These logs show the activity of the webhook server, such as incoming HTTP requests and hook matching. They are useful for debugging triggering issues.
Script Execution Logs¶
Thanks to the logger command in the hook configuration, the output of the update-reprepro-service.sh script is sent to the journal with a specific tag.