Files
ntfy/cmd
binwiederhier b0ae219486 Wire the cluster into the server
Makes clustering usable: experimental-cluster-listen is accepted now and the
startup guard is gone.

The server holds a cluster, constructs it with the callbacks it supplies (so
the cluster package never imports the server), and serves the peer API on a
dedicated private listener that the public listeners never expose. dispatch,
the one choke point every publish path goes through, hands each message to the
cluster before delivering locally. deliverFromBus publishes an inbound peer
message to the local topic and nothing else: the origin already ran Firebase,
email, web push and upstream, so a peer never re-fires them or re-relays.

/v1/health answers 503 once this node's registration has gone stale, so a load
balancer can pull it, and the cluster calls closeLocalSubscribers when this
node is isolated but a peer is healthy, so those clients reconnect elsewhere.

Two jobs become leader-only, checked per tick to survive failover. The Firebase
keepaliver has to be: one keepalive wakes every subscribed phone. The delayed
sender does not, and the comment says so, since the claim in the message cache
is what makes that safe; the gate only keeps the work on one node.

What a cluster does not do yet, each waiting for its own piece: recover a
dropped fan-out batch, enforce rate limits and quotas across nodes, share
per-topic state (UnifiedPush billing, the Matrix pushkey decision), replay
unflushed messages to a reconnecting subscriber, or relay subscriber cancels.
Hence experimental-.
2026-10-08 02:31:33 +00:00
..
2026-05-31 14:28:04 -04:00
2025-07-31 10:46:41 +02:00
2023-11-16 20:54:58 -05:00
2026-05-19 13:04:59 +02:00
2023-11-16 20:54:58 -05:00
2026-03-15 21:13:12 -04:00
2025-12-23 20:23:48 -05:00
2022-06-20 10:56:45 -04:00
2026-01-15 09:30:37 -05:00
2026-10-08 02:31:33 +00:00
2026-10-08 02:31:33 +00:00
2023-08-06 22:44:55 -06:00
2025-07-31 11:35:21 +02:00
2025-07-31 10:46:41 +02:00
2025-07-31 11:35:21 +02:00
2025-07-31 10:46:41 +02:00
2026-06-13 09:35:09 -04:00
2026-06-21 11:19:49 -04:00
2025-07-31 11:35:21 +02:00
2025-08-07 17:39:25 +02:00