This commit is contained in:
theo@manjaro 2022-06-28 13:35:56 +02:00
parent 988ee54de4
commit 66a3adccba

View file

@ -214,14 +214,16 @@ class MyDiagnoser(Diagnoser):
protocol protocol
) )
ip_url_yunohost_tab = ["https://ip%s.yunohost.org" % (protocol if protocol != 4 else ""), "https://0-ip%s.yunohost.org" % (protocol if protocol != 4 else "")] ip4_tab = ["https://ip.yunohost.org","https://api.ipify.net"]
ip6_tab = ["https://ip6.yunohost.org"]
ip_url_yunohost_tab = ip4_tab if protocol==4 else ip6_tab
# Check URLS # Check URLS
for url in ip_url_yunohost_tab: for url in ip_url_yunohost_tab:
try: try:
return download_text(url, timeout=10).strip() return download_text(url, timeout=10).strip()
except Exception as e: except Exception as e:
self.logger_debug( logger.debug(
"Could not get public IPv%s from %s : %s" % (str(protocol), url, str(e)) "Could not get public IPv%s from %s : %s" % (str(protocol), url, str(e))
) )