mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'enh-dns-autoconf' of https://github.com/MercierCorentin/yunohost into enh-dns-autoconf
This commit is contained in:
commit
1dcf9ab647
1 changed files with 13 additions and 9 deletions
|
@ -461,20 +461,24 @@ def _build_dns_conf(domains):
|
||||||
extra = []
|
extra = []
|
||||||
ipv4 = get_public_ip()
|
ipv4 = get_public_ip()
|
||||||
ipv6 = get_public_ip(6)
|
ipv6 = get_public_ip(6)
|
||||||
|
owned_dns_zone = "owned_dns_zone" in domains[root] and domains[root]["owned_dns_zone"]
|
||||||
|
|
||||||
name_prefix = root.partition(".")[0]
|
root_prefix = root.partition(".")[0]
|
||||||
|
child_domain_suffix = ""
|
||||||
|
|
||||||
for domain_name, domain in domains.items():
|
for domain_name, domain in domains.items():
|
||||||
ttl = domain["ttl"]
|
ttl = domain["ttl"]
|
||||||
|
|
||||||
owned_dns_zone = "owned_dns_zone" in domains[root] and domains[root]["owned_dns_zone"]
|
|
||||||
if domain_name == root:
|
if domain_name == root:
|
||||||
name = name_prefix if not owned_dns_zone else "@"
|
name = root_prefix if not owned_dns_zone else "@"
|
||||||
else:
|
else:
|
||||||
name = domain_name[0:-(1 + len(root))]
|
name = domain_name[0:-(1 + len(root))]
|
||||||
if not owned_dns_zone:
|
if not owned_dns_zone:
|
||||||
name += "." + name_prefix
|
name += "." + root_prefix
|
||||||
|
|
||||||
|
if name != "@":
|
||||||
|
child_domain_suffix = "." + name
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Basic ipv4/ipv6 records #
|
# Basic ipv4/ipv6 records #
|
||||||
|
@ -514,10 +518,10 @@ def _build_dns_conf(domains):
|
||||||
xmpp += [
|
xmpp += [
|
||||||
["_xmpp-client._tcp", ttl, "SRV", "0 5 5222 %s." % domain_name],
|
["_xmpp-client._tcp", ttl, "SRV", "0 5 5222 %s." % domain_name],
|
||||||
["_xmpp-server._tcp", ttl, "SRV", "0 5 5269 %s." % domain_name],
|
["_xmpp-server._tcp", ttl, "SRV", "0 5 5269 %s." % domain_name],
|
||||||
["muc", ttl, "CNAME", name],
|
["muc" + child_domain_suffix, ttl, "CNAME", name],
|
||||||
["pubsub", ttl, "CNAME", name],
|
["pubsub" + child_domain_suffix, ttl, "CNAME", name],
|
||||||
["vjud", ttl, "CNAME", name],
|
["vjud" + child_domain_suffix, ttl, "CNAME", name],
|
||||||
["xmpp-upload", ttl, "CNAME", name],
|
["xmpp-upload" + child_domain_suffix, ttl, "CNAME", name],
|
||||||
]
|
]
|
||||||
|
|
||||||
#########
|
#########
|
||||||
|
|
Loading…
Add table
Reference in a new issue