coreos / rpm-ostree

⚛📦 Hybrid image/package system with atomic upgrades and package layering
https://coreos.github.io/rpm-ostree
Other
872 stars 195 forks source link

FR: respect "only metered connections" #4844

Open boredsquirrel opened 8 months ago

boredsquirrel commented 8 months ago

Describe the bug

Networkmanager has the option to mark networks as metered. While this is respected everywhere on Android, due to the tiny amout of Desktop Linux users with WWAN cards, this flag has nearly no adoption.

Both GNOME and KDE (at least) support setting a network as metered manually, which is a more realistic procedure, as people may use their phone as a hotspot, with a limited cell data plan.

Rpm-ostree updates can be huge and may eat up such a plan.

Reproduction steps

Use a phone hotspot / usb tether

In the settings configure this network as "metered" manually (as it is not recognized as such)

Enable automatic rpm-ostree updates or update manually

Expected behavior

Rpm-ostree should respect the metered state. A simple example:

nmcli -g GENERAL.METERED connection show --active | grep -q 'no' && rpm-ostree update || exit

If such a flag "unmetered only" (which should be default, as all networks apart from WWAN networks are detected as metered) is set, rpm-ostree will block automatic updates,

and require active user confirmation when initiating a manual rpm-ostree command (read -p "You are using a metered connection. Do you really want to do this? (y/N) " confirmation)

Actual behavior

It just updates and eats up limited cell data plans.

System details

Fedora Kinoite 39

Additional information

No response

jlebon commented 8 months ago

Related: https://github.com/coreos/rpm-ostree/issues/2560, https://github.com/coreos/rpm-ostree/issues/4599