127 lines
3.4 KiB
Python
127 lines
3.4 KiB
Python
import logging
|
|
import os
|
|
|
|
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
|
|
|
|
## SQL Backend config
|
|
# Database configuration
|
|
# http://docs.sqlalchemy.org/en/rel_0_7/core/engines.html
|
|
# rfc 1738 https://tools.ietf.org/html/rfc1738
|
|
# dialect+driver://username:password@host:port/database
|
|
db_url = 'sqlite:///' + os.path.join(_PROJECT_PATH, '{project_name}.db')
|
|
|
|
debug = False
|
|
|
|
# Log configuration
|
|
LOGGING = {{
|
|
'version': 1,
|
|
'disable_existing_loggers': True,
|
|
|
|
'formatters': {{
|
|
'console': {{
|
|
'format': '%(asctime)s %(levelname)s %(message)s',
|
|
'datefmt': '%H:%M:%S',
|
|
}},
|
|
'file': {{
|
|
'format': '%(asctime)s %(levelname)s %(uuid)s %(message)s',
|
|
'datefmt': '%Y-%m-%d %H:%M:%S'
|
|
}}
|
|
}},
|
|
'handlers': {{
|
|
'console': {{
|
|
'level': 'DEBUG',
|
|
'class': 'logging.StreamHandler',
|
|
'formatter': 'console'
|
|
}},
|
|
'syslog': {{
|
|
'level': 'INFO',
|
|
'class': 'entrouvert.logging.handlers.SysLogHandler',
|
|
'formatter': 'file',
|
|
'address': '/dev/log'
|
|
}},
|
|
}},
|
|
'loggers': {{
|
|
'': {{
|
|
'handlers': ['console'],
|
|
'level': 'DEBUG',
|
|
'propagate': False,
|
|
}},
|
|
'mandaye': {{
|
|
'handlers': ['console', 'syslog'],
|
|
'level': 'DEBUG',
|
|
'propagate': False,
|
|
}},
|
|
'{project_name}': {{
|
|
'handlers': ['console', 'syslog'],
|
|
'level': 'DEBUG',
|
|
'propagate': False,
|
|
}},
|
|
}},
|
|
}}
|
|
|
|
|
|
## PATH
|
|
# Template directory
|
|
template_directory = os.path.join(_PROJECT_PATH, '{project_name}/templates')
|
|
# Configuration directory
|
|
config_root = os.path.join(_PROJECT_PATH, 'conf.d')
|
|
# Static url
|
|
static_url = '/mandaye/static'
|
|
# Static folder
|
|
static_root = os.path.join(_PROJECT_PATH, '{project_name}/static')
|
|
# Data dir
|
|
data_dir = os.path.join(_PROJECT_PATH, 'data')
|
|
|
|
# Raven Sentry configuration
|
|
raven_dsn = None
|
|
|
|
# Email notification configuration
|
|
email_notification = False
|
|
email_prefix = '[Mandaye {project_name}]'
|
|
smtp_host = 'localhost'
|
|
smtp_port = 25
|
|
email_from = 'traceback@entrouvert.com'
|
|
email_to = ['admin@localhost']
|
|
|
|
# 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
|
|
|
|
# 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 = ''
|
|
|
|
# Supported authentification
|
|
authentifications = {{
|
|
'saml2': 'mandaye.auth.saml2.SAML2Auth'
|
|
}}
|
|
|
|
# sp mappers
|
|
mappers = {{
|
|
'linuxfr': '{project_name}.mappers.linuxfr_example'
|
|
}}
|
|
|
|
# Beaker session configuration
|
|
session_opts = {{
|
|
'session.type': 'file',
|
|
'session.cookie_expires': True,
|
|
'session.timeout': 3600,
|
|
'session.data_dir': '/var/tmp/beaker'
|
|
}}
|
|
|
|
# Choose storage
|
|
# Only mandaye.backends.sql at the moment
|
|
storage_backend = "mandaye.backends.sql"
|
|
|
|
# Import local config
|
|
try:
|
|
from ..{project_name}.local_config import *
|
|
except:
|
|
pass
|
|
|