TODO: switch to offline mode automatically when the host OS goes offline (airplane mode)

pkgproxy has an offline mode (#54 (closed)) that is switched by a flag or over the admin socket. It should be able to follow the host's own idea of being offline, so a laptop in airplane mode or off any network keeps serving its cache at once instead of timing out against every upstream.

Ideas to evaluate, per platform:

  • Linux: NetworkManager Connectivity / StateChanged over D-Bus, systemd-networkd online state (networkctl, systemd-networkd-wait-online semantics), rfkill.
  • macOS: NWPathMonitor. Windows: INetworkListManager connectivity.
  • Opt-in flag; how it interacts with the explicit mode (never | store-overloaded | offline, see #57 (closed)): an explicit offline always wins, host-offline should only force offline when the mode is not never? (decide).
  • A captive portal or a link with no route to the upstream is not offline to the OS; store-overloaded (circuit breaker) covers that case.
Edited by Zygmunt Krynicki