Stages 86–94 — The background daemon

Stages 86–94 — The background daemon An architecture diagram generated by Archify. Telegram · paired chat · /sessions · Architecture component Telegram paired chat · /sessions Scripts · apps · curl · dashboards · Architecture component Scripts · apps curl · dashboards dave daemon … · status · token · pin · Architecture component dave daemon … status · token · pin Channel broker · one poller · nonce routing · Daemon (one per user) Channel broker one poller · nonce routing Loopback API · 127.0.0.1 · tokens · SSE · Daemon (one per user) · off by default Loopback API 127.0.0.1 · tokens · SSE off by default daemon folder · tokens · watermark · targets · Daemon (one per user) daemon folder tokens · watermark · targets Control socket · daemon.sock · same user · Daemon (one per user) Control socket daemon.sock · same user systemd · launchd · install · restart on failure · Architecture component systemd · launchd install · restart on failure Session hosts · one process each · port · Architecture component Session hosts one process each · port Supervisor · adopt · restart · resume · Daemon (one per user) Supervisor adopt · restart · resume updates HTTP · token ops dave daemon run tokens chat ↔ session port ops retry · stop spawn · restart · adopt Daemon (one per user) Legend Frontend Backend Database Security

One owner

  • • One daemon per user, held by a flock
  • • It owns the one Telegram poller and the API
  • • A host with no daemon behaves as before

Trust

  • • Remote answers are bounded by a ceiling, once by default
  • • A token's ceiling can only lower the chat's
  • • Tokens are hashed; the secret is shown once

Survives

  • • Hosts outlive the daemon; the next one adopts them
  • • A killed host restarts with a note, then gives up
  • • After a reboot the live sessions start again
  • • Accepted queues and receipts persist; uncertain effects are reported