Allows Gotify to receive Slack Incoming Webhooks.
Support
- Read-only blocks from Slack Block Kit
- Buttons pointing to URLs
- Handles any non-supported block by stripping it
- Does NOT implement any Slack specific interaction blocks (these are stripped)
Rational
Many services already integrate with Slack using Incoming Webhooks. If they don't directly integrate with Gotify, you can configure the Slack Webhook URL to this Plugin and receive the messages meant for Slack in Gotify.
Either build the plugin yourself or download a binary release. Make the .so
file available to Gotify in it's pluginsdir
(default /data/plugins
).
Or, use the pre-bundled Gotify Server Image built for each release: ghcr.io/lukasknuth/gotify-slack-webhook-bundled
from packages.
- Launch Gotify and verify the plugin is loaded in the log:
Starting Gotify version 2.5.0@2024-06-23-17:12:59
Loading plugin data/plugins/gotify-slack-webhook-linux-arm64.so
Started listening for plain connection on tcp [::]:80
- Navigate to "Plugins" and enable the "Slack Incoming Webhook Support" plugin
- Click the ⚙️ icon next to it and note the Webhook URL
- Under "Apps" create an App for each service and copy the token
http://my.gotify.de/plugin/1/custom/unique-to-your-install/webhook/slack/app-token-here
- In the service you want to integrate, configure the full URL as the Slack Incoming Webhook
- Done
This is the same payload as used in the above screenshot:
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Something is very wrong!",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "plain_text",
"text": "Observed Issue during Litestream replication"
},
"fields": [
{
"type": "mrkdwn",
"text": "*Severity*: ERROR"
},
{
"type": "mrkdwn",
"text": "*Occurence*: 4"
}
],
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "More Information",
"emoji": true
},
"url": "http://fluent.bit/asdf123"
}
}
]
}
You can build messages interactively in the Block Kit Builder and try them out yourself.
We're sending REST API requests to the local running Gotify instance. For this to work, two settings are crucial:
- If you must change the port, set
GOTIFY_SERVER_PORT
ENV variable instead of using the YAML file - You may not change the
server.listenaddr
orGOTIFY_SERVER_LISTENADDR
, the server must listen onlocalhost/127.0.0.1
NOTE: Neither of these apply to the default configuration of the server.