1
0
Fork 0
Go to file
Aaron Fischer 6c9e57c226 Merge pull request 'dockerize' (#1) from dockerize into master
Reviewed-on: #1
2021-11-16 23:54:16 +01:00
.build.yml Add minimal CI build 2021-05-14 09:58:38 +02:00
.gitignore Refactor, read configuration from file 2020-05-03 09:57:05 +02:00
Dockerfile Add minimal Dockerfile and docker-compose 2021-11-16 23:49:28 +01:00
LICENSE Add LICENSE (GPLv3) 2020-05-03 10:27:17 +02:00
README.md Add CI badge, contact. 2021-05-14 10:00:30 +02:00
config.toml.sample Allow HTTP listen address configuration 2020-05-03 11:01:04 +02:00
docker-compose.yml Add minimal Dockerfile and docker-compose 2021-11-16 23:49:28 +01:00
go.mod Fix the go.mod and add the go.sum 2021-11-16 23:48:24 +01:00
go.sum Fix the go.mod and add the go.sum 2021-11-16 23:48:24 +01:00
main.go Display name label on matrix notification 2020-05-04 08:58:49 +02:00
mock-webhook.sh Properly handle incoming hooks 2020-05-03 08:54:18 +02:00

README.md

matrix-alertmanager-receiver

builds.sr.ht status

Simple daemon - less than 150 lines of Go - forwarding prometheus-alertmanager events to matrix room. While there already is a matrix-alertmanager project out there, use of the JavaScript ecosystem made it rather painful to use from my point of view.

Feel free to directly send me patches and questions by email.

Build

Make sure you have Go installed (golang-bin package on Fedora).

go build -v

Usage

Note: you are supposed to expose this service via a proxy such as Nginx, providing basic HTTP authentication.

I (master|✚1) ~/W/f/matrix-alertmanager-receiver » ./matrix-alertmanager-receiver --help
Usage of ./matrix-alertmanager-receiver:
  -config string
    	Path to configuration file (default "/etc/matrix-alertmanager-receiver.toml")
I [2] (master|✚1) ~/W/f/matrix-alertmanager-receiver » cat config.toml
Homeserver = "https://staging.matrix.ungleich.cloud"
TargetRoomID = "!jHFKHemgIAaDJekoxN:matrix-staging.ungleich.ch"
MXID = "@fnux:matrix-staging.ungleich.ch"
MXToken = "secretsecretsecret"
HTTPPort = 9088
HTTPAddress = ""
I (master|✚1) ~/W/f/matrix-alertmanager-receiver » ./matrix-alertmanager-receiver -config config.toml
2020/05/03 10:50:47 Reading configuration from config.toml.
2020/05/03 10:50:47 Connecting to Matrix Homserver https://staging.matrix.ungleich.cloud as @fnux:matrix-staging.ungleich.ch.
2020/05/03 10:50:47 @fnux:matrix-staging.ungleich.ch is already part of !jHFKHemgIAaDJekoxN:matrix-staging.ungleich.ch.
2020/05/03 10:50:47 Listening for HTTP requests (webhooks) on :9088
2020/05/03 10:50:55 Received valid hook from [::1]:44886
2020/05/03 10:50:55 > FIRING instance example1 is down