2024-04-29 18:06:20 +00:00
|
|
|
from orchestra.contrib.settings import Setting
|
2023-11-21 11:48:39 +00:00
|
|
|
from collections import defaultdict
|
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
|
|
|
|
def getsetting(name):
|
|
|
|
value = getattr(settings, name, None)
|
|
|
|
return value or DEFAULTS.get(name)
|
|
|
|
|
|
|
|
# provide a default value allowing to overwrite it for each type of account
|
|
|
|
def allowed_resources_default_factory():
|
2024-06-13 18:42:49 +00:00
|
|
|
return {'mailbox': 2, 'database': 1, 'account': 2, 'nextcloud': 2,}
|
2023-11-21 11:48:39 +00:00
|
|
|
|
|
|
|
DEFAULTS = {
|
|
|
|
# allowed resources limit hardcoded because cannot be retrieved from the API.
|
|
|
|
"ALLOWED_RESOURCES": defaultdict(
|
|
|
|
allowed_resources_default_factory,
|
|
|
|
{
|
|
|
|
'INDIVIDUAL':
|
|
|
|
{
|
|
|
|
# 'disk': 1024,
|
|
|
|
# 'traffic': 2048,
|
|
|
|
'mailbox': 2,
|
2024-06-13 18:42:49 +00:00
|
|
|
'database': 1,
|
|
|
|
'account': 2,
|
|
|
|
'nextcloud': 2,
|
2023-11-21 11:48:39 +00:00
|
|
|
},
|
|
|
|
'ASSOCIATION': {
|
|
|
|
# 'disk': 5 * 1024,
|
|
|
|
# 'traffic': 20 * 1024,
|
|
|
|
'mailbox': 10,
|
2024-06-13 18:42:49 +00:00
|
|
|
'database': 1,
|
|
|
|
'account': 8,
|
|
|
|
'nextcloud': 10,
|
2023-11-21 11:48:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"URL_DB_PHPMYADMIN": "https://phpmyadmin.pangea.org/",
|
|
|
|
"URL_MAILTRAIN": "https://grups.pangea.org/",
|
|
|
|
"URL_SAAS_GITLAB": "https://gitlab.pangea.org/",
|
|
|
|
"URL_SAAS_OWNCLOUD": "https://nextcloud.pangea.org/",
|
|
|
|
"URL_SAAS_WORDPRESS": "https://blog.pangea.org/",
|
|
|
|
}
|
|
|
|
|
|
|
|
ALLOWED_RESOURCES = getsetting("ALLOWED_RESOURCES")
|
|
|
|
|
|
|
|
URL_DB_PHPMYADMIN = getsetting("URL_DB_PHPMYADMIN")
|
|
|
|
|
|
|
|
URL_MAILTRAIN = getsetting("URL_MAILTRAIN")
|
|
|
|
|
|
|
|
URL_SAAS_GITLAB = getsetting("URL_SAAS_GITLAB")
|
|
|
|
|
|
|
|
URL_SAAS_OWNCLOUD = getsetting("URL_SAAS_OWNCLOUD")
|
|
|
|
|
|
|
|
URL_SAAS_WORDPRESS = getsetting("URL_SAAS_WORDPRESS")
|
2024-04-29 18:06:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
MUSICIAN_EDIT_ENABLE_PHP_OPTIONS = Setting('MUSICIAN_EDIT_ENABLE_PHP_OPTIONS', (
|
|
|
|
'public-root',
|
|
|
|
'timeout',
|
|
|
|
'max_input_time',
|
|
|
|
'max_input_vars',
|
|
|
|
'memory_limit',
|
|
|
|
'post_max_size',
|
|
|
|
'upload_max_filesize',
|
|
|
|
))
|
2024-05-22 18:45:16 +00:00
|
|
|
|
|
|
|
MUSICIAN_WEBSITES_ENABLE_GROUP_DIRECTIVE = Setting('MUSICIAN_WEBSITES_ENABLE_GROUP_DIRECTIVE', (
|
|
|
|
'HTTPD',
|
|
|
|
),
|
|
|
|
help_text="Valid groups: HTTPD, ModSecurity, SSL, SaaS"
|
|
|
|
)
|
2024-11-18 11:35:25 +00:00
|
|
|
|
|
|
|
LANGUAGES = [
|
|
|
|
('en', 'English'),
|
|
|
|
('es', 'Spanish'),
|
|
|
|
('ca', 'Catalan'),
|
|
|
|
]
|