Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#21153 - {archweb} mirrorstatus and mirrorlist: check for IPv6
Attached to Project:
Arch Linux
Opened by PyroPeter (pyropeter) - Friday, 08 October 2010, 15:21 GMT
Last edited by Dan McGee (toofishes) - Monday, 25 April 2011, 22:47 GMT
Opened by PyroPeter (pyropeter) - Friday, 08 October 2010, 15:21 GMT
Last edited by Dan McGee (toofishes) - Monday, 25 April 2011, 22:47 GMT
|
DetailsI would be nice if the Mirrorstatus/Mirrorlist service would check if a mirror is available via IPv4, v6 or both.
I am unsure how this should be checked. The easiest way would be to handle it like the Country-property, which seems to be manually checked once the mirror gets added to the list. But there are also reasons for checking this on a regular basis: But there could be mirrors that enable/disable IPv6 at some time without an announcement. Some mirrors could also have connectivity issues confined to one protocol. (Is confined the right word? Intended meaning: issues that only occur if you use one of the protocols) |
This task depends upon
These pages are new and not very filled out yet:
http://www.archlinux.org/mirrors/bjtu.edu.cn/
But I can envision them showing a lot more information than what is there now. We can pull the status data in; do the required DNS lookups on the hostnames and show the A/AAAA records (which will show whether IPv4/IPv6 support is there), etc.
1. Add a migration to add has_ipv4, has_ipv6 columns (or something like that) to the MirrorUrl model.
2. Add another management command we could run like once a day that does DNS lookups on all of the mirror URLs, and then updates the columns accordingly based on what info came back.
3. Possibly persist this DNS information in another table, or just retrieve it on the fly.
4. Display DNS info and more on the mirror details page.
5. Allow filtering of the generated mirrorlist based on IPv4/IPv6 status (not much different than the FTP/HTTP filter).
What do you mean with "DNS information" in 3.? Are you planning to save the IP-addresses in a table?
In [15]: [i[4] for i in socket.getaddrinfo('testmyipv6.com', 80, 0, socket.SOCK_STREAM)]
Out[15]: [('24.73.171.238', 80), ('2001:4830:2502:8002::ac10:a', 80, 0, 0)]
Not sure how much we are going to have to do, but this might be helpful:
http://google-opensource.blogspot.com/2008/10/ipaddrpy-flexible-and-easy-python-ip.html
>>> import socket
>>> from urlparse import urlparse
>>> url = "http://archlinux.de/"
>>> families = [x[0] for x in socket.getaddrinfo(urlparse(url).hostname, None)]
>>> socket.AF_INET in families
True
>>> socket.AF_INET6 in families
True
EDIT:
The attached patch implements #1 to #4, but is work in progress.
I did not use threads for mirrorresolv.py. Are long running manage.py-commands blocking the server? If not, I see no reason to add threading.
In my opinion the handling of the Country-input in /mirrorlist/ is not user friendly at the moment:
Choosing 'Any' should result in a list of all mirrors, and not in a list of all mirrors with unspecified ('Any') country-property.
I suggest to fix that like I did it in the patch:
If the country input is 'Any', disable filtering by country.
To make the 'Any' MultipleChoiceField-entry independent from the countries actually used by the Mirrors, it is now manually added to the form if it was not added with make_choice().
If we want to do what you propose, don't reuse a value- we should either add a checkbox to the form that indicates we want to use all mirrors, or add an "All" option to the list.
Other comments:
* there is some trailing whitespace in the patch, make sure that is as clean as possible.
* "mirrorUrls" -> "mirror URLs" in log messages, no need to introduce camelcase that doesn't exist elsewhere.
* You're mixing strings and integers in your choice field- it ends up working, but it is probably better to always use strings- ('4', 'IPv4') since you compare on strings later anyway.
* "ipv4_only" is misleading as a function argument name, and the way this works seems wrong/backwards. I would expect the method to take as input "supports IPv4" or "supports IPv6", and you would pass both as true if you could support either. Passing both as false should also return no mirrors.
99bccbb Add 'All' choice and make it the default
145c462 Add has_ipv{4,6} to MirrorUrl
c2763c4 Add mirrorresolv manage.py command
5b941e5 Allow filtering of mirrorlist by IP-version
1699dbe Display information about supported IP-versions
"Passing both as false should also return no mirrors."
That would be nice, but it would make things more complex without adding any value.
People without neither IPv4 nor IPv6 won't need mirrorlists anyway.
At the moment there is no way to call find_mirrors with both values set to False, because the form validation prevents it.
You are being shortsighted in your logic with find_mirrors(). Of course I realize that there is only one way it is currently called, but the fact that this stuff didn't even exist until 2 months ago also tells me there is a lot that can be done in the future with it, and I think your argument as to why you shouldn't fix it is a bit silly.
I created a repository at github and pushed my changes:
Github project page: http://github.com/pyropeter/archweb
Git-url for pulling: git://github.com/pyropeter/archweb.git