garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.31k stars 39 forks source link

Proposal: notifications hook via `containrrr/shoutrrr` #159

Closed MarvinJWendt closed 6 months ago

MarvinJWendt commented 7 months ago

Hi, I would like to use Pushover as my notification service, unfortunately it is not supported by backrest.

A possible solution would be to allow for shoutrrr hooks. shoutrrr is written in Go (and can be used as a library) and supports nearly every notification provider. The user can configure the notifications by providing a single shoutrrr URL.

Their docs: https://containrrr.dev/shoutrrr/v0.8/

For example, if I want to add Pushover notifications to backrest, I would provide this string to the shoutrrr hook:

pushover://shoutrrr:apiToken@userKey/?devices=device1[,device2, ...]

IFTTT:

ifttt://key/?events=event1[,event2,...]&value1=value1&value2=value2&value3=value3

Telegram:

telegram://token@telegram?chats=channel-1[,chat-id-1,...]

etc.

My main use-case of this would be to integrate backrest into my "critical errors" system, which is build on Pushovers critical notifications.

garethgeorge commented 7 months ago

I really like the idea of using shoutrrr, I've done a few searches in the notification service space but hadn't run across shoutrrr specifically. It looks like a really good option for supporting the long tail of notification platforms w/o hardcoding more integrations myself! I've essentially been looking for an API of this type.

I'll make support a goal with the next release.

garethgeorge commented 6 months ago

Done in https://github.com/garethgeorge/backrest/commit/fa6407cac25ed8f0a32cc9ed5fdd8454bc9abbe5