Simple bot that listens to gitlab webhooks and sends each event to authenticated chats
Although for now the fork is mergeable with upstream, I plan to work freely on it so expect to see divergence eventually. This README is being updated as the usage changes.
Python 3.9
- Create a new bot https://core.telegram.org/bots#create-a-new-bot and copy the token to the token file
- Change the authmsg file with some secret keyword
- Run app.py in your server or run it in docker
- At GitLab, create webhooks pointing to http://<bot address>:10111
- Talk to your bot and write only the keyword
You will receive notifications for all events for which a webhook notification was configured at GitLab. You can enable notifications at two places: site wide (using an administrator account), and per project, if you have enough rights.
Some webhooks overlap between site wide and per project, so you might want to disable at either place as you see fit to avoid having extra notifications.
If the webhook doesn't have a formatting function implemented, the bot will inform of that and just print the json data it received from the webhook so you can write one and send a patch :). Most events do have a formatter implemented, though.
A. Write "shutup" in your conversation and the bot won't talk to you anymore
A. Write /keyword instead of keyword
A. First build the image with
$ docker build -t bot .
then run it:
$ docker run -d -p 10111:10111 --name bot -e AUTHMSG="$(cat secret)" -e TOKEN="$(cat token)" bot