1
0
Fork 0
mirror of https://github.com/YunoHost/moulinette.git synced 2024-09-03 20:06:31 +02:00

add extra DNS entries for main domain

This commit is contained in:
Kload 2013-06-10 13:05:31 +02:00
parent 466d19a106
commit 3805f031f5
2 changed files with 9 additions and 2 deletions

View file

@ -46,13 +46,14 @@ def domain_list(filter=None, limit=None, offset=None):
return { 'Domains': result_list }
def domain_add(domains, web=False):
def domain_add(domains, web=False, main=False):
"""
Add one or more domains
Keyword argument:
domains -- List of domains to add
web -- Configure Apache and LemonLDAP for the domain too
main -- Is the main domain
Returns:
Dict
@ -136,6 +137,12 @@ def domain_add(domains, web=False):
'_xmpp-server._tcp.'+ domain +'. IN SRV 0 5 5269 '+ domain +'.',
'_jabber._tcp.'+ domain +'. IN SRV 0 5 5269 '+ domain +'.',
]
if main:
zone_lines.extend([
'pubsub.'+ domain +'. IN A '+ ip,
'muc.'+ domain +'. IN A '+ ip,
'vjud.'+ domain +'. IN A '+ ip
])
with open('/var/lib/bind/' + domain + '.zone', 'w') as zone:
for line in zone_lines:
zone.write(line + '\n')

View file

@ -108,7 +108,7 @@ def tools_maindomain(old_domain, new_domain):
for line in lines:
sources.write(re.sub(r''+ old_domain +'', new_domain, line))
domain_add([new_domain], web=True)
domain_add([new_domain], web=True, main=True)
lemon_conf_lines = [
"$tmp->{'domain'} = '"+ new_domain +"';", # Replace Lemon domain