1
0
Fork
You've already forked diverapusher
0
No description
  • Python 98.7%
  • Dockerfile 1.3%
2026年02月27日 14:31:20 +01:00
diverapusher Revert "import: asyncio into diverapusher/callbacks/base.py" 2026年02月27日 14:25:58 +01:00
tests test: test obtaining handler with no callback definition set 2026年02月27日 12:38:51 +01:00
compose.yml add config volume to compose.yml 2026年01月24日 19:48:02 +01:00
Dockerfile specify the default config location 2026年01月24日 19:40:23 +01:00
LICENSE license: add AGPLv3 license 2026年01月14日 08:54:24 +01:00
pyproject.toml dep: update divera-python to v0.9.6 2026年02月27日 14:20:58 +01:00
README.md readme: start section explaining how to restrict callbacks to only be run for certain models 2026年02月27日 14:31:20 +01:00

Divera Pusher

Forward notifications from your alerting service to your favorite push service in real time.

Setup

Build the container image

This repo provides a Dockerfile which can be used to build a container image.

Docker

docker compose build

Podman

podman compose build

Run the setup script

If you use docker or podman you need to prefix the command with docker compose run divera-pusher or podman compose run divera-pusher

poetry run setup

You will be prompted for the url to your divera instance and your access token.

The access token might also be labeled as accesskey or debug token and can be found in your divera settings in the debug section.

Warning

Be very careful with this access token. It cannot be changed and might therefor be even more critical than your password.

Configuration

These are example configs to help you get started modifying your own config located at ~/.config/divera-pusher/diverapusher.json. Please take a look at the chapter down below for more info on how to do configuration.

Forward status changes to your phone using unifiedpush

Requires:

The url for the following example can be obtained by adding a notification channel from within NextPush and copying its url to the clipboard.

{
 "handlers": [
 {
 "trigger": "divera.triggers.socketevents.UserStatusChange",
 "callback": {
 "path": "diverapusher.callbacks.unifiedpush.UserStatusChanged",
 "kwargs": {
 "url": "https://<your.nextcloud.com>/index.php/apps/uppush/push/<your topic>",
 "template": "Status set: {{ status.name }}"
 }
 }
 }
 ],
 "logging": {
 "format": "{asctime} - {levelname} - {message}",
 "style": "{",
 "level": "INFO"
 }
}

Run

If you use docker or podman you need to prefix the command with docker compose run divera-pusher or podman compose run divera-pusher .

poetry run diverapusher

More on config

Model specific callbacks

If the trigger object has an object attribute set, you can restrict the handler to only act if type(trigger.object) matches any item in a given definition.

Unrestricted:

{
 "handlers": [
 {
 "trigger": "divera.triggers.ObjectCreated",
 ...
 }
 ]
}

Restricted to only be called for divera.Alarm objects:

{
 "handlers": [
 {
 "trigger": {
 "trigger": "divera.triggers.ObjectCreated",
 "filter": [
 "divera.Alarm"
 ]
 },
 ...
 }
 ]
}