mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Added diagnosis details if more than 1 IP is found
This commit is contained in:
parent
ea07cb961a
commit
e93ee0714b
2 changed files with 12 additions and 7 deletions
|
@ -224,9 +224,11 @@
|
||||||
"diagnosis_ip_broken_dnsresolution": "Domain name resolution seems to be broken for some reason... Is a firewall blocking DNS requests ?",
|
"diagnosis_ip_broken_dnsresolution": "Domain name resolution seems to be broken for some reason... Is a firewall blocking DNS requests ?",
|
||||||
"diagnosis_ip_broken_resolvconf": "Domain name resolution seems to be broken on your server, which seems related to <code>/etc/resolv.conf</code> not pointing to <code>127.0.0.1</code>.",
|
"diagnosis_ip_broken_resolvconf": "Domain name resolution seems to be broken on your server, which seems related to <code>/etc/resolv.conf</code> not pointing to <code>127.0.0.1</code>.",
|
||||||
"diagnosis_ip_connected_ipv4": "The server is connected to the Internet through IPv4!",
|
"diagnosis_ip_connected_ipv4": "The server is connected to the Internet through IPv4!",
|
||||||
"diagnosis_ip_multiple_ipv4": "The server seems to have multiple IPv4 adresses",
|
"diagnosis_ip_multiple_ipv4": "The server seems to have multiple public IPv4 adresses",
|
||||||
|
"diagnosis_ip_multiple_ipv4_details": "It could be because your server really has multiple IPv4 adresses, in this case YunoHost doesn't support this well. But it could also be because one of your configured IP mirror is compromised. You can change them with <code>yunohost settings set security.ipmirrors.v4</code>",
|
||||||
"diagnosis_ip_connected_ipv6": "The server is connected to the Internet through IPv6!",
|
"diagnosis_ip_connected_ipv6": "The server is connected to the Internet through IPv6!",
|
||||||
"diagnosis_ip_multiple_ipv6": "The server seems to have multiple IPv6 adresses",
|
"diagnosis_ip_multiple_ipv6": "The server seems to have multiple public IPv6 adresses",
|
||||||
|
"diagnosis_ip_multiple_ipv6_details": "It could be because your server really has multiple IPv6 adresses, in this case YunoHost doesn't support this well. But it could also be because one of your configured IP mirror is compromised. You can change them with <code>yunohost settings set security.ipmirrors.v6</code>",
|
||||||
"diagnosis_ip_dnsresolution_working": "Domain name resolution is working!",
|
"diagnosis_ip_dnsresolution_working": "Domain name resolution is working!",
|
||||||
"diagnosis_ip_global": "Global IP: <code>{global}</code>",
|
"diagnosis_ip_global": "Global IP: <code>{global}</code>",
|
||||||
"diagnosis_ip_local": "Local IP: <code>{local}</code>",
|
"diagnosis_ip_local": "Local IP: <code>{local}</code>",
|
||||||
|
|
|
@ -14,7 +14,6 @@ from yunohost.diagnosis import Diagnoser
|
||||||
from yunohost.utils.network import get_network_interfaces
|
from yunohost.utils.network import get_network_interfaces
|
||||||
from yunohost.utils.network import get_public_ip
|
from yunohost.utils.network import get_public_ip
|
||||||
from yunohost.utils.network import get_public_ips
|
from yunohost.utils.network import get_public_ips
|
||||||
from yunohost.settings import settings_get
|
|
||||||
|
|
||||||
logger = log.getActionLogger("yunohost.diagnosis")
|
logger = log.getActionLogger("yunohost.diagnosis")
|
||||||
|
|
||||||
|
@ -109,38 +108,42 @@ class MyDiagnoser(Diagnoser):
|
||||||
|
|
||||||
ipv4_status = "ERROR"
|
ipv4_status = "ERROR"
|
||||||
ipv4_summary = "diagnosis_ip_no_ipv4"
|
ipv4_summary = "diagnosis_ip_no_ipv4"
|
||||||
|
ipv4_details = None
|
||||||
if ipv4:
|
if ipv4:
|
||||||
ipv4_status = "SUCCESS"
|
ipv4_status = "SUCCESS"
|
||||||
ipv4_summary = "diagnosis_ip_connected_ipv4"
|
ipv4_summary = "diagnosis_ip_connected_ipv4"
|
||||||
|
ipv4_details = ["diagnosis_ip_global", "diagnosis_ip_local"]
|
||||||
if len(ipsv4)>1:
|
if len(ipsv4)>1:
|
||||||
ipv4_status = "WARNING"
|
ipv4_status = "WARNING"
|
||||||
ipv4_summary = "diagnosis_ip_multiple_ipv4"
|
ipv4_summary = "diagnosis_ip_multiple_ipv4"
|
||||||
|
ipv4_details = ["diagnosis_ip_global", "diagnosis_ip_multiple_ipv4_details", "diagnosis_ip_local"]
|
||||||
|
|
||||||
yield dict(
|
yield dict(
|
||||||
meta={"test": "ipv4"},
|
meta={"test": "ipv4"},
|
||||||
data={"global": ' '.join(ipsv4), "local": get_local_ip("ipv4")},
|
data={"global": ' '.join(ipsv4), "local": get_local_ip("ipv4")},
|
||||||
status=ipv4_status,
|
status=ipv4_status,
|
||||||
summary=ipv4_summary,
|
summary=ipv4_summary,
|
||||||
details=["diagnosis_ip_global", "diagnosis_ip_local"] if ipv4 else None,
|
details=ipv4_details,
|
||||||
)
|
)
|
||||||
|
|
||||||
ipv6_status = "ERROR"
|
ipv6_status = "ERROR"
|
||||||
ipv6_summary = "diagnosis_ip_no_ipv6"
|
ipv6_summary = "diagnosis_ip_no_ipv6"
|
||||||
|
ipv6_details = ["diagnosis_ip_no_ipv6_tip"]
|
||||||
if ipv6:
|
if ipv6:
|
||||||
ipv6_status = "SUCCESS"
|
ipv6_status = "SUCCESS"
|
||||||
ipv6_summary = "diagnosis_ip_connected_ipv6"
|
ipv6_summary = "diagnosis_ip_connected_ipv6"
|
||||||
|
ipv6_details = ["diagnosis_ip_global", "diagnosis_ip_local"]
|
||||||
if len(ipsv6)>1:
|
if len(ipsv6)>1:
|
||||||
ipv6_status = "WARNING"
|
ipv6_status = "WARNING"
|
||||||
ipv6_summary = "diagnosis_ip_multiple_ipv6"
|
ipv6_summary = "diagnosis_ip_multiple_ipv6"
|
||||||
|
ipv6_details = ["diagnosis_ip_global", "diagnosis_ip_multiple_ipv6_details", "diagnosis_ip_local"]
|
||||||
|
|
||||||
yield dict(
|
yield dict(
|
||||||
meta={"test": "ipv6"},
|
meta={"test": "ipv6"},
|
||||||
data={"global": ' '.join(ipsv6) , "local": get_local_ip("ipv6")},
|
data={"global": ' '.join(ipsv6) , "local": get_local_ip("ipv6")},
|
||||||
status=ipv6_status,
|
status=ipv6_status,
|
||||||
summary=ipv6_summary,
|
summary=ipv6_summary,
|
||||||
details=["diagnosis_ip_global", "diagnosis_ip_local"]
|
details=ipv6_details,
|
||||||
if ipv6
|
|
||||||
else ["diagnosis_ip_no_ipv6_tip"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO / FIXME : add some attempt to detect ISP (using whois ?) ?
|
# TODO / FIXME : add some attempt to detect ISP (using whois ?) ?
|
||||||
|
|
Loading…
Add table
Reference in a new issue