Package: matrix-webhook
Matrix WebhookPost a message to a matrix room with a simple HTTP POSTInstallpython3 -m pip install matrix-webhook
# OR
docker pull nim65s/matrix-webhookStartCreate a matrix user for the bot, and launch this app with the following arguments and/or environment variables
(environment variables update defaults, arguments take precedence):matrix-webhook -h
# OR
python -m matrix_webhook -h
# OR
docker run --rm -it nim65s/matrix-webhook -husage: python -m matrix_webhook [-h] [-H HOST] [-P PORT] [-u MATRIX_URL] -i MATRIX_ID (-p MATRIX_PW | -t MATRIX_TOKEN) -k API_KEY [-v]

Configuration for Matrix Webhook.

options:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  host to listen to. Default: `''`. Environment variable: `HOST`
  -P PORT, --port PORT  port to listed to. Default: 4785. Environment variable: `PORT`
  -u MATRIX_URL, --matrix-url MATRIX_URL
                        matrix homeserver url. Default: `https://matrix.org`. Environment variable: `MATRIX_URL`
  -i MATRIX_ID, --matrix-id MATRIX_ID
                        matrix user-id. Required. Environment variable: `MATRIX_ID`
  -p MATRIX_PW, --matrix-pw MATRIX_PW
                        matrix password. Either this or token required. Environment variable: `MATRIX_PW`
  -t MATRIX_TOKEN, --matrix-token MATRIX_TOKEN
                        matrix access token. Either this or password required. Environment variable: `MATRIX_TOKEN`
  -k API_KEY, --api-key API_KEY
                        shared secret to use this service. Required. Environment variable: `API_KEY`
  -v, --verbose         increment verbosity levelDevpoetry install
# or python3 -m pip install --user markdown matrix-nio
python3 -m matrix_webhookProdAdocker-compose.ymlis provided:UseTraefikon thewebdocker network, eg. withproxyta.netPut the configuration into a.envfileConfigure your DNS for${CHATONS_SERVICE:-matrixwebhook}.${CHATONS_DOMAIN:-localhost}docker-compose up -dHealthcheckFor load balancers which require a healthcheck endpoint to validate the availability of the service, the/healthpath can be used.
The endpoint will return aHTTP 200status and a json document.To the Healthcheck endpoint with Traefik and docker-compose, you can add:services:bot:labels:traefik.http.services.matrix-webhook.loadbalancer.healthcheck.path:/healthTest / Usagecurl -d '{"body":"new contrib from toto: [44](http://radio.localhost/map/#44)", "key": "secret"}' \
  'http://matrixwebhook.localhost/!DPrUlnwOhBEfYwsDLh:matrix.org'(or localhost:4785 without docker)For GithubAdd a JSON webhook with?formatter=github, and put theAPI_KEYas secretFor GrafanaAdd a webhook with an URL ending with?formatter=grafana&key=API_KEYFor GitlabAt a group level, Gitlab does not permit to setup webhooks. A workaround consists to use Google
Chat or Microsoft Teams notification integration with a custom URL (Gitlab does not check if the url begins with the normal url of the service).Google ChatAdd a Google Chat integration with an URL ending with?formatter=gitlab_gchat&key=API_KEYMicrosoft TeamsAdd a Microsoft Teams integration with an URL ending with?formatter=gitlab_teams&key=API_KEYTest room#matrix-webhook:tetaneutral.netUnit testsdocker-compose -f test.yml up --exit-code-from tests --force-recreate --build