Repository navigation
Done
Labels
area: runtimeCaddy and privileged controller runtime behavior.enhancementNew feature or requestsecurityPublic security hardening or remediation; disclose vulnerabilities privately.
Milestone
Description
Phase: 6 | Priority: P0
Let apps open, update and resolve deduplicated incidents in the platform's notification engine, delivered through the existing mail and webhook channels. Monitoring needs this to keep outage notifications after RentnerProxy/app-monitoring#1, and later apps such as CrowdSec can use the same capability.
Current state
notifications.publish.v1stores rows inapp_runtime_messagesand emits an event on the app's own stream (web/src/server/AppRuntime/messages.server.ts). Nothing reaches the incident engine or mail and webhook delivery.- The built-in
host_availabilitycategory is wired tohost_check_policies: reconciliation on every collection commit and delivery claim, delivery authorization, validation and the mail template (web/src/server/Notifications/host-availability*.ts,incident-engine.ts,notification-repository.ts,web/src/server/Mail/notification-template.ts).
Scope
- A new capability for app incidents, keyed by an app-chosen incident key, with a resource reference (for example a proxy host ID), severity and plain text fields. Every call is idempotent by key.
- The engine handles app incidents generically: deduplication per installation and key, cancellation of superseded incidents, subscriptions per app category, delivery through the existing channels.
- The platform renders mail and webhook payloads from length-limited plain fields. Apps cannot inject HTML or links.
- Delivery authorization rechecks the referenced resource for each recipient (for example
PROXY_HOSTS_VIEWfor a host) and the app's grant for that resource. - Stopping or uninstalling the app resolves its open incidents with an explicit reason. After a restore, stale outage alerts are suppressed, as
pausedAfterRestoredoes today. - The built-in
host_availabilitycategory stays until the monitoring handoff commits.
Dependencies
- feat(apps): approve requested app capabilities when installing or updating #590 (grant approval flow)
Acceptance criteria
- An app with the grant can open, update and resolve an incident. Repeated and retried calls with the same key never duplicate an incident or a delivery.
- Mail and webhook channels deliver app incidents only to subscribed users who may see the referenced resource.
- App text is plain and length-limited and is rendered in platform templates.
- Disabling or uninstalling the app resolves its open incidents with an explicit reason. A restore does not replay stale outage alerts.
- Without the grant the endpoint refuses, and
notifications.publish.v1behaves as before.
Tracked by RentnerProxy/app-monitoring#1 and #460.
Use focused project checks and short integration/recovery tests. Endurance runs belong to release preparation.
Metadata
Metadata
Assignees
Labels
area: runtimeCaddy and privileged controller runtime behavior.enhancementNew feature or requestsecurityPublic security hardening or remediation; disclose vulnerabilities privately.
Activity
feat(contracts): let apps open and resolve platform notification inci…