feat(notifications): add a Gotify payload format to the webhook

Gotify's POST /message types priority as an integer, so the generic body, which sends the word, was refused with a 400 before the token was ever the question. The webhook card now offers a payload format: generic, which stays byte for byte what it was, and gotify, which sends title, message, an integer priority and extras.

Priorities follow the Gotify Android client's channel thresholds: 5 for routine events (audible), 8 for medication reminders (the lowest heads-up value), 10 for urgent events. The extras declare plain text and carry the event name, masked to reminder in discreet mode as the generic body does.

The choice lives in the encrypted channel config, so no migration: an absent format is generic, only gotify is written, and a save that omits the field keeps the stored choice. GET returns the resolved value. The sender comment no longer suggests an Authorization Bearer header for Gotify, which takes X-Gotify-Key or a token query parameter.

Refs #947
This commit is contained in:
Marc-André Bombeck committed 2026-09-13 14:19:48 +02:00
1 parent 92606f6409
commit fafb5cdc08
17 files changed
+556 -50

No files matched your search

+16 -1
View File
@@ -25917,6 +25917,14 @@ components:
maxLength: 500
- type: string
const: ""
format:
description: Body shape. `generic` sends HealthLog's own JSON envelope; `gotify` sends the body Gotify's `POST /message`
expects, with an integer priority. Omitted keeps the stored choice, which is `generic` for a config saved
before the choice existed.
type: string
enum:
- generic
- gotify
enabled:
type: boolean
required:
@@ -25926,7 +25934,7 @@ components:
re-checked at dispatch time; a private origin passes both only when the operator listed it in
`NOTIFICATION_PRIVATE_ORIGINS`. An EMPTY OR OMITTED `headerValue` preserves the stored one, for the same reason
as ntfy's `authToken`: the GET never returns it. There is no way to clear a stored header value through this
endpoint."
endpoint. An omitted `format` keeps the stored body shape."
DeleteAccountRequest:
type: object
properties:
@@ -57501,11 +57509,18 @@ components:
hasHeaderValue:
type: boolean
description: Whether a header value (the shared secret) is stored. The value itself is never returned.
format:
type: string
enum:
- generic
- gotify
description: Body shape the webhook sends. `generic` when no channel row exists or the config predates the choice.
required:
- enabled
- url
- headerName
- hasHeaderValue
- format
additionalProperties: false
description: Stored generic-webhook channel config, with the secret header value reduced to a presence flag.
PutWebhookSettingsResponse: