Projet

Général

Profil

Télécharger (3,7 ko) Statistiques
| Branche: | Tag: | Révision:

root / mandaye / global_config.py @ 8f7e157d

1

    
2
import os
3

    
4
_PROJECT_PATH = os.path.join(os.path.dirname(__file__), '..')
5

    
6
# Choose storage
7
# Only mandaye.backends.sql at the moment
8
storage_backend = "mandaye.backends.sql"
9

    
10
## SQL Backend config
11
# Database configuration
12
# http://docs.sqlalchemy.org/en/rel_0_7/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
# urllib2 debug mode
18
debug = False
19

    
20
# Log configuration
21
LOGGING = {
22
        'version': 1,
23
        'disable_existing_loggers': True,
24

    
25
        'formatters': {
26
            'console': {
27
                'format': '%(asctime)s %(levelname)s %(message)s',
28
                'datefmt': '%H:%M:%S',
29
                },
30
            'syslog': {
31
                'format': '%(name)s %(levelname)s %(uuid)s %(message)s',
32
                }
33
            },
34
        'handlers': {
35
            'console': {
36
                'level': 'DEBUG',
37
                'class': 'logging.StreamHandler',
38
                'formatter': 'console'
39
                },
40
            'syslog': {
41
                'level': 'INFO',
42
                'class': 'entrouvert.logging.handlers.SysLogHandler',
43
                'formatter': 'syslog',
44
                'address': '/dev/log',
45
                'max_length': 999,
46
                },
47
            },
48
            'loggers': {
49
                '': {
50
                    'handlers': ['console'],
51
                    'level': 'DEBUG',
52
                    'propagate': False,
53
                    },
54
                'mandaye': {
55
                    'handlers': ['console', 'syslog'],
56
                    'level': 'DEBUG',
57
                    'propagate': False,
58
                    },
59
                },
60
            }
61

    
62
# Template directory
63
template_directory = os.path.join(_PROJECT_PATH, 'mandaye/templates')
64
templates_directories = []
65
# Configuration directory
66
config_root = os.path.join(_PROJECT_PATH, 'conf.d')
67
# Static path
68
static_url = '/mandaye/static'
69
# Static folder
70
static_root = os.path.join(_PROJECT_PATH, 'mandaye/static')
71
# Data dir
72
data_dir = os.path.join(_PROJECT_PATH, 'data')
73
# Skel root
74
skel_root = os.path.join(_PROJECT_PATH, 'mandaye/skel')
75

    
76
# Raven Sentry configuration
77
raven_dsn = None
78

    
79
# Email notification configuration
80
email_notification = False
81
email_prefix='[Mandaye]'
82
smtp_host = 'localhost'
83
smtp_port = 25
84
email_from = 'traceback@entrouvert.com'
85
email_to = ['admin@localhost']
86

    
87
# Template vars
88
template_vars = {}
89

    
90
# Use long traceback with xtraceback
91
use_long_trace = True
92
# Ask Mandaye to auto decompress a response message
93
# Decompress response only if you load a filter
94
auto_decompress = True
95
# Ask mandaye to add a toolbar
96
mandaye_toolbar = True
97
mandaye_offline_toolbar = False
98
# Authentic 2 auto connection
99
a2_auto_connection = False
100

    
101
# Encrypt service provider passwords with a secret
102
# You should install pycypto to use this feature
103
encrypt_sp_password = False
104
# Must be a 16, 24, or 32 bytes long
105
encrypt_secret = ''
106

    
107
alembic_cfg = os.path.join(_PROJECT_PATH, 'mandaye/alembic.ini')
108
alembic_script_path = os.path.join(_PROJECT_PATH, 'mandaye/alembic')
109

    
110
# supported authentification
111
authentifications = {
112
        'saml2': 'mandaye.auth.SAML2Auth'
113
        }
114

    
115
# supported mappers
116
mappers = {}
117

    
118
# beaker session configuration
119
session_opts = {
120
        'session.type': 'file',
121
        'session.cookie_expires': True,
122
        'session.timeout': 3600,
123
        'session.data_dir': '/var/tmp/beaker',
124
        'session.path': '/'
125
        }
126

    
127
# Needed if ssl is activated
128
ssl = False
129
keyfile = ''
130
certfile = ''
131

    
132
if raven_dsn:
133
    LOGGING['handlers']['sentry'] = {
134
            'level': 'ERROR',
135
            'class': 'raven.handlers.logging.SentryHandler',
136
            'dsn': raven_dsn,
137
            }
138
    LOGGING['loggers']['']['handlers'].append('sentry')
(7-7/14)