Phin Tech docs Rabbit Ears Manager in the store →

The relay runs on its own, as Antenna Tower


status: accepted #

The relay runs on its own, as Antenna Tower

The relay (live feeds, the On Demand catalog and downloads, the caches, the screens' errors and reports) and the settings server with its R2 mirror run inside the Mac mini's Manager today. Quitting or updating the Manager takes them all down for the restart: an On Demand title playing anywhere loses its picture, settings pause, and the Manager is updated far more often than any of that changes.

They move into Antenna Tower, a command-line helper inside the Manager (Contents/Helpers/antenna-tower) that the Manager runs as a launchd agent: launchd starts it at login and restarts it if it stops, and the copy running isn't touched when the Manager is updated. The Manager on the Mac mini becomes a client of it, as on any other Mac.

Decisions #

  1. Swift, not Go (2026-10-18). The relay shares its wire formats, the Xtream and catalog code, the sport rules, the ledger and merge, and the R2 sealing with the apps; a second language would mean two copies kept in step. retro-relay already builds for Linux, should it move to the homelab.

  2. A helper built from the same sources, not a rewrite into the packages. Most of the server is app code on app singletons and UserDefaults (VODLibrary, RemoteServer, StationMirror, EventRefresher, OnDemandTagger). RetroTV-AntennaTower compiles Sources/Shared and the Manager's server files with a RELAY flag, and starts what the Manager's relay toggle started. Moving pieces into packages can follow, one at a time, when they're touched.

  3. Its own identity, settings and Keychain. It is tech.phin.retrotv.antenna-tower (an Info.plist in the binary), with its own UserDefaults domain and Keychain entries, so it never shares a key with the Manager (as the Mac app and the Manager briefly did, 2026-10-18).

  4. A handover, once. The Mac mini's Manager, serving the relay itself with the tower inside it, writes its settings and keys to a file only this user can read, turns its own relay off, starts the tower's agent and joins it as a client. The relay's database, station.sqlite, is in a folder both share and doesn't move.

  5. Shipped inside the Manager, run by the Manager (2026-10-19, replacing a separate app with its own release). Signed and notarized with it, so no second app ID or release; the Manager writes and loads its launchd job (AntennaTowerAgent) and offers Start, Stop and Restart. A Manager update leaves the running copy alone; a restart picks up the new one, and the player picks a title back up.

  6. The assistant (MCP) stays in the Manager: its tools drive the live station model, which only an app with the station has.

  7. The Manager can still be a server where it has no Antenna Tower inside (another household, a Mac without it): the relay toggle stays.

  8. The tower is the broadcast, the Manager is the control room (2026-10-19, Sam's rule). The tower keeps only what screens depend on: the settings server, devices and invites, the R2 copy, On Demand serving and downloads, the feeds, error intake. Jobs and logic that change often run in the control room, the Manager on the Mac running the tower (EventRefresher.isControlRoom), and send what they find to the tower like any change. So the tower rarely needs restarting, and a Manager update ships the logic. The event jobs moved first: their cadence, a refresh request and their status are station settings (eventRefreshMinutes, eventRefreshRequest, eventRefreshStatus), so "Refresh Now" from any Manager or the phone reaches the control room through the tower. The Jev key is a station setting sent to managers only. On Demand's category tagging is still in the tower, and moves next.

Consequences #

Built (2026-10-19) #