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 help: Domain name to add
nargs: '+' 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])*)$' 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: -r:
full: --web full: --raw
help: Auto-configure Apache and LemonLDAP for the domain help: Auto-configure Apache and LemonLDAP for the domain
action: store_true action: store_true

View file

@ -46,13 +46,13 @@ def domain_list(filter=None, limit=None, offset=None):
return { 'Domains': result_list } 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 Add one or more domains
Keyword argument: Keyword argument:
domains -- List of domains to add 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 main -- Is the main domain
Returns: Returns:
@ -94,7 +94,7 @@ def domain_add(domains, web=False, main=False):
if os.system(command) != 0: if os.system(command) != 0:
raise YunoHostError(17, _("An error occurred during certificate generation")) raise YunoHostError(17, _("An error occurred during certificate generation"))
if web: if not raw:
lemon_configuration({ lemon_configuration({
('exportedHeaders', domain, 'Auth-User'): '$uid', ('exportedHeaders', domain, 'Auth-User'): '$uid',
('exportedHeaders', domain, 'Remote-User'): '$uid', ('exportedHeaders', domain, 'Remote-User'): '$uid',
@ -112,7 +112,7 @@ def domain_add(domains, web=False, main=False):
try: try:
yldap.validate_uniqueness({ 'virtualdomain' : domain }) yldap.validate_uniqueness({ 'virtualdomain' : domain })
except YunoHostError: except YunoHostError:
if web: if not raw:
win_msg(_("Web config created")) win_msg(_("Web config created"))
result.append(domain) result.append(domain)
break break

View file

@ -110,7 +110,7 @@ def tools_maindomain(old_domain, new_domain):
for line in lines: for line in lines:
sources.write(re.sub(r''+ old_domain +'', new_domain, line)) 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 = [ lemon_conf_lines = [
"$tmp->{'domain'} = '"+ new_domain +"';", # Replace Lemon domain "$tmp->{'domain'} = '"+ new_domain +"';", # Replace Lemon domain