var img = document.createElement('img'); img.src = "https://matomo.0l.de/piwik.php?idsite=5&rec=1&url=https://cunicu.li" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Hooks

The hooks feature allows the user to configure a list of hook functions which are triggered by certain events within the daemon.

Configuration

Section "hooks" of /etc/cunicu.yaml
## Hook callbacks
#
# Hook callback can be used to invoke subprocesses
# or web-hooks on certain events within cunīcu.
hooks:

# An 'exec' hook spawn a subprocess for each event.
- type: exec
command: ../../scripts/hook.sh

# Prepend additional arguments
args: []

# Pass JSON object via Stdin to command
stdin: true

# Set environment variables for invocation
env:
COLOR: "1"

# A 'web' hook performs HTTP requests for each event.
- type: web

# URL of the webhook endpoint
url: https://my-webhook-endpoint.com/api/v1/webhook

# HTTP method of the request
method: POST

# Additional HTTP headers which are used for the requests
headers:
User-Agent: ahoi
Authorization: Bearer XXXXXX