From 33604e2a51d38e3bd1d59da9c176d06194ccd27c Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 22 Oct 2026 10:10:34 -0700 Subject: [PATCH] Keep the iPhone's name out of its tailnet hostname --- docs/iphone.md | 2 +- mac/Sources/Byre/Tailnet.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/iphone.md b/docs/iphone.md index 7eb01c2..c941e53 100644 --- a/docs/iphone.md +++ b/docs/iphone.md @@ -17,5 +17,5 @@ The simulator's window (Xcode's Device Hub) lists the app's own accessibility el ## Platform facts - CloudKit on iOS requires the `remote-notification` background mode in `Info.plist`, even though the app sets up no push of its own. -- The phone's tailnet node and `Byre-Host` take its name from `UIDevice.current.name`, which iOS reads only on the main actor (so the app delegate reads it first) and returns as just `iPhone` unless the app has the `com.apple.developer.device-information.user-assigned-device-name` entitlement. Apple grants that entitlement on request (developer.apple.com/contact/request/user-assigned-device-name); it then has to be enabled on the App ID and added to `mac/phone/byre.entitlements`. The simulator returns the simulator device's own name without it. +- The phone's tailnet node is always `byre-app-iphone`; the phone's own name stays inside byre. `Byre-Host`, which the server shows for the phone, takes its name from `UIDevice.current.name`, which iOS reads only on the main actor (so the app delegate reads it first) and returns as just `iPhone` unless the app has the `com.apple.developer.device-information.user-assigned-device-name` entitlement. Apple grants that entitlement on request (developer.apple.com/contact/request/user-assigned-device-name); it then has to be enabled on the App ID and added to `mac/phone/byre.entitlements`. The simulator returns the simulator device's own name without it. - SwiftTerm's iOS `TerminalViewDelegate` requires `requestOpenLink`, which its macOS one provides a default for. diff --git a/mac/Sources/Byre/Tailnet.swift b/mac/Sources/Byre/Tailnet.swift index 7a238f5..8633672 100644 --- a/mac/Sources/Byre/Tailnet.swift +++ b/mac/Sources/Byre/Tailnet.swift @@ -26,7 +26,11 @@ func slug(_ text: String) -> String { final class TailnetNode: Sendable { let sd: tailscale + #if os(macOS) let hostname = "byre-app-\(slug(deviceName))" + #else + let hostname = "byre-app-\(slug(deviceKind))" + #endif private let socks = TailnetProxy() init() {