Projet

Général

Profil

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

root / mandaye / global_config.py @ c62aae38

1

    
2
import os
3

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

    
6
# Choose storage
7
# Only 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

    
18
# urllib2 debug mode
19
debug = False
20

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

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

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

    
77
# Raven Sentry configuration
78
raven_dsn = None
79

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

    
88
# Template vars
89
template_vars = {}
90

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

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

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

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

    
116
# supported mappers
117
mappers = {}
118

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

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

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