Settings from Antenna Tower
How the station's settings and each profile's history reach every device now that
iCloud is gone. The decisions are in
ADR 0001 and
ADR 0005; the current
server is the Go tower (tower/, documented in api/README.md).
Below is the original October/November 2026 rollout plan and build log.
Plan #
1. Every device on the Mac mini #
station.sqlite.errors.sqliteis renamed into it the first time, and its schema grows the settings tables: each synced key with its value and revision, the counter and epoch, and the devices.ErrorStoreandSettingsStoreshare one list of migrations (StationDatabase).- Revisions survive a restart.
SettingsLedgerstarts from what the store has and writes every change to it; the epoch only changes if the store is new. - Managers are profiles. A profile is a manager or not (
Profile.manager; the ones from before are managers, new ones aren't until you say). - Devices. The Manager's paired Macs (
remoteClients) move into the devices table. Each device has the profiles it can use, or all of them; the Server pane lists the devices and changes their profiles. - Invites. The Server pane makes an invite for a device and the profiles it
can use: a
rabbitears://joinlink and its QR code, with the device's key and where the Mac mini is. The phone and the Mac app open it, and offer only those profiles. - Enrolling. A device that already has the relay's household token (from iCloud) enrolls itself, with every profile: this is how the Apple TVs join.
- Every app is a client.
RemoteLinkmoves into the TV and Mac apps too. Paired, settings come from the Mac mini (every three seconds) and not from iCloud. A device with a manager among its profiles sends its changes; while the Mac mini can't be reached they wait, queued, and go when it's back. One without doesn't, and hides the editing. - Queued changes merge. A queued change based on an old revision is merged three ways (what it was based on, what's there now, what this device has): lists and dictionaries gain what this device added and lose what it removed; anything else takes this device's value.
- Devices without a manager. They aren't sent the relay's address or household token, and the Mac mini refuses their setting changes.
- History. Each profile's history goes to the Mac mini and comes back from
it, the newer of two copies winning as now (
ProfileHistorySync); a device gets and sends only its own profiles'.
2. The R2 mirror #
Built 2026-10-18; see Built. Buckets rabbit-ears-settings and
rabbit-ears-outbox (Cloudflare account of sam@phin.tech, ENAM). Three R2
tokens, made with cf user tokens create and kept in 1Password (Development ›
"Rabbit Ears R2"): the Mac mini's (read and write, both buckets), the devices'
read token (settings only) and the devices' outbox token (outbox only).
- An encrypted snapshot of every setting with its revision, and one per profile's history, written to R2 when they change; devices fall back to it when the Mac mini can't be reached, checking by ETag.
- Each device's outbox in a second bucket, signed with its secret; the Mac mini drains them.
- Invites carry the R2 address, the read and outbox keys, the outbox's name and secret, and the encryption key.
3. Off iCloud #
- The Mac mini takes in what iCloud has one last time; devices that never enroll get an invite; the key-value entitlement comes out of the apps.
- A new Apple TV is set up from the phone (an invite sent over the remote's connection), since it can't open a link.
Built #
(Dated October–November 2026 Swift-tower build log; those server-side Swift
types—StationDatabase, SettingsStore, SettingsLedger, RemoteServer,
StationMirror—were later retired once Go tower/ took over the protocol in
api/README.md.)
-
2026-10-18: stage 1, untested on devices.
StationDatabase(RetroLineup) ownsstation.sqlite's schema;errors.sqliteis moved into it the first time the Manager opens it. Migration 3 addssettings,facts(the epoch) anddevices.SettingsStorekeeps the settings with their revisions and the devices with their profiles;SettingsLedgerstarts from it and writes each change to it.remoteClientsmoves intodevices, with every profile.Profile.manager(nil, from before, is a manager; profiles added since aren't), with a Manager toggle in On Demand › Profiles. A device has the profiles inProfileStore.allowedKeyand offers only those.- The server (
RemoteServer):POST enroll(the household token: every profile),GET device,GET history,GET/PUT history/<key>; setting changes, the status, commands and reports only for a device with a manager; no relay address or token for one without. The Server pane lists the devices with their profiles, makes invites (link and QR code,Invite), and still gives a Manager's pairing code. - The client (
RemoteLink, now in every app): joins by invite (rabbitears://join, opened on the phone and the Mac app), pairing code, or enrolling; polls every three seconds; queues changes the Mac mini can't take yet (remoteQueuedEdits, with what each was made to, and the server's settings inserver-settings.plist) and merges them on a conflict (AdminMerge); syncs history every fifteen seconds and when a title stops. Joined, a device leaves iCloud alone. The read-only mode and "Edit without the server" are gone. - Tested: the store, the ledger's revisions across a restart, the merge, and
the server's rules (
RemoteServerTests). Not yet: real devices joining, the queue against a real Mac mini, the Apple TVs enrolling. - Order to roll out: the Mac mini's Manager first (
just manager-release), then the apps; an app that finds an older Mac mini just doesn't enroll.
-
2026-10-18: stage 2, the R2 mirror, with the security changes (ADR decisions 15 to 17).
R2Client(RelayAdmin) signs S3 requests itself (checked against AWS's example, and live against the buckets), reads by ETag, and keeps no cache (one answered 304s itself).Sealedis AES-GCM;Mirrorhas the formats:settings/full,settings/watch(no relay address or token),history/<profile>,keys/<device>(aKeyBundlesealed with the device's secret), andoutbox/<device>in the outbox bucket.- The Mac mini (
StationMirror): keys in its Keychain (StationKeys: the three R2 keys, the sealing keys, each device's secret), taken in once fromr2-import.jsonin the Manager's folder. Every five seconds it writes the settings copies when the ledger moved, each device's key bundle when it changed; every thirty it reads the outboxes (by ETag) and takes in what's new, merging setting changes like the queue does; every minute it writes each profile's history and forgets invites unused after seven days. Forgetting a device rotates the sealing keys and deletes its bundle and outbox. Migration 4 gives devices an outbox name and an expiry. - Devices get their
MirrorAccessandKeyBundlefromGET deviceor the invite (v2), and keep them, and their key for the Mac mini, in their Keychain. Out of reach of the Mac mini, they read the settings copy every thirty seconds and history every two minutes, write what they'd queue and their history to their outbox, and let go of what the copy says was taken. A copy that won't open means new keys: they read their bundle. Back in touch, the outbox is emptied (the Mac mini gets it all directly).
-
2026-10-18: what's playing where. The live tuner and On Demand's player say what they play and from which login (
PlayingHere, the login read from the stream's address);RemoteLinktells the Mac mini when it changes and every thirty seconds while it plays (PUT playing), or, out of reach, keeps just the latest in its outbox. Nothing is saved up for later. The Mac mini holds it in memory and believes it for ninety seconds. The Server pane's devices say what each plays, with each login's devices under them; the assistant haswhats_playing. Also from this round: device management and invites from any Manager with a manager profile, and Storage showing the Mac mini's. -
2026-10-18: Manager updates don't stop On Demand. A title whose download stops (the Mac mini's relay restarting with its Manager, Wi-Fi) starts again from where it was, up to three times; with the relay away the device downloads it itself. (
just manager-releasewaited for watchers for a few hours; Antenna Tower made that moot, docs/adr/0002.GET /v1/admin/playing-now, answering only the Mac itself, is still there.) -
2026-10-19: build numbers and settings versions. Every build is numbered by when it was made (
yymmddHHMM, the justfile'sbuild_number, passed to every build and, formanager-release, throughXCODE_XCCONFIG_FILE). Each device sends its build with every check (GET settings?build=), or acheckInentry in its outbox when away, with the settings version it has (the revision it asks from). The Server pane's Devices say each one's build and settings version, and how far behind; the Relay section says the station's settings version, and when this Manager carries a newer build of Antenna Tower than the one running. -
2026-11-01: screens aren't sent the sport rules' settings. A screen asks
GET settingswithapp=screen, and the server leaves outSettingsSync.stationOnlyKeys(sportSettings,eventSchedules,sportSchedule,sportJudged,sportGuides): they're what the jobs read, and a screen plays thechannelSchedulesthey produced. The R2watchsnapshot leaves them out too;fullhas them, so a phone with a manager profile still reads them there. iCloud, until it goes, sends them all.
Phin Tech docs
Rabbit Ears Manager in the store →