From ebce032ce9732f6ef4e97f109efe382e98778ee5 Mon Sep 17 00:00:00 2001 From: Kload Date: Thu, 10 Oct 2013 14:12:48 +0200 Subject: [PATCH] lemonconf bugfix --- yunohost_domain.py | 3 ++- yunohost_tools.py | 20 +++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/yunohost_domain.py b/yunohost_domain.py index d67113d6..c9f97e18 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -124,9 +124,10 @@ def domain_add(domains, raw=False, main=False): (('vhostOptions', domain, 'vhostMaintenance'), 0), (('vhostOptions', domain, 'vhostPort'), -1), (('vhostOptions', domain, 'vhostHttps'), -1), - (('locationRules', domain, 'default'), 'accept', apply=True) + (('locationRules', domain, 'default'), 'accept') ] for lemonrule in lemonrules: tools_lemonrule(*lemonrule) + tools_lemonrule(apply=True) _apache_config(domain) try: diff --git a/yunohost_tools.py b/yunohost_tools.py index 7a893b21..5ab0546e 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -166,21 +166,15 @@ def tools_maindomain(old_domain, new_domain, dyndns=False): domain_add([new_domain], raw=False, main=True) - lemonrules = [ - ('domain', new_domain), # Replace Lemon domain - ('ldapBase', 'dc=yunohost,dc=org'), # Set ldap basedn - ('portal', 'https://'+ new_domain +'/sso/'), # Set SSO url - (url=new_domain+'/ynh-admin/', value='$uid eq "admin"'), - (url=new_domain+'/ynh-user/', value='$uid ne "admin"') - ] + tools_lemonrule('domain', new_domain) # Replace Lemon domain + tools_lemonrule('ldapBase', 'dc=yunohost,dc=org') # Set ldap basedn + tools_lemonrule('portal', 'https://'+ new_domain +'/sso/') # Set SSO url + tools_lemonrule(url=new_domain+'/ynh-admin/', value='$uid eq "admin"') + tools_lemonrule(url=new_domain+'/ynh-user/', value='$uid ne "admin"') if old_domain is 'yunohost.org': - lemonrules.extend([ - (url=old_domain+'/ynh-admin/', delete=True), - (url=old_domain+'/ynh-user/', delete=True) - ]) - - for lemonrule in lemonrules: tools_lemonrule(*lemonrule) + tools_lemonrule(url=old_domain+'/ynh-admin/', delete=True) + tools_lemonrule(url=old_domain+'/ynh-user/', delete=True) os.system('rm /etc/yunohost/apache/domains/' + old_domain + '.d/*.fixed.conf') # remove SSO apache conf dir from old domain conf (fail if postinstall) os.system('rm /etc/ssl/private/yunohost_key.pem')