2014-05-08 16:59:35 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
|
|
2014-10-24 10:16:46 +00:00
|
|
|
WEBAPPS_BASE_ROOT = getattr(settings, 'WEBAPPS_BASE_ROOT', '%(home)s/webapps/%(app_name)s/')
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_FPM_LISTEN = getattr(settings, 'WEBAPPS_FPM_LISTEN',
|
|
|
|
# '/var/run/%(user)s-%(app_name)s.sock')
|
|
|
|
'127.0.0.1:%(fpm_port)s')
|
|
|
|
|
2014-10-14 13:50:19 +00:00
|
|
|
|
2014-10-27 13:29:02 +00:00
|
|
|
WEBAPPS_ALLOW_BLANK_NAME = getattr(settings, 'WEBAPPS_ALLOW_BLANK_NAME', False)
|
|
|
|
|
|
|
|
# Default name when blank
|
|
|
|
WEBAPPS_BLANK_NAME = getattr(settings, 'WEBAPPS_BLANK_NAME', 'webapp')
|
|
|
|
|
|
|
|
|
2014-05-08 16:59:35 +00:00
|
|
|
WEBAPPS_FPM_START_PORT = getattr(settings, 'WEBAPPS_FPM_START_PORT', 10000)
|
|
|
|
|
2014-10-14 13:50:19 +00:00
|
|
|
|
|
|
|
WEBAPPS_PHPFPM_POOL_PATH = getattr(settings, 'WEBAPPS_PHPFPM_POOL_PATH',
|
2014-10-24 12:18:49 +00:00
|
|
|
'/etc/php5/fpm/pool.d/%(user)s-%(app_name)s.conf')
|
2014-10-14 13:50:19 +00:00
|
|
|
|
|
|
|
|
2014-05-08 16:59:35 +00:00
|
|
|
WEBAPPS_FCGID_PATH = getattr(settings, 'WEBAPPS_FCGID_PATH',
|
2014-11-05 20:22:01 +00:00
|
|
|
'/home/httpd/fcgid/%(user)s/%(app_name)s-wrapper')
|
2014-05-08 16:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_TYPES = getattr(settings, 'WEBAPPS_TYPES', {
|
2014-10-24 10:16:46 +00:00
|
|
|
'php5.5': {
|
2014-11-11 12:05:47 +00:00
|
|
|
'verbose_name': "PHP 5.5 fpm",
|
2014-05-08 16:59:35 +00:00
|
|
|
# 'fpm', ('unix:/var/run/%(user)s-%(app_name)s.sock|fcgi://127.0.0.1%(app_path)s',),
|
2014-10-24 10:16:46 +00:00
|
|
|
'directive': ('fpm', 'fcgi://{}%(app_path)s'.format(WEBAPPS_FPM_LISTEN)),
|
|
|
|
'help_text': _("This creates a PHP5.5 application under ~/webapps/<app_name><br>"
|
|
|
|
"PHP-FPM will be used to execute PHP files.")
|
|
|
|
},
|
|
|
|
'php5.2': {
|
2014-11-11 12:05:47 +00:00
|
|
|
'verbose_name': "PHP 5.2 fcgi",
|
2014-10-24 10:16:46 +00:00
|
|
|
'directive': ('fcgi', WEBAPPS_FCGID_PATH),
|
|
|
|
'help_text': _("This creates a PHP5.2 application under ~/webapps/<app_name><br>"
|
|
|
|
"Apache-mod-fcgid will be used to execute PHP files.")
|
|
|
|
},
|
|
|
|
'php4': {
|
2014-11-11 12:05:47 +00:00
|
|
|
'verbose_name': "PHP 4 fcgi",
|
2014-10-24 10:16:46 +00:00
|
|
|
'directive': ('fcgi', WEBAPPS_FCGID_PATH,),
|
|
|
|
'help_text': _("This creates a PHP4 application under ~/webapps/<app_name><br>"
|
|
|
|
"Apache-mod-fcgid will be used to execute PHP files.")
|
|
|
|
},
|
|
|
|
'static': {
|
|
|
|
'verbose_name': _("Static"),
|
|
|
|
'directive': ('static',),
|
|
|
|
'help_text': _("This creates a Static application under ~/webapps/<app_name><br>"
|
|
|
|
"Apache2 will be used to serve static content and execute CGI files.")
|
|
|
|
},
|
|
|
|
'webalizer': {
|
|
|
|
'verbose_name': "Webalizer",
|
|
|
|
'directive': ('static', '%(app_path)s%(site_name)s'),
|
2014-11-10 15:15:37 +00:00
|
|
|
'help_text': _("This creates a Webalizer application under "
|
|
|
|
"~/webapps/<app_name>-<site_name>")
|
2014-10-24 10:16:46 +00:00
|
|
|
},
|
2014-11-27 19:17:26 +00:00
|
|
|
'wordpress-mu': {
|
|
|
|
'verbose_name': _("Wordpress (SaaS)"),
|
|
|
|
'directive': ('fpm', 'fcgi://127.0.0.1:8990/home/httpd/wordpress-mu/'),
|
|
|
|
'help_text': _("This creates a Wordpress site on a multi-tenant Wordpress server.<br>"
|
|
|
|
"By default this blog is accessible via <app_name>.blogs.orchestra.lan")
|
|
|
|
},
|
|
|
|
'dokuwiki-mu': {
|
|
|
|
'verbose_name': _("DokuWiki (SaaS)"),
|
|
|
|
'directive': ('alias', '/home/httpd/wikifarm/farm/'),
|
|
|
|
'help_text': _("This create a Dokuwiki wiki into a shared Dokuwiki server.<br>"
|
|
|
|
"By default this wiki is accessible via <app_name>.wikis.orchestra.lan")
|
|
|
|
},
|
|
|
|
'drupal-mu': {
|
|
|
|
'verbose_name': _("Drupdal (SaaS)"),
|
|
|
|
'directive': ('fpm', 'fcgi://127.0.0.1:8991/home/httpd/drupal-mu/'),
|
|
|
|
'help_text': _("This creates a Drupal site into a multi-tenant Drupal server.<br>"
|
|
|
|
"The installation will be completed after visiting "
|
|
|
|
"http://<app_name>.drupal.orchestra.lan/install.php?profile=standard<br>"
|
|
|
|
"By default this site will be accessible via <app_name>.drupal.orchestra.lan")
|
|
|
|
}
|
2014-05-08 16:59:35 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
|
2014-10-30 16:34:02 +00:00
|
|
|
WEBAPPS_TYPES_OVERRIDE = getattr(settings, 'WEBAPPS_TYPES_OVERRIDE', {})
|
|
|
|
for webapp_type, value in WEBAPPS_TYPES_OVERRIDE.iteritems():
|
|
|
|
if value is None:
|
|
|
|
WEBAPPS_TYPES.pop(webapp_type, None)
|
|
|
|
else:
|
|
|
|
WEBAPPS_TYPES[webapp_type] = value
|
|
|
|
|
|
|
|
|
2014-05-08 16:59:35 +00:00
|
|
|
WEBAPPS_DEFAULT_TYPE = getattr(settings, 'WEBAPPS_DEFAULT_TYPE', 'php5.5')
|
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_DEFAULT_HTTPS_CERT = getattr(settings, 'WEBAPPS_DEFAULT_HTTPS_CERT',
|
|
|
|
('/etc/apache2/cert', '/etc/apache2/cert.key')
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2014-11-10 15:03:34 +00:00
|
|
|
WEBAPPS_PHP_DISABLED_FUNCTIONS = getattr(settings, 'WEBAPPS_PHP_DISABLED_FUNCTION', [
|
|
|
|
'exec',
|
|
|
|
'passthru',
|
|
|
|
'shell_exec',
|
|
|
|
'system',
|
|
|
|
'proc_open',
|
|
|
|
'popen',
|
|
|
|
'curl_exec',
|
|
|
|
'curl_multi_exec',
|
|
|
|
'show_source',
|
|
|
|
'pcntl_exec',
|
|
|
|
'proc_close',
|
|
|
|
'proc_get_status',
|
|
|
|
'proc_nice',
|
|
|
|
'proc_terminate',
|
|
|
|
'ini_alter',
|
|
|
|
'virtual',
|
|
|
|
'openlog',
|
|
|
|
'escapeshellcmd',
|
|
|
|
'escapeshellarg',
|
|
|
|
'dl'
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2014-05-08 16:59:35 +00:00
|
|
|
WEBAPPS_OPTIONS = getattr(settings, 'WEBAPPS_OPTIONS', {
|
2014-11-10 15:03:34 +00:00
|
|
|
# { name: ( verbose_name, [help_text], validation_regex ) }
|
2015-02-24 09:34:26 +00:00
|
|
|
# Filesystem
|
|
|
|
'public-root': (
|
|
|
|
_("Public root"),
|
|
|
|
_("Document root relative to webapps/<webapp>/"),
|
|
|
|
r'[^ ]+',
|
|
|
|
),
|
2014-11-11 12:05:47 +00:00
|
|
|
# Processes
|
|
|
|
'timeout': (
|
|
|
|
_("Process timeout"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Maximum time in seconds allowed for a request to complete "
|
|
|
|
"(a number between 0 and 999)."),
|
2014-11-11 12:05:47 +00:00
|
|
|
# FCGID FcgidIOTimeout
|
|
|
|
# FPM pm.request_terminate_timeout
|
|
|
|
# PHP max_execution_time ini
|
|
|
|
r'^[0-9]{1,3}$',
|
|
|
|
),
|
|
|
|
'processes': (
|
|
|
|
_("Number of processes"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Maximum number of children that can be alive at the same time "
|
|
|
|
"(a number between 0 and 9)."),
|
2014-11-11 12:05:47 +00:00
|
|
|
# FCGID MaxProcesses
|
|
|
|
# FPM pm.max_children
|
|
|
|
r'^[0-9]$',
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
# PHP
|
2014-11-11 12:05:47 +00:00
|
|
|
'php-enabled_functions': (
|
2014-05-08 16:59:35 +00:00
|
|
|
_("PHP - Enabled functions"),
|
2014-11-10 15:03:34 +00:00
|
|
|
' '.join(WEBAPPS_PHP_DISABLED_FUNCTIONS),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[\w\.,-]+$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-allow_url_include': (
|
|
|
|
_("PHP - Allow URL include"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Allows the use of URL-aware fopen wrappers with include, include_once, require, "
|
|
|
|
"require_once (On or Off)."),
|
2014-05-08 16:59:35 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-10-30 16:34:02 +00:00
|
|
|
'PHP-allow_url_fopen': (
|
|
|
|
_("PHP - allow_url_fopen"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Enables the URL-aware fopen wrappers that enable accessing URL object like files "
|
|
|
|
"(On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
'PHP-auto_append_file': (
|
|
|
|
_("PHP - Auto append file"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Specifies the name of a file that is automatically parsed after the main file."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[\w\.,-/]+$'
|
|
|
|
),
|
|
|
|
'PHP-auto_prepend_file': (
|
|
|
|
_("PHP - Auto prepend file"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Specifies the name of a file that is automatically parsed before the main file."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[\w\.,-/]+$'
|
|
|
|
),
|
|
|
|
'PHP-date.timezone': (
|
|
|
|
_("PHP - date.timezone"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Sets the default timezone used by all date/time functions "
|
|
|
|
"(Timezone string 'Europe/London')."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^\w+/\w+$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-default_socket_timeout': (
|
|
|
|
_("PHP - Default socket timeout"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("Number between 0 and 999."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-display_errors': (
|
|
|
|
_("PHP - Display errors"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("determines whether errors should be printed to the screen as part of the output or "
|
|
|
|
"if they should be hidden from the user (On or Off)."),
|
2014-05-08 16:59:35 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-10-30 16:34:02 +00:00
|
|
|
'PHP-extension': (
|
|
|
|
_("PHP - Extension"),
|
|
|
|
r'^[^ ]+$'
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
'PHP-magic_quotes_gpc': (
|
|
|
|
_("PHP - Magic quotes GPC"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Sets the magic_quotes state for GPC (Get/Post/Cookie) operations (On or Off) "
|
|
|
|
"<b>DEPRECATED as of PHP 5.3.0</b>."),
|
2014-05-08 16:59:35 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-10-30 16:34:02 +00:00
|
|
|
'PHP-magic_quotes_runtime': (
|
|
|
|
_("PHP - Magic quotes runtime"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Functions that return data from any sort of external source will have quotes escaped "
|
|
|
|
"with a backslash (On or Off) <b>DEPRECATED as of PHP 5.3.0</b>."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
|
|
|
'PHP-magic_quotes_sybase': (
|
|
|
|
_("PHP - Magic quotes sybase"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Single-quote is escaped with a single-quote instead of a backslash (On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
'PHP-max_execution_time': (
|
|
|
|
_("PHP - Max execution time"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Maximum time in seconds a script is allowed to run before it is terminated by "
|
|
|
|
"the parser (Integer between 0 and 999)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-max_input_time': (
|
|
|
|
_("PHP - Max input time"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Maximum time in seconds a script is allowed to parse input data, like POST and GET "
|
|
|
|
"(Integer between 0 and 999)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
2015-02-24 09:34:26 +00:00
|
|
|
'PHP-max_input_vars': (
|
|
|
|
_("PHP - Max input vars"),
|
|
|
|
_("How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately) "
|
|
|
|
"(Integer between 0 and 9999)."),
|
|
|
|
r'^[0-9]{1,4}$'
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
'PHP-memory_limit': (
|
|
|
|
_("PHP - Memory limit"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("This sets the maximum amount of memory in bytes that a script is allowed to allocate "
|
|
|
|
"(Value between 0M and 999M)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}M$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-mysql.connect_timeout': (
|
|
|
|
_("PHP - Mysql connect timeout"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("Number between 0 and 999."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^([0-9]){1,3}$'
|
|
|
|
),
|
|
|
|
'PHP-output_buffering': (
|
|
|
|
_("PHP - output_buffering"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Turn on output buffering (On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
|
|
|
'PHP-register_globals': (
|
|
|
|
_("PHP - Register globals"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) "
|
|
|
|
"variables as global variables (On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-post_max_size': (
|
|
|
|
_("PHP - Post max size"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Sets max size of post data allowed (Value between 0M and 999M)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}M$'
|
|
|
|
),
|
|
|
|
'PHP-sendmail_path': (
|
|
|
|
_("PHP - sendmail_path"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Where the sendmail program can be found."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[^ ]+$'
|
|
|
|
),
|
|
|
|
'PHP-session.bug_compat_warn': (
|
|
|
|
_("PHP - session.bug_compat_warn"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Enables an PHP bug on session initialization for legacy behaviour (On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
|
|
|
'PHP-session.auto_start': (
|
|
|
|
_("PHP - session.auto_start"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Specifies whether the session module starts a session automatically on request "
|
|
|
|
"startup (On or Off)."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-safe_mode': (
|
|
|
|
_("PHP - Safe mode"),
|
2014-11-13 16:40:42 +00:00
|
|
|
_("Whether to enable PHP's safe mode (On or Off) <b>DEPRECATED as of PHP 5.3.0</b>"),
|
2014-05-08 16:59:35 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
|
|
|
'PHP-suhosin.post.max_vars': (
|
2015-02-24 09:34:26 +00:00
|
|
|
_("PHP - Suhosin POST max vars"),
|
|
|
|
_("Number between 0 and 9999."),
|
|
|
|
r'^[0-9]{1,4}$'
|
|
|
|
),
|
|
|
|
'PHP-suhosin.get.max_vars': (
|
|
|
|
_("PHP - Suhosin GET max vars"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("Number between 0 and 9999."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,4}$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-suhosin.request.max_vars': (
|
|
|
|
_("PHP - Suhosin request max vars"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("Number between 0 and 9999."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,4}$'
|
|
|
|
),
|
|
|
|
'PHP-suhosin.session.encrypt': (
|
|
|
|
_("PHP - suhosin.session.encrypt"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("On or Off"),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
2014-05-08 16:59:35 +00:00
|
|
|
),
|
|
|
|
'PHP-suhosin.simulation': (
|
|
|
|
_("PHP - Suhosin simulation"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("On or Off"),
|
2014-05-08 16:59:35 +00:00
|
|
|
r'^(On|Off|on|off)$'
|
|
|
|
),
|
2014-10-30 16:34:02 +00:00
|
|
|
'PHP-suhosin.executor.include.whitelist': (
|
|
|
|
_("PHP - suhosin.executor.include.whitelist"),
|
2014-11-05 20:22:01 +00:00
|
|
|
r'.*$'
|
2014-10-30 16:34:02 +00:00
|
|
|
),
|
|
|
|
'PHP-upload_max_filesize': (
|
|
|
|
_("PHP - upload_max_filesize"),
|
2014-11-10 15:03:34 +00:00
|
|
|
_("Value between 0M and 999M."),
|
2014-10-30 16:34:02 +00:00
|
|
|
r'^[0-9]{1,3}M$'
|
|
|
|
),
|
|
|
|
'PHP-zend_extension': (
|
|
|
|
_("PHP - zend_extension"),
|
|
|
|
r'^[^ ]+$'
|
|
|
|
),
|
2014-05-08 16:59:35 +00:00
|
|
|
})
|
2014-11-27 19:17:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_WORDPRESSMU_ADMIN_PASSWORD = getattr(settings, 'WEBAPPS_WORDPRESSMU_ADMIN_PASSWORD',
|
|
|
|
'secret')
|
|
|
|
|
|
|
|
WEBAPPS_WORDPRESSMU_BASE_URL = getattr(settings, 'WEBAPPS_WORDPRESSMU_BASE_URL',
|
|
|
|
'http://blogs.orchestra.lan/')
|
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_DOKUWIKIMU_TEMPLATE_PATH = getattr(settings, 'WEBAPPS_DOKUWIKIMU_TEMPLATE_PATH',
|
|
|
|
'/home/httpd/htdocs/wikifarm/template.tar.gz')
|
|
|
|
|
|
|
|
WEBAPPS_DOKUWIKIMU_FARM_PATH = getattr(settings, 'WEBAPPS_DOKUWIKIMU_FARM_PATH',
|
|
|
|
'/home/httpd/htdocs/wikifarm/farm')
|
|
|
|
|
|
|
|
|
|
|
|
WEBAPPS_DRUPAL_SITES_PATH = getattr(settings, 'WEBAPPS_DRUPAL_SITES_PATH',
|
|
|
|
'/home/httpd/htdocs/drupal-mu/sites/%(site_name)s')
|