Webhookd

Jump to: navigation, search
Webhookd Logo.svg

webhookd launches a web server which provides a REST API.

It supports the following features:

  • Trigger a shell script or executable via HTTP requests
  • Passing the HTTP request parameters to the environment context of the script
  • Live stream of the execution output
  • Send notification after the execution (email or HTTP request)
  • Check the request integrity with HTTP Signature methods
  • Authenticate the request with Basic Auth and TLS


Installation

# zypper addrepo https://download.opensuse.org/repositories/home:sm0x/openSUSE_Tumbleweed/home:sm0x.repo
# zypper refresh
# zypper install webhookd

Configuration

To configure webhookd change the environment variables

# /etc/default/webhookd

Add new scripts in the scripts folder in the home directory of the system user of webhookd

# /usr/share/webhookd/scripts 

Keep in mind that the script must be executable from the user who runs webhookd (default: webhookd)

Getting started

The service can be started and enabled using systemd

# systemctl enable --now webhookd

When the daemon is running you can test it with a basic get call using your browser:

# http://localhost:8080/echo

This will trigger the script

# /usr/share/webhookd/scripts/echo.sh

For more information visit the official github page.


Troubleshooting

error: exec: "/var/lib/webhookd/scripts/xxx.sh": permission denied

This happens when the user (webhookd per default) is not allowed to execute the script. To fix this, add the executable bit for the running user. For example:

# chown webhook:webhook /var/lib/webhookd/scripts/xxx.sh
# chmod 774 /var/lib/webhookd/scripts/xxx.sh

External links