django-orchestra/orchestra/apps/websites/settings.py

103 lines
3.0 KiB
Python
Raw Normal View History

2014-05-08 16:59:35 +00:00
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
WEBSITES_UNIQUE_NAME_FORMAT = getattr(settings, 'WEBSITES_UNIQUE_NAME_FORMAT',
'%(account)s-%(name)s')
2014-05-08 16:59:35 +00:00
WEBSITES_PORT_CHOICES = getattr(settings, 'WEBSITES_PORT_CHOICES', (
(80, 'HTTP'),
(443, 'HTTPS'),
))
WEBSITES_DEFAULT_PORT = getattr(settings, 'WEBSITES_DEFAULT_PORT', 80)
2014-10-17 15:26:00 +00:00
WEBSITES_DEFAULT_IP = getattr(settings, 'WEBSITES_DEFAULT_IP', '*')
2014-10-17 15:23:02 +00:00
2014-05-08 16:59:35 +00:00
WEBSITES_DOMAIN_MODEL = getattr(settings, 'WEBSITES_DOMAIN_MODEL', 'domains.Domain')
WEBSITES_OPTIONS = getattr(settings, 'WEBSITES_OPTIONS', {
# { name: ( verbose_name, [help_text], validation_regex ) }
2014-05-08 16:59:35 +00:00
'directory_protection': (
_("HTTPD - Directory protection"),
_("Space separated ..."),
r'^([\w/_]+)\s+(\".*\")\s+([\w/_\.]+)$',
2014-05-08 16:59:35 +00:00
),
2014-10-30 16:34:02 +00:00
'redirect': (
2014-05-08 16:59:35 +00:00
_("HTTPD - Redirection"),
2015-02-24 09:34:26 +00:00
_("<tt>&lt;website path&gt; &lt;destination URL&gt;</tt>"),
r'^[^ ]+\s[^ ]+$',
),
'proxy': (
_("HTTPD - Proxy"),
_("<tt>&lt;website path&gt; &lt;target URL&gt;</tt>"),
r'^[^ ]+\shttp[^ ]+(timeout=[0-9]{1,3}|retry=[0-9]|\s)*$',
2014-05-08 16:59:35 +00:00
),
2014-10-30 16:34:02 +00:00
'ssl_ca': (
2014-11-10 15:40:51 +00:00
"HTTPD - SSL CA",
_("Filesystem path of the CA certificate file."),
2014-10-30 16:34:02 +00:00
r'^[^ ]+$'
),
'ssl_cert': (
_("HTTPD - SSL cert"),
_("Filesystem path of the certificate file."),
2014-10-30 16:34:02 +00:00
r'^[^ ]+$'
),
'ssl_key': (
_("HTTPD - SSL key"),
_("Filesystem path of the key file."),
r'^[^ ]+$',
2014-05-08 16:59:35 +00:00
),
'sec_rule_remove': (
2014-11-10 15:40:51 +00:00
"HTTPD - SecRuleRemoveById",
_("Space separated ModSecurity rule IDs."),
r'^[0-9\s]+$',
2014-05-08 16:59:35 +00:00
),
2014-10-30 16:34:02 +00:00
'sec_engine': (
2014-11-10 15:40:51 +00:00
"HTTPD - Modsecurity engine",
_("<tt>On</tt> or <tt>Off</tt>, defaults to On"),
r'^(On|Off)$',
2014-05-08 16:59:35 +00:00
),
2014-11-09 10:16:07 +00:00
'user_group': (
2014-11-10 15:40:51 +00:00
"HTTPD - SuexecUserGroup",
_("<tt>user [group]</tt>, username and optional groupname."),
# TODO validate existing user/group
r'^[\w/_]+(\s[\w/_]+)*$',
2014-11-09 10:16:07 +00:00
),
2014-11-10 15:40:51 +00:00
# TODO backend support
'error_document': (
"HTTPD - ErrorDocumentRoot",
_("&lt;error code&gt; &lt;URL/path/message&gt;<br>"
"<tt>&nbsp;500 http://foo.example.com/cgi-bin/tester</tt><br>"
"<tt>&nbsp;404 /cgi-bin/bad_urls.pl</tt><br>"
"<tt>&nbsp;401 /subscription_info.html</tt><br>"
"<tt>&nbsp;403 \"Sorry can't allow you access today\"</tt>"),
r'[45]0[0-9]\s.*',
)
2014-05-08 16:59:35 +00:00
})
WEBSITES_BASE_APACHE_CONF = getattr(settings, 'WEBSITES_BASE_APACHE_CONF',
'/etc/apache2/')
2014-10-17 20:03:41 +00:00
2014-05-08 16:59:35 +00:00
WEBSITES_WEBALIZER_PATH = getattr(settings, 'WEBSITES_WEBALIZER_PATH',
'/home/httpd/webalizer/')
2015-03-02 10:37:25 +00:00
WEBSITES_WEBSITE_WWW_ACCESS_LOG_PATH = getattr(settings, 'WEBSITES_WEBSITE_WWW_ACCESS_LOG_PATH',
'/var/log/apache2/virtual/%(unique_name)s.log')
2014-11-20 15:34:59 +00:00
2015-03-02 10:37:25 +00:00
WEBSITES_WEBSITE_WWW_ERROR_LOG_PATH = getattr(settings, 'WEBSITES_WEBSITE_WWW_ERROR_LOG_PATH',
'')
2014-11-20 15:34:59 +00:00
WEBSITES_TRAFFIC_IGNORE_HOSTS = getattr(settings, 'WEBSITES_TRAFFIC_IGNORE_HOSTS',
('127.0.0.1',))