mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1763 from YunoHost/fix-dns-suffix-during-xmpp-cert-setup
Fix DNS suffix edge case during XMPP certificate setup
This commit is contained in:
commit
491588bb88
1 changed files with 8 additions and 1 deletions
|
@ -577,9 +577,16 @@ def _prepare_certificate_signing_request(domain, key_file, output_folder):
|
||||||
or {}
|
or {}
|
||||||
)
|
)
|
||||||
sanlist = []
|
sanlist = []
|
||||||
|
|
||||||
|
# Handle the boring case where the domain is not the root of the dns zone etc...
|
||||||
|
from yunohost.dns import _get_relative_name_for_dns_zone, _get_dns_zone_for_domain
|
||||||
|
base_dns_zone = _get_dns_zone_for_domain(domain)
|
||||||
|
basename = _get_relative_name_for_dns_zone(domain, base_dns_zone)
|
||||||
|
suffix = f".{basename}" if basename != "@" else ""
|
||||||
|
|
||||||
for sub in ("xmpp-upload", "muc"):
|
for sub in ("xmpp-upload", "muc"):
|
||||||
subdomain = sub + "." + domain
|
subdomain = sub + "." + domain
|
||||||
if xmpp_records.get("CNAME:" + sub) == "OK":
|
if xmpp_records.get("CNAME:" + sub + suffix) == "OK":
|
||||||
sanlist.append(("DNS:" + subdomain))
|
sanlist.append(("DNS:" + subdomain))
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
|
Loading…
Add table
Reference in a new issue