Repository navigation
Conversation
f51cec1 to
1b4ed08
Compare
|
I tried it, but connecting to the iPhone still failed. Is there anything specific about your network setup, such as needing to stay on Wi-Fi? Can you install ipa normally using only cellular data over Tailscale? |
|
I reviewed the port discovery and pairing import implementation and reproduced three issues with regression tests: unverified install-port fallback, ineffective validation-attempt limiting, and duplicate manual registrations. I prepared fixes, added regression coverage, and addressed the first-time import path so it validates against the uploaded pairing record rather than unrelated saved records. The full Go test suite, go vet, and frontend build passed. The changes are available as a focused follow-up PR against the contributor's branch: The iPhone cellular-only Tailscale scenario still needs hardware verification. |
|
I tested with this setup Server: Debian cloud VPS running tailscaled, atvloadly in Docker Devices:
$ tailscale ping 100.98.236.43
ping "100.98.236.43" timed out
$ tailscale ping --tsmp 100.98.236.43
pong from iphone-16 (100.98.236.43, 33788) via TSMP in 403ms
$ tailscale ping 100.98.236.43
pong from iphone-16 (100.98.236.43) via 172.56.188.120:41800 in 187ms So after running a --tsmp ping, it seems like the TSMP probe opened a path. But even after [WARN] app/internal/log/log.go:90> install port scan: no handshake validated on 100.98.236.43; offering the first reachable port |
|
going to run more tests to see if i can figure out why cellular data isn't working with plumesign |
|
Ok did more research, and apparently the issue is iOS will not run or expose local developer/lockdown services unless an 802.11 Wi-Fi link is active. Other apps for sideloading such as SideStore run into the same issue. The solution is to be connected to any kind of wifi network: someone's hotspot, coffee shop wifi, even a wifi network that doesn't even have internet access. It's a weird limitation from Apple but it doesn't entirely kill the purpose of this feature, since you can still pair/install/refresh from any wifi network, anywhere in the world, as long as you are connected to your atvloadly service over Tailscale and even while not in the same LAN as atvloadly. |
Tailscale and similar mesh VPNs use the RFC 6598 CGNAT range (100.64.0.0/10). Devices reachable only through an overlay network were rejected by isLanAddr because Go's netip.IsPrivate() only covers RFC 1918 space. Accept the CGNAT range alongside private IPv4 addresses.
Devices reachable only through a mesh VPN (Tailscale) cannot be discovered via mDNS, so they never appear in the device list. Add POST /api/devices/manual, which probes the device over the network with plumesign device-info and registers it from the returned UDID. The device starts Pairable and the pairing flow runs over the supplied address; a successful pair upgrades the status via PairCompleted. Manual devices persist to data/manual_devices.json and are restored at startup, since no discovery mechanism annonces them.
plumesign device-info over the network refuses to run without a pairing file, so the probe at registration always fails for a device this host has never paired with. AddManualDevice now registers the address without a probe, keyed by IP and port, and PairCompleted fills in the UDID, device class and product details from the plumesign pairing files written by the successful pairing flow. A failed probe leaves the device Pairable so the pairing flow can run again. Devices without a pairing record are also restored at startup, so an unpaired manual device survives restarts.
…om saved files - model: Device.InstallPort overrides the tunnel-capable remote-pairing service port for installs, probes and screenshots (ServicePort fallback) - manual devices: add an install service port, persisted in manual_devices.json via UpdateManualInstallPort - imports: /pair/import accepts an optional record; without one the device is validated against pairing files already saved on the server, then created or upgraded to Paired (ImportPairedDevice) with the tvOS 26 peer-record fallback - install page: Install service port field sent as install_port and persisted on success - dual-port instructions in the add and import dialogs, translations for en, zh_cn, sv, sr, sr-Latn
Manual devices now persist across restarts via work_dir, so the no-record shortcut has no purpose; imports validate against an uploaded record again.
The portal gains a scan button next to every install-port input (install page and pairing-record import). The backend sweeps ports 49152-65535 plus the tvOS pairing port 65300 over TCP, then prefers the port whose tunnel handshake a saved pairing record validates; without records it falls back to the first open port in the range and never offers the pairing port as an install port.
The Add Device flow now asks only for the pair port (the tvOS manual-pairing port stays editable since iOS and tvOS use different fixed values); the install-port field and its scan button are gone. Right after PairCompleted stores the pairing record, a background handshake-validated scan finds the install service port and records it for the device, so installs land on the right port without manual entry. The scan remains available on the install page and in the pairing-record import.
Drop the separate InstallPort field and ServicePort accessor. The manual pairing port is a fixed value the pairing flow dials directly for manually registered devices, and the scanned install port lives in the one Port field that announcements already refresh for discovered devices. Every tunnel entry (queue installs, external installs, the install-page websocket, the AFC check) re-detects the port through FreshInstallDevice before dialing, so a stale port can no longer reach an install.
The install-port scan endpoint accepts an optional device id and records the detected port on the device, so the install page and the import dialog keep the value across page reloads instead of only prefilling an input that survived until the next install message.
ParseDeviceClass only filled an empty class, so the placeholder guess the manual add flow stores (AppleTV) lingered on an iPhone after pairing filled in the product type, leaving iOS installs with tvOS profile handling. The product type is now authoritative for the class, the name suffix is the fallback, and manual devices re-derive the class when they are restored from the registry.
The startup restore now re-derives the device class from the product type and rewrites the registry entry when the stored value was wrong, healing devices registered before pairing recorded their identity instead of leaving the add-flow placeholder in place.
The Add Device dialog now pings the address with an ICMP echo request (portless on purpose: iPhones never expose the pairing port over the network) before persisting the registration, so a mistyped address or an offline device fails in the dialog instead of leaving a registration behind that fails the pairing flow moments later.
…fresh Manual devices no longer expose a scan-port button on the install page or the pairing-record import dialog: the install port is re-detected automatically before every tunnel use and after each pairing flow, so a manual scan only duplicated that machinery. The install page gains a Fetch Device Info button that probes the device with plumesign device-info, proving reachability and refreshing the name and product fields the discovery path cannot update.
… remove manual port entry The install service port is now always found by scanning, the way the automatic refreshes already did, so neither the Install IPA page nor the Import Pairing File dialog asks for it anymore. The install flow reuses the pre-tunnel rescan and never carries a per-install port override, and the import refuses the pairing record with the scan error when no install service port answers. Uploads stay untouched, and the Add Device flow remains portless with its ICMP reachability check.
…file, instead of trying using every plist file
e035429 to
4d9bf0f
Compare
|
Thanks for the PR. I will refer to your code to implement this feature, and plan to add a new pairing flow to make pairing Tailscale devices easier. |
|
The new version is now supported. |
Why
atvloadly discovers Apple devices exclusively through mDNS/avahi on the local network, so the portal stops working when the device is reachable only over an overlay network like Tailscale: a server may host the portal for several households at once, but nothing on its LAN announces the Apple TVs it manages (see #223).
Two facts make a plain "IP + port" override insufficient for these devices:
Approach
manual_devices.json, and aLoadManualDevicespass restores it at startup because no discovery mechanism will ever announce it.idevice pair) can be added by uploading their.plistrecord plus the device IP. The record is validated over the network against the install service port, an identity probe fills name/UDID/product info, and the device is created — or an existing registration at the same address is upgraded — as Paired.plumesign device-infothrough the tunnel handshake, so installs never guess. Without a record the first open port that is not the pairing port is offered as a plain port-scan fallback. Exposed asPOST /api/devices/scan/install-portand a scan button on the install page and pairing-record import dialog.Portfield, the one field mDNS announcements already refresh for discovered devices, andFreshInstallDevicere-detects it before every tunnel use (scheduled refreshes, button-triggered reinstalls, install-page submissions, AFC checks), so a stale port cannot reach an install. A hint on the install page explains the behaviour for manual devices and the scan button's result is persisted on the device.How it works
internal/manager/manual_devices.go(+585 lines) — the manual registry: add with validation, record import with network validation (plumesign device-infoover the install port), install-port recording, delete, startup restore, and device identity updates after pairing completes. Manual devices keep an empty UDID until pairing succeeds, at which point a network probe fills everything the registration could not know.internal/manager/install_port_scan.go— the scan engine (dial concurrency and plumesign validation are injectable for tests).internal/manager/device_manager.go,model.Device— CGNAT range acceptance,Manualflag; manual and discovered devices share one refreshedPort.internal/task/task.go,internal/service/websocket.go— every tunnel entry re-detects an install port (throughFreshInstallDevice) before dialing.web/router.go,web/static/src/**— endpoints (/devices/manual,/devices/manual/:id/delete,/devices/scan/install-port), dialogs and device-row/delete UI.locales/*.json— all shipped locales kept in parity.So for manually adding a device the workflow would be:
Add Devicebutton next toPairable DeviceslabelPairable Devices. You can then click it to start the manual pairing from the web portal (for AppleTVs), or you can clickImport Pairing Fileto use an existing plist file (for Iphones).Paired Devicesand IPAs can be installed on it like usual.Testing
go test ./...,golangci-lint runand the frontendnode --testsuite (70 tests) pass; new coverage spans the manual lifecycle (add/import/upgrade/delete/restart persistence), the scan engine (validation, staleness, never-offering the pairing port, capped validation attempts), and the pre-refresh rescan.Links