Add support for Gotify notifications (#346)

This adds support for Gotify (https://gotify.net) notifications.

Work items:

* Two flags have been added to internal/flags/flags.go:
  "notification-gotify-url" and "notification-gotify-token".

* A Gotify notification driver has been added in
  notifications/gotify.go.

* "gotify" has been added to notification driver choices in
  notifications/notifier.go.

* Docs have been updated
This commit is contained in:
Luka Peschke 2019-07-22 21:17:54 +02:00 committed by Simon Aronsson
parent d744b5ddf7
commit dff16dc639
4 changed files with 131 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# Notifications
Watchtower can send notifications when containers are updated. Notifications are sent via hooks in the logging system, [logrus](http://github.com/sirupsen/logrus).
@ -7,6 +7,7 @@ The types of notifications to send are passed via the comma-separated option `--
- `email` to send notifications via e-mail
- `slack` to send notifications through a Slack webhook
- `msteams` to send notifications via MSTeams webhook
- `gotify` to send notifications via Gotify
## Settings
@ -90,3 +91,18 @@ docker run -d \
-e WATCHTOWER_NOTIFICATION_MSTEAMS_USE_LOG_DATA=true \
containrrr/watchtower
```
### Gotify
To push a notification to your Gotify instance, register a Gotify app and specify the Gotify URL and app token:
```bash
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=gotify \
-e WATCHTOWER_NOTIFICATION_GOTIFY_URL="https://my.gotify.tld/" \
-e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN="SuperSecretToken" \
containrrr/watchtower
```