DEVELOPMENT ENVIRONMENT

~liljamo/canwa

a small API for relaying the same message to multiple services
feat: optionally render commonmark to html for matrix
fix(nix): create user in module
feat: optionally read tokens from files

refs

master
browse  log 

clone

read-only
https://git.src.quest/~liljamo/canwa
read/write
git@git.src.quest:~liljamo/canwa

You can also use your local clone with git send-email.

#canwa

A small API for relaying the same message to multiple services.

#Supported services:

Gotify gotify.net
Matrix matrix.org

#Example

The following example creates a notifier that sends a message to Gotify and Matrix.

#token fields

All token fields (service and notifier configs) can also be a path to a file containing the token, e.g. /run/secrets/canwa-matrix-token

canwa will check if the value is a path that exists and reads it if it is. If the value is not a path, or it is a path that cannot be read, it will be assumed a raw string token.

#Example canwa.toml

interface = "0.0.0.0"
port = 8080

[services.gtf_main]
type = "gotify"
instance = "https://gotify.example.com"
token = "gotify_token"

[services.mtx_main]
type = "matrix"
instance = "https://example.com"
token = "access_token"
room = "!roomid:example.com"

[notifiers.f2b]
token = "long_token_for_auth"
services = ["gtf_main", "mtx_main"]

#cURL usage:

curl -XPOST -H"Content-Type: application/json" -H"Authorization: long_token_for_auth" \
    -d'{"title": "test title", "message": "this is a message"}' \
    "http://localhost:8080/message"