Talk to NetworkManager over D-Bus instead of shelling out to nmcli

breadcrumbs now speaks `org.freedesktop.NetworkManager` on the system
bus directly (new `zbus` dependency) — no `nmcli` subprocesses for
connect, scan, status, or the watch loop.

Why:
- Wi-Fi PSKs and 802.1x passwords no longer touch a command line. They
  travel inside `AddAndActivateConnection2` / `Update2` settings
  payloads, so they are never visible to other local users via
  `/proc/<pid>/cmdline`. This fully supersedes the earlier
  "feed the PSK to `nmcli --ask` on stdin" approach.
- The watch loop reacts to real `Device.StateChanged` / connectivity
  signals instead of parsing `nmcli monitor` text.
- Connect waits on the device actually reaching the ACTIVATED state
  rather than trusting `nmcli --wait`.

Config: `settings.nmcli_wait` is renamed to `connect_wait`; the old key
is still accepted via `#[serde(alias)]`. `status.rs` loses its private
`ipv4()` nmcli helper in favour of `nm::ipv4_address`. `util::run_with_stdin`
stays (tailscale still uses it) but no longer carries secrets.
This commit is contained in:
Breadway 2026-08-31 15:10:42 +08:00
parent 13c7743d48
commit b4c1d0b233
11 changed files with 1690 additions and 634 deletions

View file

@ -13,7 +13,7 @@
[settings]
dns = "1.1.1.1"
nmcli_wait = 8
connect_wait = 8
exit_node = "my-exit-node" # Tailscale hostname of your preferred exit node
default_profile = "away"
watch_interval = 12