Features: - Introduce a Backend trait + System impl so flow/status/watch can be unit tested against a fake; add 11 connect-state-machine tests. - Captive-portal detection: status::connectivity returns Online/Portal/Offline; surfaced in status, JSON, connect notes, and a dedicated watch state. - `status --json` for bars/scripts; `profile add`/`profile remove`; detect now scores by number of in-range markers. Robustness: - Pin LC_ALL=C/LANG=C on child processes for locale-independent parsing. - Atomic config/state writes (temp + rename); 0600 config never world-readable. - Transient PSK file written to $XDG_RUNTIME_DIR when available. Fixes (from prior audit): - Feed Wi-Fi PSK to nmcli via stdin/passwd-file, never argv. - mask() no longer panics on multi-byte passwords. - Connectivity check requires HTTP 204 (no captive-portal false positives). - nmcli NAME,TYPE parsing handles escaped colons. - Strip CIDR suffix from displayed IP; PKGBUILD/Cargo version aligned (2.1.0).
60 lines
1.8 KiB
TOML
60 lines
1.8 KiB
TOML
# breadcrumbs configuration template.
|
|
#
|
|
# Copy to ~/.config/breadcrumbs/breadcrumbs.toml and fill in real values, OR
|
|
# just run breadcrumbs once (it generates a skeleton) and then use
|
|
# `breadcrumbs add` / `breadcrumbs edit` to fill in your networks.
|
|
# The real breadcrumbs.toml is gitignored and never committed.
|
|
|
|
[settings]
|
|
dns = "1.1.1.1"
|
|
nmcli_wait = 8
|
|
exit_node = "my-exit-node" # Tailscale hostname of your preferred exit node
|
|
default_profile = "away"
|
|
watch_interval = 12
|
|
# Must be a "generate_204"-style endpoint: only an empty HTTP 204 counts as
|
|
# online, so a captive portal (200 login page / 30x redirect) is detected.
|
|
connectivity_url = "http://connectivitycheck.gstatic.com/generate_204"
|
|
ping_host = "1.1.1.1"
|
|
|
|
[[networks]]
|
|
ssid = "HomeWifi"
|
|
password = "REPLACE_ME"
|
|
hidden = false
|
|
|
|
[[networks]]
|
|
ssid = "WorkGuest"
|
|
password = "REPLACE_ME"
|
|
hidden = false
|
|
|
|
[[networks]]
|
|
ssid = "CorpWifi"
|
|
password = "REPLACE_ME"
|
|
hidden = false
|
|
|
|
# Location state machine. Switch with: breadcrumbs profile set <name>
|
|
#
|
|
# detect_ssids: list any SSIDs that reliably indicate you are at this location.
|
|
# `breadcrumbs detect` scans for visible networks and switches to the first
|
|
# profile whose detect_ssids list contains a match. Profiles without
|
|
# detect_ssids are skipped during detection; the default_profile is used as
|
|
# the final fallback.
|
|
|
|
[profiles.away]
|
|
networks = ["HomeWifi"]
|
|
tailscale = false
|
|
include_all_known = true
|
|
# No detect_ssids: "away" is the catch-all fallback (set as default_profile).
|
|
|
|
[profiles.home]
|
|
networks = ["HomeWifi"]
|
|
tailscale = false
|
|
include_all_known = false
|
|
detect_ssids = ["HomeWifi"]
|
|
|
|
[profiles.work]
|
|
bootstrap = "WorkGuest" # connect here first so Tailscale can come up
|
|
networks = ["CorpWifi"]
|
|
tailscale = true
|
|
exit_node = "my-exit-node"
|
|
include_all_known = false
|
|
detect_ssids = ["CorpWifi", "WorkGuest"]
|