mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Black
This commit is contained in:
parent
8eb9e274d4
commit
df0cdd483d
3 changed files with 21 additions and 5 deletions
|
@ -8,7 +8,12 @@ from publicsuffix import PublicSuffixList
|
||||||
|
|
||||||
from moulinette.utils.process import check_output
|
from moulinette.utils.process import check_output
|
||||||
|
|
||||||
from yunohost.utils.dns import dig, YNH_DYNDNS_DOMAINS, is_yunohost_dyndns_domain, is_special_use_tld
|
from yunohost.utils.dns import (
|
||||||
|
dig,
|
||||||
|
YNH_DYNDNS_DOMAINS,
|
||||||
|
is_yunohost_dyndns_domain,
|
||||||
|
is_special_use_tld,
|
||||||
|
)
|
||||||
from yunohost.diagnosis import Diagnoser
|
from yunohost.diagnosis import Diagnoser
|
||||||
from yunohost.domain import domain_list, _get_maindomain
|
from yunohost.domain import domain_list, _get_maindomain
|
||||||
from yunohost.dns import _build_dns_conf, _get_dns_zone_for_domain
|
from yunohost.dns import _build_dns_conf, _get_dns_zone_for_domain
|
||||||
|
|
|
@ -873,7 +873,9 @@ def _check_domain_is_ready_for_ACME(domain):
|
||||||
)
|
)
|
||||||
|
|
||||||
base_dns_zone = _get_dns_zone_for_domain(domain)
|
base_dns_zone = _get_dns_zone_for_domain(domain)
|
||||||
record_name = domain.replace(f".{base_dns_zone}", "") if domain != base_dns_zone else "@"
|
record_name = (
|
||||||
|
domain.replace(f".{base_dns_zone}", "") if domain != base_dns_zone else "@"
|
||||||
|
)
|
||||||
A_record_status = dnsrecords.get("data").get(f"A:{record_name}")
|
A_record_status = dnsrecords.get("data").get(f"A:{record_name}")
|
||||||
AAAA_record_status = dnsrecords.get("data").get(f"AAAA:{record_name}")
|
AAAA_record_status = dnsrecords.get("data").get(f"AAAA:{record_name}")
|
||||||
|
|
||||||
|
@ -883,7 +885,11 @@ def _check_domain_is_ready_for_ACME(domain):
|
||||||
if not AAAA_record_status:
|
if not AAAA_record_status:
|
||||||
AAAA_record_status = dnsrecords.get("data").get(f"AAAA:*")
|
AAAA_record_status = dnsrecords.get("data").get(f"AAAA:*")
|
||||||
|
|
||||||
if not httpreachable or not dnsrecords.get("data") or (A_record_status, AAAA_record_status) == (None, None):
|
if (
|
||||||
|
not httpreachable
|
||||||
|
or not dnsrecords.get("data")
|
||||||
|
or (A_record_status, AAAA_record_status) == (None, None)
|
||||||
|
):
|
||||||
raise YunohostValidationError(
|
raise YunohostValidationError(
|
||||||
"certmanager_domain_not_diagnosed_yet", domain=domain
|
"certmanager_domain_not_diagnosed_yet", domain=domain
|
||||||
)
|
)
|
||||||
|
@ -892,7 +898,10 @@ def _check_domain_is_ready_for_ACME(domain):
|
||||||
# - 'MISSING' for IPv6 ain't critical for ACME
|
# - 'MISSING' for IPv6 ain't critical for ACME
|
||||||
# - IPv4 can be None assuming there's at least an IPv6, and viveversa
|
# - IPv4 can be None assuming there's at least an IPv6, and viveversa
|
||||||
# - (the case where both are None is checked before)
|
# - (the case where both are None is checked before)
|
||||||
if not (A_record_status in [None, "OK"] and AAAA_record_status in [None, "OK", "MISSING"]):
|
if not (
|
||||||
|
A_record_status in [None, "OK"]
|
||||||
|
and AAAA_record_status in [None, "OK", "MISSING"]
|
||||||
|
):
|
||||||
raise YunohostValidationError(
|
raise YunohostValidationError(
|
||||||
"certmanager_domain_dns_ip_differs_from_public_ip", domain=domain
|
"certmanager_domain_dns_ip_differs_from_public_ip", domain=domain
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,9 @@ external_resolvers_: List[str] = []
|
||||||
|
|
||||||
def is_yunohost_dyndns_domain(domain):
|
def is_yunohost_dyndns_domain(domain):
|
||||||
|
|
||||||
return any(domain.endswith(f".{dyndns_domain}") for dyndns_domain in YNH_DYNDNS_DOMAINS)
|
return any(
|
||||||
|
domain.endswith(f".{dyndns_domain}") for dyndns_domain in YNH_DYNDNS_DOMAINS
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_special_use_tld(domain):
|
def is_special_use_tld(domain):
|
||||||
|
|
Loading…
Add table
Reference in a new issue