From e1e10632d8825fa8aa85d4a8f91db7b170d15692 Mon Sep 17 00:00:00 2001 From: Yunohost Date: Sat, 22 Jun 2013 13:37:44 +0200 Subject: [PATCH] Configure apache by default --- action_map.yml | 4 ++-- yunohost_domain.py | 8 ++++---- yunohost_tools.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/action_map.yml b/action_map.yml index 27c71026..4bdd34d8 100644 --- a/action_map.yml +++ b/action_map.yml @@ -173,8 +173,8 @@ 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])*)$' - -w: - full: --web + -r: + full: --raw help: Auto-configure Apache and LemonLDAP for the domain action: store_true diff --git a/yunohost_domain.py b/yunohost_domain.py index 2baa0ed4..1461a003 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -46,13 +46,13 @@ def domain_list(filter=None, limit=None, offset=None): return { 'Domains': result_list } -def domain_add(domains, web=False, main=False): +def domain_add(domains, raw=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 + raw -- Do not configure Apache and LemonLDAP for the domain too main -- Is the main domain Returns: @@ -94,7 +94,7 @@ def domain_add(domains, web=False, main=False): if os.system(command) != 0: raise YunoHostError(17, _("An error occurred during certificate generation")) - if web: + if not raw: lemon_configuration({ ('exportedHeaders', domain, 'Auth-User'): '$uid', ('exportedHeaders', domain, 'Remote-User'): '$uid', @@ -112,7 +112,7 @@ def domain_add(domains, web=False, main=False): try: yldap.validate_uniqueness({ 'virtualdomain' : domain }) except YunoHostError: - if web: + if not raw: win_msg(_("Web config created")) result.append(domain) break diff --git a/yunohost_tools.py b/yunohost_tools.py index 6c31092a..db6ac62c 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -110,7 +110,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, main=True) + domain_add([new_domain], raw=False, main=True) lemon_conf_lines = [ "$tmp->{'domain'} = '"+ new_domain +"';", # Replace Lemon domain