From 35d999c1afdde128c296e236c56b34a9db39cf63 Mon Sep 17 00:00:00 2001 From: kload Date: Fri, 18 Oct 2013 16:33:10 +0000 Subject: [PATCH] Add nginx conf when adding domains --- yunohost_domain.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yunohost_domain.py b/yunohost_domain.py index 4fc20a46..b44edcbe 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -191,6 +191,13 @@ def domain_add(domains, main=False): os.system('chown -R metronome: /etc/metronome/conf.d/') os.system('service metronome restart') + + # Nginx + os.system('cp /usr/share/yunohost/yunohost-config/nginx/template.conf /etc/nginx/conf.d/'+ domain +'.conf') + os.system('mkdir /etc/nginx/conf.d/'+ domain +'.d/') + os.system('sed -i s/yunohost.org/'+ domain +'/g /etc/nginx/conf.d/'+ domain +'.conf') + os.system('service nginx reload') + if yldap.add('virtualdomain=' + domain + ',ou=domains', attr_dict): result.append(domain) continue @@ -267,7 +274,7 @@ def domain_ssowatconf(): conf_dict = { 'portal_domain': main_domain, - 'portal_path': '/sso/', + 'portal_path': '/ynhsso/', 'portal_port': '443', 'portal_scheme': 'https', 'additional_headers': { @@ -277,7 +284,7 @@ def domain_ssowatconf(): 'Email': 'mail' }, 'domains': domains, - 'skipped_urls': [], + 'skipped_urls': ['https://'+ main_domain +'/ynhadmin'], 'unprotected_urls': [] }