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 * 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? # 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,6 +60,9 @@ class WebApp(models.Model):
qs = WebAppOption.objects.filter(**kwargs) qs = WebAppOption.objects.filter(**kwargs)
for name, value in qs.values_list('name', 'value').order_by('name'): for name, value in qs.values_list('name', 'value').order_by('name'):
if name in options: if name in options:
if AppOption.get(name).comma_separated:
options[name] = options[name].rstrip(',') + ',' + value.lstrip(',')
else:
options[name] = max(options[name], value) options[name] = max(options[name], value)
else: else:
options[name] = value options[name] = value

View file

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

View file

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