diff --git a/yunohost_domain.py b/yunohost_domain.py index 74e2f41e..8e34e0ae 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -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') diff --git a/yunohost_tools.py b/yunohost_tools.py index b9400f39..c39afe6e 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -109,7 +109,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