mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Metronome conf
This commit is contained in:
parent
cecbe3d293
commit
227cafa7a1
2 changed files with 18 additions and 2 deletions
|
@ -173,10 +173,10 @@ domain:
|
|||
help: Domain name to add
|
||||
nargs: '+'
|
||||
pattern: '^([a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)(\.[a-zA-Z0-9]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)*(\.[a-zA-Z]{1}([a-zA-Z0-9\-]*[a-zA-Z0-9])*)$'
|
||||
web:
|
||||
-w:
|
||||
full: --web
|
||||
help: Auto-configure Apache and LemonLDAP for the domain
|
||||
action: store_true
|
||||
default: False
|
||||
|
||||
### domain_remove()
|
||||
remove:
|
||||
|
|
|
@ -155,6 +155,22 @@ def domain_add(domains, web=False):
|
|||
|
||||
os.system('service bind9 reload')
|
||||
|
||||
# XMPP
|
||||
try:
|
||||
with open('/etc/metronome/conf.d/'+ domain +'.cfg.lua') as f: pass
|
||||
except IOError as e:
|
||||
conf_lines = [
|
||||
'VirtualHost "'+ domain +'"',
|
||||
' authentication = "ldap2"',
|
||||
]
|
||||
with open('/etc/metronome/conf.d/' + domain + '.cfg.lua', 'w') as conf:
|
||||
for line in conf_lines:
|
||||
conf.write(line + '\n')
|
||||
|
||||
os.system('mkdir -p /var/lib/metronome/'+ domain.replace('.', '%2e') +'/pep')
|
||||
os.system('chown -R metronome: /var/lib/metronome/')
|
||||
os.system('service metronome reload')
|
||||
|
||||
if yldap.add('virtualdomain=' + domain + ',ou=domains', attr_dict):
|
||||
result.append(domain)
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue