1
|
|
2
|
import os
|
3
|
|
4
|
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
|
5
|
|
6
|
# Choose storage
|
7
|
# mandaye.backends.ldap_back or mandaye.backends.sql
|
8
|
storage_backend = "mandaye.backends.sql"
|
9
|
|
10
|
## SQL Backend config
|
11
|
# Database configuration
|
12
|
# http://docs.sqlalchemy.org/en/rel_0_8/core/engines.html
|
13
|
# rfc 1738 https://tools.ietf.org/html/rfc1738
|
14
|
# dialect+driver://username:password@host:port/database
|
15
|
db_url = 'sqlite:///test.db'
|
16
|
|
17
|
## LDAP Backend config
|
18
|
ldap_url = 'ldap://127.0.0.1'
|
19
|
ldap_bind_dn = 'cn=admin,dc=acompany,dc=org'
|
20
|
ldap_bind_password = 'MyPassword'
|
21
|
ldap_base_dn = 'ou=mandaye,dc=acompany,dc=org'
|
22
|
|
23
|
# urllib2 debug mode
|
24
|
debug = False
|
25
|
|
26
|
# Log configuration
|
27
|
LOGGING = {
|
28
|
'version': 1,
|
29
|
'disable_existing_loggers': True,
|
30
|
|
31
|
'formatters': {
|
32
|
'console': {
|
33
|
'format': '%(asctime)s %(levelname)s %(message)s',
|
34
|
'datefmt': '%H:%M:%S',
|
35
|
},
|
36
|
'syslog': {
|
37
|
'format': '%(name)s %(levelname)s %(uuid)s %(message)s',
|
38
|
}
|
39
|
},
|
40
|
'handlers': {
|
41
|
'console': {
|
42
|
'level': 'DEBUG',
|
43
|
'class': 'logging.StreamHandler',
|
44
|
'formatter': 'console'
|
45
|
},
|
46
|
'syslog': {
|
47
|
'level': 'INFO',
|
48
|
'class': 'entrouvert.logging.handlers.SysLogHandler',
|
49
|
'formatter': 'syslog',
|
50
|
'address': '/dev/log',
|
51
|
'max_length': 999,
|
52
|
},
|
53
|
},
|
54
|
'loggers': {
|
55
|
'': {
|
56
|
'handlers': ['console'],
|
57
|
'level': 'DEBUG',
|
58
|
'propagate': False,
|
59
|
},
|
60
|
'mandaye': {
|
61
|
'handlers': ['console', 'syslog'],
|
62
|
'level': 'DEBUG',
|
63
|
'propagate': False,
|
64
|
},
|
65
|
},
|
66
|
}
|
67
|
|
68
|
# Template directory
|
69
|
template_directory = os.path.join(_PROJECT_PATH, 'mandaye/templates')
|
70
|
templates_directories = []
|
71
|
# Configuration directory
|
72
|
config_root = os.path.join(_PROJECT_PATH, 'conf.d')
|
73
|
# Static path
|
74
|
static_url = '/mandaye/static'
|
75
|
# Static folder
|
76
|
static_root = os.path.join(_PROJECT_PATH, 'mandaye/static')
|
77
|
# Data dir
|
78
|
data_dir = os.path.join(_PROJECT_PATH, 'data')
|
79
|
# Skel root
|
80
|
skel_root = os.path.join(_PROJECT_PATH, 'mandaye/skel')
|
81
|
|
82
|
# Raven Sentry configuration
|
83
|
raven_dsn = None
|
84
|
|
85
|
# Email notification configuration
|
86
|
email_notification = False
|
87
|
email_prefix='[Mandaye]'
|
88
|
smtp_host = 'localhost'
|
89
|
smtp_port = 25
|
90
|
email_from = 'traceback@entrouvert.com'
|
91
|
email_to = ['admin@localhost']
|
92
|
|
93
|
# Template vars
|
94
|
template_vars = {}
|
95
|
|
96
|
# Use long traceback with xtraceback
|
97
|
use_long_trace = True
|
98
|
# Ask Mandaye to auto decompress a response message
|
99
|
# Decompress response only if you load a filter
|
100
|
auto_decompress = True
|
101
|
# Ask mandaye to add a toolbar
|
102
|
mandaye_toolbar = True
|
103
|
mandaye_offline_toolbar = False
|
104
|
# Authentic 2 auto connection
|
105
|
a2_auto_connection = False
|
106
|
|
107
|
# Encrypt service provider passwords with a secret
|
108
|
# You should install pycypto to use this feature
|
109
|
encrypt_sp_password = False
|
110
|
# Must be a 16, 24, or 32 bytes long
|
111
|
encrypt_secret = ''
|
112
|
|
113
|
alembic_cfg = os.path.join(_PROJECT_PATH, 'mandaye/alembic.ini')
|
114
|
alembic_script_path = os.path.join(_PROJECT_PATH, 'mandaye/alembic')
|
115
|
|
116
|
# supported authentification
|
117
|
authentifications = {
|
118
|
'saml2': 'mandaye.auth.SAML2Auth'
|
119
|
}
|
120
|
|
121
|
# supported mappers
|
122
|
mappers = {}
|
123
|
|
124
|
# beaker session configuration
|
125
|
session_opts = {
|
126
|
'session.type': 'file',
|
127
|
'session.cookie_expires': True,
|
128
|
'session.timeout': 3600,
|
129
|
'session.data_dir': '/var/tmp/beaker',
|
130
|
'session.path': '/'
|
131
|
}
|
132
|
|
133
|
# Needed if ssl is activated
|
134
|
ssl = False
|
135
|
keyfile = ''
|
136
|
certfile = ''
|
137
|
|
138
|
if raven_dsn:
|
139
|
LOGGING['handlers']['sentry'] = {
|
140
|
'level': 'ERROR',
|
141
|
'class': 'raven.handlers.logging.SentryHandler',
|
142
|
'dsn': raven_dsn,
|
143
|
}
|
144
|
LOGGING['loggers']['']['handlers'].append('sentry')
|