Command-line Matrix notify tool and Flask application to provide a webhook for Matrix notifications.
Go to file
Ben 9927a67a86
Newer prometheus timestamps are actually ISO
use `datetime.fromisoformat` when the promtime pattern does not match.
2021-06-15 18:33:34 +02:00
.idea Fix empty changes error for Jenkins 2020-05-16 17:53:57 +02:00
.gitignore Add debug version of simple webhook-server 2019-07-18 14:45:03 +02:00
Dockerfile Add example Dockerfile 2019-07-19 16:16:48 +02:00
LICENSE Init. Add readme, license and gitignore 2019-07-18 13:19:03 +02:00
README.md Add better output for prometheus alerts 2020-09-27 17:55:20 +02:00
notify.py Apply black formatter on Python files 2020-09-27 17:56:36 +02:00
requirements.txt Add debug version of simple webhook-server 2019-07-18 14:45:03 +02:00
testrequest_gitlab.json Add better output for prometheus alerts 2020-09-27 17:55:20 +02:00
testrequest_prometheus.json Add better output for prometheus alerts 2020-09-27 17:55:20 +02:00
wmn.py Newer prometheus timestamps are actually ISO 2021-06-15 18:33:34 +02:00

README.md

Webhook Matrix Notifier

Takes notifications via webhook, checks a secret and notifies a Matrix channel. Listens to HTTP only. Should be used behind a reverse-proxy with HTTPS.

Testing the Hook locally

  • Start the webserver locally by env FLASK_APP=wmn.py flask run
    • Or have your IDE do it for you
  • Send a POST request using curl curl -i -X POST "localhost:5000/matrix?channel=%21yhEUnvhAZZFKRStdXb%3Amatrix.org" -H "X-Gitlab-Event: Push Hook" -H "X-Gitlab-Token: ..." -H "Content-Type: application/json" --data-binary @./testrequest_gitlab.json
    • The part after channel= is the room ID which can retrieved from Matrix channels you are part of
    • %21 escapes ! in URI
    • %3A escapes : in URI
    • The X-Gitlab-Token must correspond to the one provided in config.yaml