Command-line Matrix notify tool and Flask application to provide a webhook for Matrix notifications.
Go to file
Ben 5be1f444e1
Add branch name to push message
and ignore empty GitLab push hook
2019-09-20 19:25:15 +02:00
.idea Sort commits and output first-line commit messages 2019-07-19 01:47:11 +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 Updated README 2019-08-09 13:29:42 +02:00
requirements.txt Add debug version of simple webhook-server 2019-07-18 14:45:03 +02:00
testrequest.json Added json test request and how to testing 2019-08-08 10:05:00 +02:00
wmn.py Add branch name to push message 2019-09-20 19:25:15 +02:00

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.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