Repository navigation
Backlog
Description
Before building this, I would like your view on the shape. A working prototype exists (backend and tests, no screen); I can open it as a draft pull request if that helps.
The problem
This server already raises warnings: a joined computer offline, a disk nearly full, a machine running hot, a restart or security updates waiting, failed services. They are only visible with the app open. Someone running a server at home finds out a disk filled up when something breaks.
Proposal
Let the owner choose one place alerts are sent, off by default:
- ntfy: a topic address (ntfy.sh or their own ntfy server). Plain text, with a title and priority.
- Webhook: any address. JSON with each alert's id, kind, severity, machine and message.
The alerts are the ones swarm.alerts already produces. Nothing new is measured.
Rules the prototype follows
- Off until chosen. Nothing leaves the server until the owner sets a destination.
- Owner only. The address can hold a secret topic or token, so only its host is ever shown back, and the settings file is
0600. - https, or home network.
http://is accepted only for a private or loopback address. - No redirects. A redirect is refused, not followed.
- Each alert once. It is sent when it appears and not again while it lasts. A cleared alert can be sent too, if asked for.
- At most one message a minute, with new alerts batched.
- A failed send is retried at the next check; the alert is kept until a send works.
- A Test button sends one message so the owner sees it arrive.
- Text from a machine can't add headers or lines. Control characters are stripped.
Questions for the maintainers
- Where does it live? My guess is Settings, next to Security, as one row: "Send alerts to…". It is a setting of this server, not a machine reading.
- Which alerts? The prototype sends warning and critical by default and leaves info (updates waiting) out. Is that the right line?
- This server's own readings.
swarm.alertscovers joined computers. This server's disk, heat and posture (Machines: this server shows its own restart, failed-service and port readings #1193) would need adding to the same list. Same change or a later one? - One destination or several? The prototype has one. Is that enough to start?
- Email. Left out on purpose: it needs an SMTP account and password stored on the server. ntfy and a webhook cover it for people who want email.
- MODC Connect. Should alerts ever go out through the Connect tunnel instead? The prototype talks to the address directly.
What the prototype has been through
- 9 tests against a real HTTP receiver on this machine. Off by default, once-only sending, the one-a-minute limit, cleared alerts, retry after a failure, a refused redirect, address checks, header injection, and a damaged settings file.
- A live run through a real backend over HTTP: signed out is refused (401), the owner sets an ntfy address, presses Test, and the message arrives at the receiver.
- Not built: any screen. Not tested: against the real ntfy.sh, or on an Omarchy machine.
Metadata
Metadata
Assignees
Labels
No labels
Activity