Matrix.org Simple alert/notifications HTTP API bot
Go to file
Bofh 960aa1613b initial commit 2020-09-29 10:52:25 +02:00
bin initial commit 2020-09-29 10:52:25 +02:00
conf initial commit 2020-09-29 10:52:25 +02:00
src initial commit 2020-09-29 10:52:25 +02:00
Dockerfile initial commit 2020-09-29 10:52:25 +02:00
LICENSE initial commit 2020-09-29 10:52:25 +02:00
README.md initial commit 2020-09-29 10:52:25 +02:00
build_docker.sh initial commit 2020-09-29 10:52:25 +02:00
run_docker.sh initial commit 2020-09-29 10:52:25 +02:00

README.md

Matrix.org Simple alert/notifications HTTP API bot

Uses the simple python matrixcli from https://github.com/saadnpq/matrixcli.git

Installation

Build the image using docker/podman

./build_docker.sh

The bot needs to be joined in a room before using it as a bot, you have to do this manually once, and then configure the ROOM ID on run_docker.sh script.

Configure this files to your needs:

./conf/config.py     # for username/password configuration
./conf/auth_tokens   # authentication tokens of the HTTP API (just simple strings)
./bin/bot            # a working script in curl to access the api and send a message
./run_docker.sh      # run container with 'docker run', configure to your needs

(Optional) Install the bin/bot by using a hardlink. Choose whatever path you want.

ln -sf $(realpath bin/bot) /usr/local/bin/mtx-alert

Run the container!

./run_docker.sh

Enjoy!

``bash

Examples:

echo 'It works!' | ./bin/bot echo 'This looks better, isnt it?' | /usr/local/bin/mtx-alert ./bin/bot "this is the message" /usr/local/bin/mtx-alert "this is another message"

Test API connection with (returns "TEST_OK")

echo test | ./bin/bot