feat: numa setup-phone — QR-based mobile DoT onboarding #38
Reference in New Issue
Block a user
Delete Branch "feat/setup-phone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a
numa setup-phoneCLI subcommand that onboards a phone (iPhone primarily) to use Numa as its DNS-over-TLS server, in a single command.Stacked on top of #25 (DoT listener) — this PR depends on the DoT feature. Will be rebased onto
mainafter #25 merges.What it does
numa setup-phone(no sudo needed)lan::detect_lan_ip()/usr/local/var/numa/ca.pem.mobileconfigcontaining:com.apple.security.rootpayload (CA installation)com.apple.dnsSettings.managedpayload (DoT pointing to laptop's IP)qrcodecrate)Terminal output
Validated quirks
setup-phoneafter an IP change replaces the existing profile rather than accumulating duplicates in iOS Settings.Known limitations (documented in copy)
ServerAddresses— no hostnames allowed. Mitigation: re-runsetup-phone, iOS auto-replaces the profile via stable identifiers. Long-term fix would require ACME + a real domain.--ssidflag for OnDemand rules to scope Numa to a specific Wi-Fi.Files
src/setup_phone.rssrc/lib.rspub mod setup_phonesrc/main.rssetup-phoneCLI subcommand + help textCargo.tomlqrcode = "0.14"(default-features = false), tokiosignalfeatureTests
3 unit tests in
setup_phone::tests:pem_to_base64_strips_headers— PEM parsingmobileconfig_contains_ip_and_ca— profile generationrender_qr_produces_unicode— QR renderingTotal: 129 tests passing locally (126 DoT-branch + 3 new).
Test plan
cargo testpasses locally (macOS)cargo clippy -- -D warningscleancargo fmt --checkcleanFuture iterations (out of scope)
--ssid "MyHomeWiFi"for OnDemand rules (laptop-asleep mitigation)--ssid autoto detect current Wi-Fi vianetworksetup/iwgetid--printto write profile to stdout for scripted useverify.numa.numashowing "your phone is connected"🤖 Generated with Claude Code