mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Make sure that there's no AAAA records when no ipv6
This commit is contained in:
parent
ae82fe3693
commit
093ccd8020
2 changed files with 7 additions and 2 deletions
|
@ -38,7 +38,7 @@ class DNSRecordsDiagnoser(Diagnoser):
|
|||
|
||||
def check_domain(self, domain, is_main_domain, is_subdomain):
|
||||
|
||||
expected_configuration = _build_dns_conf(domain)
|
||||
expected_configuration = _build_dns_conf(domain, include_empty_AAAA_if_no_ipv6=True)
|
||||
|
||||
# FIXME: Here if there are no AAAA record, we should add something to expect "no" AAAA record
|
||||
# to properly diagnose situations where people have a AAAA record but no IPv6
|
||||
|
|
|
@ -395,7 +395,7 @@ def _normalize_domain_path(domain, path):
|
|||
return domain, path
|
||||
|
||||
|
||||
def _build_dns_conf(domain, ttl=3600):
|
||||
def _build_dns_conf(domain, ttl=3600, include_empty_AAAA_if_no_ipv6=False):
|
||||
"""
|
||||
Internal function that will returns a data structure containing the needed
|
||||
information to generate/adapt the dns configuration
|
||||
|
@ -448,6 +448,8 @@ def _build_dns_conf(domain, ttl=3600):
|
|||
|
||||
if ipv6:
|
||||
basic.append(["@", ttl, "AAAA", ipv6])
|
||||
elif include_empty_AAAA_if_no_ipv6:
|
||||
basic.append(["@", ttl, "AAAA", None])
|
||||
|
||||
#########
|
||||
# Email #
|
||||
|
@ -495,8 +497,11 @@ def _build_dns_conf(domain, ttl=3600):
|
|||
|
||||
if ipv4:
|
||||
extra.append(["*", ttl, "A", ipv4])
|
||||
|
||||
if ipv6:
|
||||
extra.append(["*", ttl, "AAAA", ipv6])
|
||||
elif include_empty_AAAA_if_no_ipv6:
|
||||
extra.append(["*", ttl, "AAAA", None])
|
||||
|
||||
extra.append(["@", ttl, "CAA", '128 issue "letsencrypt.org"'])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue