Phin Tech docs Rabbit Ears Manager in the store →

Antenna Tower can run on Linux, managed from a web page


status: proposed #

Antenna Tower can run on Linux, managed from a web page

Antenna Tower, the station's server (ADR 0002), runs only on a Mac: it's built by Xcode from Sources/Shared and the Manager's server files, it keeps its keys in the Keychain and advertises with Bonjour, and the station can only be changed from a Mac Manager or the phone. We want it to be able to run on a Linux box in the homelab as well, and to be managed there from a browser.

Settings no longer need iCloud: they come from the server and its R2 mirror (ADR 0001). That was the one thing only an Apple device could do, so nothing Apple-only stands in the way any more. The plan and its stages are in docs/linux-server.md.

Decisions #

  1. One server, two builds. The same Swift sources build Antenna Tower for the Mac (as now, in the Manager) and for Linux (a SwiftPM executable, in a container). There's no separate Linux rewrite.

  2. The server's code moves into a package (StationServer in Packages/RetroRelay). This amends ADR 0002 decision 2: Linux can't build an Xcode target, so RemoteServer, StationMirror, VODLibrary, OnDemandCatalog, OnDemandTagger, EventScan and the event jobs move out of Sources/, as each one is touched. The Mac's Antenna Tower links the package and works as before.

  3. Platform services sit behind small protocols, with a Mac and a Linux version of each:

    • secrets: the Keychain on the Mac, a 0600 file (or environment) on Linux;
    • advertising: NetService on the Mac, avahi-publish started as a child process on Linux. Avahi speaks the same mDNS/DNS-SD as Bonjour, so the screens' NWBrowser finds it unchanged;
    • logging: os.Logger on the Mac, stderr on Linux;
    • the run loop and "start at login": launchd on the Mac, the container's restart policy on Linux.
  4. The web Manager is a client like any other. The browser joins with a pairing code, like a Mac Manager, and gets a device key with a manager profile. It's kept in an HttpOnly cookie. Every change goes through the same /v1/admin API, ledger and merge. There's no second way in.

  5. Pages are rendered by the server (Hummingbird with Mustache templates, and htmx for small updates). There's no JavaScript build in a Swift repo, and the pages share the server's types.

  6. No stream preview on the web. The Mac Manager keeps previews and test_stream's picture. The web shows whether a stream answered, not what it shows.

  7. The assistant (MCP) and the jobs move to a control room on Linux (revised 2026-10-30; first "into Antenna Tower"). This still reverses ADR 0002 decision 6: with the server on Linux there may be no Manager running. But they go into a second headless service beside the tower, a paired Manager client, not into the tower itself: the tower stays the broadcast, which rarely changes, and the control room can be redeployed on its own. The assistant's tools are rewritten against the settings rather than the live StationModel, and the Manager's copy goes once that's done (docs/linux-server.md, stage 6).

  8. The Mac Managers keep working. They're already clients of the server, so the move to Linux doesn't wait for the web Manager.

  9. Away from home, through Cloudflare Access (2026-10-19). The tower is reached through a Cloudflare Tunnel, behind Access (Google login or an email code), on a port of its own that never trusts loopback. The apps log in through Access in a browser sheet, and our server hands the token back to the app (rabbitears://access). The server checks the Access token as well as the device key. Funnel was ruled out: it has no login in front. Tailscale stays an option for our own devices. Details are in docs/linux-server.md.

Alternatives #

Consequences #