fc7dbb0ac0
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>
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package statusview
|
|
|
|
import (
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
"net"
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
func Offline(endpoint string) *protocol.SystemStatus {
|
|
s := &protocol.SystemStatus{Server: protocol.ServiceStatus{Health: "unreachable"}}
|
|
if u, err := url.Parse(endpoint); err == nil {
|
|
s.Server.Port = u.Port()
|
|
}
|
|
return s
|
|
}
|
|
|
|
func ServerLines(s *protocol.SystemStatus) []string {
|
|
if s == nil {
|
|
return []string{"Checking server…"}
|
|
}
|
|
lines := []string{"Status: " + s.Server.Health}
|
|
seen := map[string]bool{}
|
|
for _, address := range s.Addresses {
|
|
ip := net.ParseIP(strings.Split(address.IP, "%")[0])
|
|
if ip == nil || ip.IsLoopback() || ip.IsUnspecified() || ip.IsLinkLocalUnicast() || seen[address.IP] {
|
|
continue
|
|
}
|
|
seen[address.IP] = true
|
|
lines = append(lines, net.JoinHostPort(address.IP, s.Server.Port))
|
|
if len(seen) == 6 {
|
|
break
|
|
}
|
|
}
|
|
if len(seen) == 0 {
|
|
lines = append(lines, "LAN address unavailable.", "For Docker: rerun ./install on the server.")
|
|
}
|
|
if s.Server.Port != "" {
|
|
lines = append(lines, "Port: "+s.Server.Port)
|
|
}
|
|
return lines
|
|
}
|
|
|
|
// The human view is one focused section. --json retains full data.
|
|
func Lines(s *protocol.SystemStatus) []string {
|
|
return append([]string{"Pipelines server"}, ServerLines(s)...)
|
|
}
|