Remove ntfy: notifications go only through the app notification stream
Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat tool notify, auto-switch and schedule notices), the chat push outbox (its table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*. The app_notifications stream, subscribe/clear and kinds are unchanged. Notification settings keep run_finished/chat_needs_you/chat_reply_finished; ntfy_enabled is accepted and ignored and its stored row is never read. Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to the Pipelines apps — use the stage notify hook". The notify hook remains. Installer: no ntfy build, accounts, config or supervisor child; manifest gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log, with a note in logs/install.log); uninstall cleans leftovers. App: ntfy settings section replaced by "Notification events"; texts updated. Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli, author skill references updated; security review M1 marked resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,7 +81,8 @@ type ChatShownItem struct {
|
||||
// Detail says why a notification was not delivered (or not to the phone).
|
||||
Detail string `json:"detail,omitempty"`
|
||||
// Channels says where a delivered notification went: "apps" (the
|
||||
// operator's signed-in Pipelines apps) and/or "phone" (ntfy).
|
||||
// operator's signed-in Pipelines apps). Items recorded before ntfy was
|
||||
// removed may also carry "phone".
|
||||
Channels []string `json:"channels,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,6 @@ type NotificationPolicy struct {
|
||||
Link string `json:"link,omitempty"`
|
||||
}
|
||||
|
||||
// Public phone setup only. Never include publishing endpoints or credentials.
|
||||
type NotificationEndpoint struct {
|
||||
Destination string `json:"destination"`
|
||||
ServerURL string `json:"server_url,omitempty"`
|
||||
Topic string `json:"topic"`
|
||||
}
|
||||
|
||||
type Template struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
@@ -142,56 +135,55 @@ type PipelineSummary struct {
|
||||
// are optional so older peers ignore them. See search.go for the per-type payloads
|
||||
// and the ranking/kind/bound vocabulary.
|
||||
type Message struct {
|
||||
SkillFiles []SkillFile `json:"skill_files,omitempty"`
|
||||
SkillSummaries []SkillSummary `json:"skill_summaries,omitempty"`
|
||||
SkillVersion *SkillVersion `json:"skill_version,omitempty"`
|
||||
Storage *StorageOverview `json:"storage,omitempty"`
|
||||
StoragePolicy *StoragePolicy `json:"storage_policy,omitempty"`
|
||||
StorageCleanup *StorageCleanupResult `json:"storage_cleanup,omitempty"`
|
||||
StorageCleanupToken string `json:"storage_cleanup_token,omitempty"`
|
||||
Schedule *SavedSchedule `json:"schedule,omitempty"`
|
||||
Schedules []SavedSchedule `json:"schedules,omitempty"`
|
||||
ScheduleID int64 `json:"schedule_id,omitempty"`
|
||||
ExpectedRevision int64 `json:"expected_revision,omitempty"`
|
||||
DefaultHarness string `json:"default_harness,omitempty"`
|
||||
Build *buildinfo.Info `json:"build,omitempty"`
|
||||
Protocol int `json:"protocol,omitempty"`
|
||||
DefaultModel string `json:"default_model,omitempty"`
|
||||
Evidence []SessionEvidence `json:"evidence,omitempty"`
|
||||
Usage *UsageStats `json:"usage,omitempty"`
|
||||
Status *SystemStatus `json:"status,omitempty"`
|
||||
Graph *Graph `json:"graph,omitempty"`
|
||||
ExpectedVersion int `json:"expected_version,omitempty"`
|
||||
Templates []Template `json:"templates,omitempty"`
|
||||
CreateOnly bool `json:"create_only,omitempty"`
|
||||
IncludeArchived bool `json:"include_archived,omitempty"`
|
||||
NotificationEndpoints []NotificationEndpoint `json:"notification_endpoints,omitempty"`
|
||||
Type string `json:"type"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Time string `json:"time,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Warnings []string `json:"warnings,omitempty"` // non-blocking authoring lint for validate/submit
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Digest string `json:"digest,omitempty"`
|
||||
SourcePath string `json:"source_path,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Pipelines []PipelineSummary `json:"pipelines,omitempty"`
|
||||
PipelineID int64 `json:"pipeline_id,omitempty"`
|
||||
Detail *PipelineDetail `json:"detail,omitempty"`
|
||||
RunID int64 `json:"run_id,omitempty"`
|
||||
RunDetail *RunDetail `json:"run_detail,omitempty"`
|
||||
Runs []RunSummary `json:"runs,omitempty"`
|
||||
Stage string `json:"stage,omitempty"`
|
||||
Option string `json:"option,omitempty"`
|
||||
Feedback string `json:"feedback,omitempty"`
|
||||
Input map[string]any `json:"input,omitempty"`
|
||||
AllowTools bool `json:"allow_tools,omitempty"`
|
||||
WritePaths []string `json:"write_paths,omitempty"`
|
||||
RequestKey string `json:"request_key,omitempty"`
|
||||
Workspace string `json:"workspace,omitempty"`
|
||||
SkillFiles []SkillFile `json:"skill_files,omitempty"`
|
||||
SkillSummaries []SkillSummary `json:"skill_summaries,omitempty"`
|
||||
SkillVersion *SkillVersion `json:"skill_version,omitempty"`
|
||||
Storage *StorageOverview `json:"storage,omitempty"`
|
||||
StoragePolicy *StoragePolicy `json:"storage_policy,omitempty"`
|
||||
StorageCleanup *StorageCleanupResult `json:"storage_cleanup,omitempty"`
|
||||
StorageCleanupToken string `json:"storage_cleanup_token,omitempty"`
|
||||
Schedule *SavedSchedule `json:"schedule,omitempty"`
|
||||
Schedules []SavedSchedule `json:"schedules,omitempty"`
|
||||
ScheduleID int64 `json:"schedule_id,omitempty"`
|
||||
ExpectedRevision int64 `json:"expected_revision,omitempty"`
|
||||
DefaultHarness string `json:"default_harness,omitempty"`
|
||||
Build *buildinfo.Info `json:"build,omitempty"`
|
||||
Protocol int `json:"protocol,omitempty"`
|
||||
DefaultModel string `json:"default_model,omitempty"`
|
||||
Evidence []SessionEvidence `json:"evidence,omitempty"`
|
||||
Usage *UsageStats `json:"usage,omitempty"`
|
||||
Status *SystemStatus `json:"status,omitempty"`
|
||||
Graph *Graph `json:"graph,omitempty"`
|
||||
ExpectedVersion int `json:"expected_version,omitempty"`
|
||||
Templates []Template `json:"templates,omitempty"`
|
||||
CreateOnly bool `json:"create_only,omitempty"`
|
||||
IncludeArchived bool `json:"include_archived,omitempty"`
|
||||
Type string `json:"type"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Time string `json:"time,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Warnings []string `json:"warnings,omitempty"` // non-blocking authoring lint for validate/submit
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Digest string `json:"digest,omitempty"`
|
||||
SourcePath string `json:"source_path,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Version int `json:"version,omitempty"`
|
||||
Pipelines []PipelineSummary `json:"pipelines,omitempty"`
|
||||
PipelineID int64 `json:"pipeline_id,omitempty"`
|
||||
Detail *PipelineDetail `json:"detail,omitempty"`
|
||||
RunID int64 `json:"run_id,omitempty"`
|
||||
RunDetail *RunDetail `json:"run_detail,omitempty"`
|
||||
Runs []RunSummary `json:"runs,omitempty"`
|
||||
Stage string `json:"stage,omitempty"`
|
||||
Option string `json:"option,omitempty"`
|
||||
Feedback string `json:"feedback,omitempty"`
|
||||
Input map[string]any `json:"input,omitempty"`
|
||||
AllowTools bool `json:"allow_tools,omitempty"`
|
||||
WritePaths []string `json:"write_paths,omitempty"`
|
||||
RequestKey string `json:"request_key,omitempty"`
|
||||
Workspace string `json:"workspace,omitempty"`
|
||||
// Model and StageModels are the launch-time model overrides: Model applies to
|
||||
// every model stage of the run and StageModels overrides individual stages by
|
||||
// key (per-stage wins over whole-run). Both are optional so older peers ignore
|
||||
|
||||
@@ -6,12 +6,14 @@ import (
|
||||
)
|
||||
|
||||
// Notification settings are the operator's global choices about which events
|
||||
// publish through the server's ntfy connection. A client reads them with
|
||||
// are recorded on the app notification stream (subscribe_notifications), and
|
||||
// so reach every signed-in Pipelines app. A client reads them with
|
||||
// {"type":"notification_settings"} and changes them with
|
||||
// {"type":"set_notification_settings","notification_settings":{"<key>":bool}};
|
||||
// a set may name any subset of keys, and unknown keys or non-boolean values
|
||||
// are refused. Both replies have type "notification_settings" and carry every
|
||||
// key with its stored value.
|
||||
// are refused (the removed ntfy_enabled key is accepted and ignored, so an
|
||||
// older client's switch does not fail). Both replies have type
|
||||
// "notification_settings" and carry every key with its stored value.
|
||||
const (
|
||||
GetNotificationSettings = "notification_settings"
|
||||
SetNotificationSettings = "set_notification_settings"
|
||||
@@ -23,7 +25,10 @@ const (
|
||||
NotifyRunFinished = "run_finished"
|
||||
NotifyChatNeedsYou = "chat_needs_you"
|
||||
NotifyChatReplyFinished = "chat_reply_finished"
|
||||
NotifyNtfyEnabled = "ntfy_enabled"
|
||||
// LegacyNotifyNtfyEnabled is the removed "also send to ntfy" switch. A set
|
||||
// that names it is accepted and the key ignored; a stored value is never
|
||||
// read.
|
||||
LegacyNotifyNtfyEnabled = "ntfy_enabled"
|
||||
)
|
||||
|
||||
// NotificationSettings is the typed form of the global notification choices.
|
||||
@@ -36,18 +41,14 @@ type NotificationSettings struct {
|
||||
ChatNeedsYou bool
|
||||
// ChatReplyFinished notifies when an assistant turn in a chat ends.
|
||||
ChatReplyFinished bool
|
||||
// NtfyEnabled publishes notifications to ntfy. On by default; when off the
|
||||
// server still records and streams every notification to app clients
|
||||
// (subscribe_notifications) but stops publishing to ntfy.
|
||||
NtfyEnabled bool
|
||||
}
|
||||
|
||||
// NotificationSettingKeys lists every setting key in a stable order.
|
||||
var NotificationSettingKeys = []string{NotifyRunFinished, NotifyChatNeedsYou, NotifyChatReplyFinished, NotifyNtfyEnabled}
|
||||
var NotificationSettingKeys = []string{NotifyRunFinished, NotifyChatNeedsYou, NotifyChatReplyFinished}
|
||||
|
||||
// DefaultNotificationSettings are the values before the operator changes any.
|
||||
func DefaultNotificationSettings() NotificationSettings {
|
||||
return NotificationSettings{RunFinished: false, ChatNeedsYou: true, ChatReplyFinished: false, NtfyEnabled: true}
|
||||
return NotificationSettings{RunFinished: false, ChatNeedsYou: true, ChatReplyFinished: false}
|
||||
}
|
||||
|
||||
// Map returns the wire form with every key present.
|
||||
@@ -56,7 +57,6 @@ func (s NotificationSettings) Map() map[string]any {
|
||||
NotifyRunFinished: s.RunFinished,
|
||||
NotifyChatNeedsYou: s.ChatNeedsYou,
|
||||
NotifyChatReplyFinished: s.ChatReplyFinished,
|
||||
NotifyNtfyEnabled: s.NtfyEnabled,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,14 +69,13 @@ func (s *NotificationSettings) Field(key string) *bool {
|
||||
return &s.ChatNeedsYou
|
||||
case NotifyChatReplyFinished:
|
||||
return &s.ChatReplyFinished
|
||||
case NotifyNtfyEnabled:
|
||||
return &s.NtfyEnabled
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateNotificationSettingsUpdate checks a partial update: at least one key,
|
||||
// every key known and every value a boolean.
|
||||
// every key known and every value a boolean. The legacy ntfy_enabled key is
|
||||
// dropped from the result, so an update naming only it changes nothing.
|
||||
func ValidateNotificationSettingsUpdate(update map[string]any) (map[string]bool, error) {
|
||||
if len(update) == 0 {
|
||||
return nil, fmt.Errorf("notification_settings must name at least one setting")
|
||||
@@ -89,6 +88,9 @@ func ValidateNotificationSettingsUpdate(update map[string]any) (map[string]bool,
|
||||
result := make(map[string]bool, len(update))
|
||||
var probe NotificationSettings
|
||||
for _, key := range keys {
|
||||
if key == LegacyNotifyNtfyEnabled {
|
||||
continue
|
||||
}
|
||||
if probe.Field(key) == nil {
|
||||
return nil, fmt.Errorf("unknown notification setting %q", key)
|
||||
}
|
||||
|
||||
@@ -2,12 +2,10 @@ package protocol
|
||||
|
||||
import "fmt"
|
||||
|
||||
// App notifications are the same operator notifications the server publishes
|
||||
// to ntfy, streamed over /connect so the Pipelines app can post them itself
|
||||
// without the ntfy app. Every publication point records one notification
|
||||
// (persisted, with a stable id) before it publishes to ntfy, so the stream
|
||||
// carries exactly the set ntfy gets, governed by the same notification
|
||||
// settings; notify.ntfy_enabled=false stops only the ntfy publish.
|
||||
// App notifications are the operator's notifications, streamed over /connect
|
||||
// so every Pipelines app can post them itself. Every notification point records
|
||||
// one notification (persisted, with a stable id), governed by the notification
|
||||
// settings.
|
||||
//
|
||||
// → {"type":"subscribe_notifications","id":"1","after":"run:7:3:waiting"}
|
||||
// ← {"type":"notifications_subscribed","id":"1","notifications":[{...}],"ids":["chat:ses_x:form:f1"]}
|
||||
@@ -58,8 +56,7 @@ const (
|
||||
NotificationSchedule = "schedule"
|
||||
)
|
||||
|
||||
// DefaultNotificationPriority is ntfy's default priority, which every ntfy
|
||||
// publication uses today (the server sends no Priority header).
|
||||
// DefaultNotificationPriority is the default of the 1-5 notification priority.
|
||||
const DefaultNotificationPriority = 3
|
||||
|
||||
// MaxReplayedNotifications bounds a subscribe reply and MaxClearNotificationIDs
|
||||
@@ -78,7 +75,7 @@ type AppNotification struct {
|
||||
Kind string `json:"kind"`
|
||||
Title string `json:"title"`
|
||||
Message string `json:"message"`
|
||||
// Click is the app tap target (normally the same run deep link ntfy gets).
|
||||
// Click is the app tap target (normally the run or chat deep link).
|
||||
Click string `json:"click"`
|
||||
RunClick string `json:"run_click,omitempty"`
|
||||
Artifact *NotificationArtifact `json:"artifact,omitempty"`
|
||||
|
||||
@@ -21,7 +21,6 @@ type SystemStatus struct {
|
||||
Uptime string `json:"uptime"`
|
||||
Addresses []NetworkAddress `json:"addresses"`
|
||||
Server ServiceStatus `json:"server"`
|
||||
Ntfy ServiceStatus `json:"ntfy"`
|
||||
// OpenCode reports how brokered chat is attached to OpenCode. Health is
|
||||
// "endpoint" when attached to the operator's configured endpoint,
|
||||
// "fallback" when that endpoint could not be attached and chat fell back to
|
||||
@@ -29,7 +28,5 @@ type SystemStatus struct {
|
||||
// "unavailable" when chat is disabled. URL is the configured endpoint, if
|
||||
// any. It never carries a credential.
|
||||
OpenCode ServiceStatus `json:"opencode"`
|
||||
Topic string `json:"topic,omitempty"`
|
||||
NtfyUser string `json:"ntfy_user,omitempty"`
|
||||
Note string `json:"note"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user