Configure apache by default

This commit is contained in:
Yunohost 2013-06-22 13:37:44 +02:00
parent 26cd267e1f
commit e1e10632d8
3 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -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