Fixes on payments and php webapps

This commit is contained in:
Marc Aymerich 2015-06-22 22:38:39 +00:00
parent e0d31f67e4
commit 120506229a
4 changed files with 12 additions and 5 deletions

View File

@ -434,3 +434,5 @@ serailzer self.instance on create.
* backendLog store method and language... and use it for display_script with correct lexer
# process monitor data to represent state, or maybe create new resource datas when period expires?
# DNS when AAAA is specified include default A register?

View File

@ -60,7 +60,10 @@ class WebApp(models.Model):
qs = WebAppOption.objects.filter(**kwargs)
for name, value in qs.values_list('name', 'value').order_by('name'):
if name in options:
options[name] = max(options[name], value)
if AppOption.get(name).comma_separated:
options[name] = options[name].rstrip(',') + ',' + value.lstrip(',')
else:
options[name] = max(options[name], value)
else:
options[name] = value
return options

View File

@ -17,6 +17,7 @@ class AppOption(Plugin):
help_text = ""
group = None
comma_separated = False
@classmethod
@cached
@ -100,6 +101,7 @@ class PHPEnableFunctions(PHPAppOption):
for i in range(0, len(settings.WEBAPPS_PHP_DISABLED_FUNCTIONS), 10)
])
regex = r'^[\w\.,-]+$'
comma_separated = True
class PHPAllowURLInclude(PHPAppOption):

View File

@ -40,7 +40,7 @@ class Apache2Backend(ServiceController):
def render_virtual_host(self, site, context, ssl=False):
context['port'] = self.HTTPS_PORT if ssl else self.HTTP_PORT
context['vhost_wrapper_dirs'] = []
context['vhost_set_fcgid'] = False
extra_conf = self.get_content_directives(site, context)
directives = site.get_directives()
if ssl:
@ -238,10 +238,11 @@ class Apache2Backend(ServiceController):
directives = ''
# This Action trick is used instead of FcgidWrapper because we don't want to define
# a new fcgid process class each time an app is mounted (num proc limits enforcement).
context['wrapper_dir'] = os.path.dirname(wrapper_path)
if context['wrapper_dir'] not in context['vhost_wrapper_dirs']:
if not context['vhost_set_fcgid']:
# fcgi-bin only needs to be defined once per vhots
# We assume that all account wrapper paths will share the same dir
context['wrapper_dir'] = os.path.dirname(wrapper_path)
context['vhost_set_fcgid'] = True
directives = textwrap.dedent("""\
Alias /fcgi-bin/ %(wrapper_dir)s/
<Location /fcgi-bin/>
@ -249,7 +250,6 @@ class Apache2Backend(ServiceController):
Options +ExecCGI
</Location>
""") % context
context['vhost_wrapper_dirs'].append(context['wrapper_dir'])
directives += self.get_location_filesystem_map(context)
directives += textwrap.dedent("""
ProxyPass %(location)s/ !