mirror of
https://github.com/fankes/beszel.git
synced 2025-10-18 17:29:28 +08:00
Add support for alerts via shoutrrr (#145)
* Add support for alerts via shoutrrr This provides users the ability to use a wide variety of notification platforms instead of just email. If there's a problem sending a notification via shoutrrr, an error is logged and email is attempted as a fallback. Since this uses Viper, users can set a notification type and URL via either a config file or environment variable. In the beszel_data folder (where the sqlite dbs reside), create an alerts.env file to set values that way. Values: * NOTIFICATION_TYPE * If this is `shoutrrr`, then the shoutrrr library is used. Any other value, including not being set, uses the fallback email behavior. * NOTIFICATION_URL * If NOTIFICATION_TYPE is shoutrrr, this is the URL given to shoutrrr to send the alert. See list of supported services: https://containrrr.dev/shoutrrr/services/overview/ Note: there's currently a bug in viper v1.18.2+ where environment variable overrides aren't functioning when no config file exists, so this library should remain pinned to 1.18.1 until that's fixed. See: https://github.com/spf13/viper/issues/1895 * Update documentation * Log shoutrrr URL instead of unused "to" var
This commit is contained in:
17
readme.md
17
readme.md
@@ -98,9 +98,11 @@ Use `./beszel update` and `./beszel-agent update` to update to the latest versio
|
||||
|
||||
### Hub
|
||||
|
||||
| Name | Default | Description |
|
||||
| ----------------------- | ------- | -------------------------------- |
|
||||
| `DISABLE_PASSWORD_AUTH` | false | Disables password authentication |
|
||||
| Name | Default | Description |
|
||||
| ----------------------- | ------- | --------------------------------------- |
|
||||
| `DISABLE_PASSWORD_AUTH` | false | Disables password authentication |
|
||||
| `NOTIFICATION_TYPE` | "" | Defines which notification type to use. |
|
||||
| `NOTIFICATION_URL` | "" | Notification URL to use for shoutrrr. |
|
||||
|
||||
### Agent
|
||||
|
||||
@@ -203,6 +205,15 @@ Users can create their own systems and alerts. Links to PocketBase settings are
|
||||
|
||||
Read-only users cannot create systems but can view any system shared with them by an admin and create alerts.
|
||||
|
||||
## Alert services
|
||||
|
||||
By default, alerts are sent as emails via the built-in PocketBase service, configurable on the PocketBase Settings page.
|
||||
|
||||
[shoutrrr](https://containrrr.dev/shoutrrr) can be used instead by setting the `NOTIFICATION_TYPE` config value to `shoutrrr` and setting a valid `NOTIFICATION_URL` to [a supported service URL](https://containrrr.dev/shoutrrr/services/overview/). These values can be configured in one of two ways:
|
||||
|
||||
- From an `alerts.env` file in the `beszel_data` directory in the form of `KEY=value` lines, one per setting
|
||||
- From environment variables
|
||||
|
||||
## FAQ / Troubleshooting
|
||||
|
||||
### Agent is not connecting
|
||||
|
Reference in New Issue
Block a user