mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 07:41:27 +00:00
feat(notifications): ntfy/Gotify push channels with live delivery (#69)
Per-user notification_channels (ntfy + Gotify): every
insertUserNotification now fans out best-effort to enabled channels —
deployment/backup/security/agent alerts reach the user's phone via the
ntfy app with zero extra infrastructure.
- POST/GET/DELETE /notifications/channels + POST .../:id/test which
pushes a real probe so misconfiguration surfaces before alerts depend
on it (502 DELIVERY_FAILED on endpoint errors).
- ntfy: POST to endpoint (topic in path), Title/Tags headers, optional
Bearer token. Gotify: POST {endpoint}/message?token=...
- Delivery is best-effort by design — a dead relay never breaks the
producing flow; one shared 5s-timeout client.
- CLI `notifications channels list|add|test|remove`, MCP tools,
OpenAPI paths + NotificationChannel schema.
- Web settings "Push notifications" section and a Push channels card on
the mobile notifications tab (add/test/remove).
Verified live: channel CRUD, test-ping hit a recording endpoint with
correct headers/body, and a real deployment fanned out "Deployment
succeeded" through the channel end-to-end.
Generated with [Devin](https://devin.ai)
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
60145f7b21
commit
9243d020cc
19 files changed
+1261
-6
No files matched your search
@@ -2474,6 +2474,114 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MessageResponse'
|
||||
|
||||
/notifications/channels:
|
||||
get:
|
||||
tags:
|
||||
- Notifications
|
||||
summary: List push notification channels (ntfy/Gotify)
|
||||
security:
|
||||
- bearerAuth: []
|
||||
responses:
|
||||
'200':
|
||||
description: Channel list
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
channels:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/NotificationChannel'
|
||||
post:
|
||||
tags:
|
||||
- Notifications
|
||||
summary: Add a push notification channel
|
||||
description: ntfy endpoint should include the topic (e.g. https://ntfy.example.com/my-alerts); Gotify endpoint is the server base URL with the app token in `token`.
|
||||
security:
|
||||
- bearerAuth: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [kind, endpoint]
|
||||
properties:
|
||||
kind:
|
||||
type: string
|
||||
enum: [ntfy, gotify]
|
||||
endpoint:
|
||||
type: string
|
||||
format: uri
|
||||
token:
|
||||
type: string
|
||||
description: ntfy access token (Bearer) or Gotify app token
|
||||
responses:
|
||||
'201':
|
||||
description: Channel created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
channel:
|
||||
$ref: '#/components/schemas/NotificationChannel'
|
||||
'400':
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
/notifications/channels/{id}:
|
||||
delete:
|
||||
tags:
|
||||
- Notifications
|
||||
summary: Delete a push notification channel
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
'200':
|
||||
description: Deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MessageResponse'
|
||||
'404':
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
/notifications/channels/{id}/test:
|
||||
post:
|
||||
tags:
|
||||
- Notifications
|
||||
summary: Send a test notification through a push channel
|
||||
security:
|
||||
- bearerAuth: []
|
||||
parameters:
|
||||
- name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
responses:
|
||||
'200':
|
||||
description: Test delivered
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/MessageResponse'
|
||||
'502':
|
||||
description: Push delivery failed
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
|
||||
# Outbound Webhooks
|
||||
/webhooks:
|
||||
get:
|
||||
@@ -8158,6 +8266,24 @@ components:
|
||||
unread:
|
||||
type: integer
|
||||
|
||||
NotificationChannel:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
kind:
|
||||
type: string
|
||||
enum: [ntfy, gotify]
|
||||
endpoint:
|
||||
type: string
|
||||
format: uri
|
||||
enabled:
|
||||
type: boolean
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
OutboundWebhook:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in new issue
Block a user