Add Telegram and Pushover as notification channels
Both send to one fixed address each (api.telegram.org, api.pushover.net), take part in routing rules and the channel count, have a Send test that shows the service's own refusal, and keep their tokens and keys encrypted and out of errors and the audit log. A Telegram message carries one button, and a Pushover message one link, to the page where an alert can be acknowledged, silenced or snoozed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f366c37de
commit
31f4debb9a
22 files changed
+670
-37
No files matched your search
+20
-3
@@ -2,14 +2,14 @@
|
||||
|
||||
Every notification in Homelab Manager is sent through the same pipe
|
||||
(`server/src/services/notify.ts`) to whichever channels are enabled under
|
||||
**Settings → Notifications**: Gotify, ntfy, SMTP (email), a generic
|
||||
JSON webhook, and push to phones and browsers. All five fire for every notification below unless a
|
||||
**Settings → Notifications**: Gotify, ntfy, Telegram, Pushover, SMTP (email), a generic
|
||||
JSON webhook, and push to phones and browsers. All seven fire for every notification below unless a
|
||||
**routing rule** (see *Who hears what* below) says otherwise; each event also has its on/off toggle and, for the
|
||||
daily ones, one shared time/timezone.
|
||||
|
||||
The settings page has four tabs, with one Save button for all of them (it
|
||||
shows "Unsaved changes" until you save, and the browser asks before the page
|
||||
is closed with changes unsaved): **Channels** (the five channels, each a row
|
||||
is closed with changes unsaved): **Channels** (the seven channels, each a row
|
||||
you open to fill in and send a test), **What to send** (the event toggles
|
||||
grouped by topic, each group's thresholds beside its switches), **Who hears what** (routing rules and escalation) and **When**
|
||||
(the time zone, the daily reminder time, quiet hours and the weekly digest).
|
||||
@@ -76,6 +76,21 @@ the same way. For routing they count as *Monitoring* (a check that fails) and *E
|
||||
server holds them back. A **restore test** that fails, or one that is overdue (when a limit is set), is on the Alerts page and in the incident record but is not sent as a
|
||||
notification of its own — it is something to look at when you are looking at backups.
|
||||
|
||||
## Telegram and Pushover
|
||||
|
||||
Two more ways to a phone, for those who already live in one of them. Both are services with one address each (`api.telegram.org`, `api.pushover.net`), so nothing typed into the settings decides where a message is sent. Each has its own *Send test* in
|
||||
**Settings → Notifications → Channels**, which sends with what is typed there (saved or not) and shows what the service said if it refuses.
|
||||
|
||||
**Telegram** sends through a bot of your own, to one chat. Make the bot by messaging [@BotFather](https://t.me/BotFather) (`/newbot`) and paste its token; the chat id is a number (a group's is negative) or `@yourchannel` — send the bot a message (or add it to the
|
||||
group or channel and post there), then open `https://api.telegram.org/bot<token>/getUpdates` and read `"chat":{"id":…}`. A bot cannot message a person who has not written to it first. The message is the title, a blank line and the text, as plain text
|
||||
(nothing in it is read as formatting), cut to Telegram's 4096-character limit. *Send silently* sends without a sound or a buzz.
|
||||
|
||||
**Pushover** needs an application token (pushover.net → *Create an Application/API Token*) and your user key (or a group's), both from your Pushover account; a device name limits it to one of your devices. **Priority** runs from *lowest* (no
|
||||
notification) to *emergency*, which repeats every minute for an hour until it is acknowledged in the Pushover app. The message is cut to Pushover's 1024 characters and the title to 250.
|
||||
|
||||
The token and the keys are stored encrypted with the same key as the other credentials, and are never put in an error message or the audit log (a change to them is recorded as the field's name). A message that is refused is logged with what the service
|
||||
said; it never stops the other channels. Both take part in routing rules like any channel.
|
||||
|
||||
## Push to a phone or browser
|
||||
|
||||
The fifth channel, **Phone and browser**, sends the same messages as the others to browsers that have asked for them — a phone with
|
||||
@@ -208,6 +223,8 @@ that ended, and the escalation reminder — can be acted on from the message:
|
||||
|---|---|---|
|
||||
| **ntfy** | Three buttons (*Acknowledge*, *Silence 1 h* — only when the alert is about something a window can silence — and *Snooze*) that POST to the alert's own link, and a tap that opens the page | One button, *Choose what to do*, to a page that lists them |
|
||||
| **Phone and browser push** | Two buttons on the notification itself (*Acknowledge*, *Silence 1 h*); a press sends it and shows how it went. A tap opens the Alerts page | A tap opens the Alerts page |
|
||||
| **Telegram** | One button under the message, *Acknowledge, silence or snooze*, that opens the page. (If Telegram will not take the button's address — one on a private network, say — the link is added to the text instead) | The same |
|
||||
| **Pushover** | The link is attached to the message (*Acknowledge, silence or snooze*), and a tap opens the page | The same |
|
||||
| **Gotify** | The link is added to the text, and a tap opens the page | The same |
|
||||
| **Email**, **the chat webhook**, an escalation's extra address | The link, as a last line of the text | The same |
|
||||
|
||||
|
||||
Reference in new issue
Block a user