lemonconf bugfix

This commit is contained in:
Kload 2013-10-10 14:12:48 +02:00
parent 57bf10393a
commit ebce032ce9
2 changed files with 9 additions and 14 deletions

View file

@ -124,9 +124,10 @@ def domain_add(domains, raw=False, main=False):
(('vhostOptions', domain, 'vhostMaintenance'), 0), (('vhostOptions', domain, 'vhostMaintenance'), 0),
(('vhostOptions', domain, 'vhostPort'), -1), (('vhostOptions', domain, 'vhostPort'), -1),
(('vhostOptions', domain, 'vhostHttps'), -1), (('vhostOptions', domain, 'vhostHttps'), -1),
(('locationRules', domain, 'default'), 'accept', apply=True) (('locationRules', domain, 'default'), 'accept')
] ]
for lemonrule in lemonrules: tools_lemonrule(*lemonrule) for lemonrule in lemonrules: tools_lemonrule(*lemonrule)
tools_lemonrule(apply=True)
_apache_config(domain) _apache_config(domain)
try: try:

View file

@ -166,21 +166,15 @@ def tools_maindomain(old_domain, new_domain, dyndns=False):
domain_add([new_domain], raw=False, main=True) domain_add([new_domain], raw=False, main=True)
lemonrules = [ tools_lemonrule('domain', new_domain) # Replace Lemon domain
('domain', new_domain), # Replace Lemon domain tools_lemonrule('ldapBase', 'dc=yunohost,dc=org') # Set ldap basedn
('ldapBase', 'dc=yunohost,dc=org'), # Set ldap basedn tools_lemonrule('portal', 'https://'+ new_domain +'/sso/') # Set SSO url
('portal', 'https://'+ new_domain +'/sso/'), # Set SSO url tools_lemonrule(url=new_domain+'/ynh-admin/', value='$uid eq "admin"')
(url=new_domain+'/ynh-admin/', value='$uid eq "admin"'), tools_lemonrule(url=new_domain+'/ynh-user/', value='$uid ne "admin"')
(url=new_domain+'/ynh-user/', value='$uid ne "admin"')
]
if old_domain is 'yunohost.org': if old_domain is 'yunohost.org':
lemonrules.extend([ tools_lemonrule(url=old_domain+'/ynh-admin/', delete=True)
(url=old_domain+'/ynh-admin/', delete=True), tools_lemonrule(url=old_domain+'/ynh-user/', delete=True)
(url=old_domain+'/ynh-user/', delete=True)
])
for lemonrule in lemonrules: tools_lemonrule(*lemonrule)
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/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') os.system('rm /etc/ssl/private/yunohost_key.pem')