This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
mandaye/mandaye/global_config.py

145 lines
3.9 KiB
Python

import os
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
# Choose storage
# mandaye.backends.ldap_back or mandaye.backends.sql
storage_backend = "mandaye.backends.sql"
## SQL Backend config
# Database configuration
# http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html
# rfc 1738 https://tools.ietf.org/html/rfc1738
# dialect+driver://username:password@host:port/database
db_url = 'sqlite:///test.db'
## LDAP Backend config
ldap_url = 'ldap://127.0.0.1'
ldap_bind_dn = 'cn=admin,dc=acompany,dc=org'
ldap_bind_password = 'MyPassword'
ldap_base_dn = 'ou=mandaye,dc=acompany,dc=org'
# urllib2 debug mode
debug = False
# Log configuration
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'console': {
'format': '%(asctime)s %(levelname)s %(message)s',
'datefmt': '%H:%M:%S',
},
'syslog': {
'format': '%(name)s %(levelname)s %(uuid)s %(message)s',
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'console'
},
'syslog': {
'level': 'INFO',
'class': 'entrouvert.logging.handlers.SysLogHandler',
'formatter': 'syslog',
'address': '/dev/log',
'max_length': 999,
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': False,
},
'mandaye': {
'handlers': ['console', 'syslog'],
'level': 'DEBUG',
'propagate': False,
},
},
}
# Template directory
template_directory = os.path.join(_PROJECT_PATH, 'mandaye/templates')
templates_directories = []
# Configuration directory
config_root = os.path.join(_PROJECT_PATH, 'conf.d')
# Static path
static_url = '/mandaye/static'
# Static folder
static_root = os.path.join(_PROJECT_PATH, 'mandaye/static')
# Data dir
data_dir = os.path.join(_PROJECT_PATH, 'data')
# Skel root
skel_root = os.path.join(_PROJECT_PATH, 'mandaye/skel')
# Raven Sentry configuration
raven_dsn = None
# Email notification configuration
email_notification = False
email_prefix='[Mandaye]'
smtp_host = 'localhost'
smtp_port = 25
email_from = 'traceback@entrouvert.com'
email_to = ['admin@localhost']
# Template vars
template_vars = {}
# Use long traceback with xtraceback
use_long_trace = True
# Ask Mandaye to auto decompress a response message
# Decompress response only if you load a filter
auto_decompress = True
# Ask mandaye to add a toolbar
mandaye_toolbar = True
mandaye_offline_toolbar = False
# Authentic 2 auto connection
a2_auto_connection = False
# Encrypt service provider passwords with a secret
# You should install pycypto to use this feature
encrypt_sp_password = False
# Must be a 16, 24, or 32 bytes long
encrypt_secret = ''
alembic_cfg = os.path.join(_PROJECT_PATH, 'mandaye/alembic.ini')
alembic_script_path = os.path.join(_PROJECT_PATH, 'mandaye/alembic')
# supported authentification
authentifications = {
'saml2': 'mandaye.auth.SAML2Auth'
}
# supported mappers
mappers = {}
# beaker session configuration
session_opts = {
'session.type': 'file',
'session.cookie_expires': True,
'session.timeout': 3600,
'session.data_dir': '/var/tmp/beaker',
'session.path': '/'
}
# Needed if ssl is activated
ssl = False
keyfile = ''
certfile = ''
if raven_dsn:
LOGGING['handlers']['sentry'] = {
'level': 'ERROR',
'class': 'raven.handlers.logging.SentryHandler',
'dsn': raven_dsn,
}
LOGGING['loggers']['']['handlers'].append('sentry')