plugwash / raspbian-tools

10 stars 3 forks source link

raspbmirror: add --ipv4 option, forces all connections to use v4 addresses only #9

Closed mutability closed 2 years ago

mutability commented 2 years ago

This is a bit ugly but I'm not aware of a cleaner way to make urllib do ipv4 only.

The background here is that we mirror from an IPv6-connected system that prefers v6 over v4, but the v6 connectivity specifically to archive.raspbian.org and some/all of the v6 mirrordirector mirrors is not good (<<1Mbps) because wider internet IPv6 interconnectivity is still trash, and so the mirror has trouble staying up to date.

plugwash commented 2 years ago

The amount of code seems disproportionate to the task at hand.

Some searching seems to indicate that forcing IPv4 only is much easier with urllib3 ( https://stackoverflow.com/questions/33046733/force-requests-to-use-ipv4-ipv6 ), maybe it would make sense to limit IPv4 only mode to cases where urllib3 is in use.

mutability commented 2 years ago

Oh yeah, it'd be way cleaner to use that. Let me poke at that approach a bit.

plugwash commented 2 years ago

Closing in favour of #14