Buttons on notifications: acknowledge, silence and snooze from the message

- A switch (off by default) under Settings -> Notifications -> Who hears what
- ntfy gets buttons (three for one alert, one link for several); phone push gets two buttons handled by the service worker; Gotify, email and the chat webhook get the link as text; escalation messages carry them too
- Each link is a signed token for the alerts in that one message only, good for 24 hours, for three actions; opening it changes nothing, only a POST acts; everything is audited as "from a notification link"
- Docs updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-21 20:42:04 +02:00
1 parent 0277126add
commit aebf3c6ce1
22 files changed
+895 -28

No files matched your search

+3
View File
@@ -52,6 +52,7 @@ import { notesRouter, todosRouter } from "./routes/todos.js";
import { npmRouter } from "./routes/npm.js";
import { alertRulesRouter } from "./routes/alertRules.js";
import { storageRouter } from "./routes/storage.js";
import { alertActionsRouter } from "./routes/alertActions.js";
import { homeAssistantRouter } from "./routes/homeAssistant.js";
import { publicApiRouter } from "./routes/publicApi.js";
import { generatorRouter } from "./routes/generator.js";
@@ -92,6 +93,8 @@ export function createApp() {
app.use("/api/heartbeat", heartbeatPingRouter);
// The read API: a personal token in a header, GET only, no session and nothing for the same-origin check to protect.
app.use("/api/v1", publicApiRouter);
// What the buttons on a notification lead to: a signed token in the address, for named alerts only, no session.
app.use("/api/alert-actions", alertActionsRouter);
// Everything after this is reached with a session cookie, so a request that came from another origin is refused here.
app.use(sameOriginGuard);
app.use(express.json());