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:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func Offline(endpoint string) *protocol.SystemStatus {
|
||||
s := &protocol.SystemStatus{Server: protocol.ServiceStatus{Health: "unreachable"}, Ntfy: protocol.ServiceStatus{Health: "unknown (server unavailable)"}}
|
||||
s := &protocol.SystemStatus{Server: protocol.ServiceStatus{Health: "unreachable"}}
|
||||
if u, err := url.Parse(endpoint); err == nil {
|
||||
s.Server.Port = u.Port()
|
||||
}
|
||||
@@ -41,30 +41,7 @@ func ServerLines(s *protocol.SystemStatus) []string {
|
||||
return lines
|
||||
}
|
||||
|
||||
func NtfyLines(s *protocol.SystemStatus) []string {
|
||||
if s == nil {
|
||||
return []string{"Checking ntfy…"}
|
||||
}
|
||||
lines := []string{"Status: " + s.Ntfy.Health}
|
||||
if s.Ntfy.URL != "" {
|
||||
lines = append(lines, "Server: "+s.Ntfy.URL)
|
||||
}
|
||||
if s.Topic != "" {
|
||||
lines = append(lines, "Topic: "+s.Topic)
|
||||
}
|
||||
if s.NtfyUser != "" {
|
||||
lines = append(lines, "Login: "+s.NtfyUser, "Use the password set during installation.")
|
||||
}
|
||||
if s.Ntfy.Health == "not configured" {
|
||||
lines = append(lines, "The connected Pipelines server has no ntfy publishing configuration.", "For Docker: check docker compose port pipelines 8080.", "Connect the TUI to that port; check --url / PIPELINES_URL.", "If this is the intended server: run ./install there.")
|
||||
} else if s.Ntfy.Health == "unreachable" || s.Ntfy.Health == "unhealthy" {
|
||||
lines = append(lines, "On the server: docker compose logs ntfy")
|
||||
}
|
||||
return lines
|
||||
}
|
||||
|
||||
// The human view has exactly two focused sections. --json retains full data.
|
||||
// The human view is one focused section. --json retains full data.
|
||||
func Lines(s *protocol.SystemStatus) []string {
|
||||
lines := append([]string{"Pipelines server"}, ServerLines(s)...)
|
||||
return append(append(lines, "", "ntfy"), NtfyLines(s)...)
|
||||
return append([]string{"Pipelines server"}, ServerLines(s)...)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package statusview
|
||||
|
||||
import (
|
||||
"git.a-wan.net/alan/pipelines/internal/protocol"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestOfflineStatusIncludesBothServicesAndRedactsURLCredentials(t *testing.T) {
|
||||
func TestOfflineStatusShowsTheServerAndRedactsURLCredentials(t *testing.T) {
|
||||
s := Offline("ws://user:password@localhost:8080/connect?token=secret#secret")
|
||||
text := strings.Join(Lines(s), "\n")
|
||||
for _, secret := range []string{"password", "token=", "secret", "user:"} {
|
||||
@@ -14,18 +13,12 @@ func TestOfflineStatusIncludesBothServicesAndRedactsURLCredentials(t *testing.T)
|
||||
t.Fatal("credentials exposed", text)
|
||||
}
|
||||
}
|
||||
for _, expected := range []string{"Pipelines server", "unreachable", "ntfy", "unknown (server unavailable)", "8080"} {
|
||||
for _, expected := range []string{"Pipelines server", "unreachable", "8080"} {
|
||||
if !strings.Contains(text, expected) {
|
||||
t.Fatal("missing offline information", expected, text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnconfiguredNtfyExplainsConnectedServerAndEndpointMismatch(t *testing.T) {
|
||||
text := strings.Join(NtfyLines(&protocol.SystemStatus{Ntfy: protocol.ServiceStatus{Health: "not configured"}}), "\n")
|
||||
for _, want := range []string{"connected Pipelines server", "docker compose port pipelines 8080", "--url / PIPELINES_URL"} {
|
||||
if !strings.Contains(text, want) {
|
||||
t.Fatal("missing endpoint diagnosis", want, text)
|
||||
}
|
||||
if strings.Contains(strings.ToLower(text), "ntfy") {
|
||||
t.Fatal("status still describes ntfy", text)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user