mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Add a Matrix example to notifications.md
Why: I spent a few hours to get it setup right as I didn't understand what shoutrr was. This might help others as well in the future. Example: https://lemmy.world/comment/928893
This commit is contained in:
parent
787ce72ffd
commit
30e35f38cf
1 changed files with 18 additions and 0 deletions
|
|
@ -45,6 +45,24 @@ Simple templates are used unless the `notification-report` flag is specified:
|
|||
|
||||
- `--notification-report` (env. `WATCHTOWER_NOTIFICATION_REPORT`): Use the session report as the notification template data.
|
||||
|
||||
### Matrix Template
|
||||
|
||||
To send notifications via matrix, the following command-line options, or their corresponding environment variables, should be set:
|
||||
|
||||
- `--notification-url` (env. `WATCHTOWER_NOTIFICATION_URL`): The matrix service URL to be used.
|
||||
- `--notification-template` (env. `WATCHTOWER_NOTIFICATION_TEMPLATE`): The format to be used for notifications.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name watchtower \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e WATCHTOWER_NOTIFICATION_URL=matrix://username:password@domain.org/?rooms=!ROOMID:domain.org \
|
||||
-e WATCHTOWER_NOTIFICATION_TEMPLATE="{{range .}}[WatchTower] ({{.Level}}): {{.Message}}{{println}}{{end}}" \
|
||||
containrrr/watchtower
|
||||
```
|
||||
|
||||
## Simple templates
|
||||
|
||||
The default value if not set is `{{range .}}{{.Message}}{{println}}{{end}}`. The example below uses a template that also
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue