Skip to content

wuxs/gotify-webhook

Repository files navigation

gotify-webhook

A plugin forwarding messages to Webhook servers for gotify/server using gotify/plugin-api.

Getting Started

  1. Clone this repository.
  2. Download gomod-cap with make download-tools
  3. Build plugin with make GOTIFY_VERSION="v2.5.0" build.
  4. Copy build/webhook-linux-amd64.so to the Gotify server plugin directory.
  5. Restart the Gotify server.
  6. Configure this plugin in the Gotify web console.
  7. Enable the plugin in the Gotify web console.

Configuration Guide

Webhook

You can configure multiple webhooks to which messages can be forwarded to.

A full example is as follows:

- url: http://pool:5678/webhook-test/mqtt
  apps:
    - 1
    - 7
    - 4
  method: POST
  header:
    Content-Type: application/json
  body: "{{.title}}\n\n{{.message}}"

Field specification

Field Sub-field Type Required Default Description
url URL Y Webhook URL
apps Array N Gotify application IDs.
method String N POST HTTP request method.
header Key-value pairs N HTTP request headers.
Content-Type String N text/plain
body String N HTTP request body.
Application ID

When configured, only messages from these applications can be forwarded to this webhook. Otherwise, every message is forwarded.

Application IDs can be found by sending a request to the Gotify REST-API, which is delivered along with your Gotify server. You can visit it through the relative path /docs, for example, if your Gotify's URL is http://pool:9090/, then you can visit the REST-API through http://pool:9090/docs.

Body

The body field can either be a plain string or a template. As the latter, the following placeholders are supported:

  • {{.title}}: Title of the forwarded message.
  • {{.message}}: Content of the forwarded message.

About

Forwards messages to webhook servers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published