vigiboard / vigiboard / config / app_cfg.py @ a45763b4
History | View | Annotate | Download (3.21 KB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
# vim: set fileencoding=utf-8 sw=4 ts=4 et :
|
3 |
"""
|
4 |
Global configuration file for TG2-specific settings in vigiboard.
|
5 |
|
6 |
This file complements development/deployment.ini.
|
7 |
|
8 |
Please note that **all the argument values are strings**. If you want to
|
9 |
convert them into boolean, for example, you should use the
|
10 |
:func:`paste.deploy.converters.asbool` function, as in::
|
11 |
|
12 |
from paste.deploy.converters import asbool
|
13 |
setting = asbool(global_conf.get('the_setting'))
|
14 |
|
15 |
"""
|
16 |
|
17 |
from vigilo.turbogears import VigiloAppConfig |
18 |
|
19 |
import vigiboard |
20 |
from vigiboard import model |
21 |
from vigiboard.lib import app_globals, helpers |
22 |
|
23 |
base_config = VigiloAppConfig('vigiboard')
|
24 |
base_config.renderers = [] |
25 |
|
26 |
base_config.package = vigiboard |
27 |
|
28 |
#Set the default renderer
|
29 |
base_config.default_renderer = 'genshi'
|
30 |
base_config.renderers.append('genshi')
|
31 |
# if you want raw speed and have installed chameleon.genshi
|
32 |
# you should try to use this renderer instead.
|
33 |
# warning: for the moment chameleon does not handle i18n translations
|
34 |
#base_config.renderers.append('chameleon_genshi')
|
35 |
|
36 |
#Configure the base SQLALchemy Setup
|
37 |
base_config.use_sqlalchemy = True
|
38 |
base_config.model = model |
39 |
base_config.DBSession = model.DBSession |
40 |
|
41 |
# Configure the authentication backend
|
42 |
base_config.auth_backend = 'sqlalchemy'
|
43 |
base_config.sa_auth.dbsession = model.DBSession |
44 |
# what is the class you want to use to search for users in the database
|
45 |
base_config.sa_auth.user_class = model.User |
46 |
# what is the class you want to use to search for groups in the database
|
47 |
base_config.sa_auth.group_class = model.UserGroup |
48 |
# what is the class you want to use to search for permissions in the database
|
49 |
base_config.sa_auth.permission_class = model.Permission |
50 |
# The name "groups" is already used for groups of hosts.
|
51 |
# We use "usergroups" when referering to users to avoid confusion.
|
52 |
base_config.sa_auth.translations.groups = 'usergroups'
|
53 |
|
54 |
# override this if you would like to provide a different who plugin for
|
55 |
# managing login and logout of your application
|
56 |
base_config.sa_auth.form_plugin = None
|
57 |
|
58 |
# You may optionally define a page where you want users to be redirected to
|
59 |
# on login:
|
60 |
base_config.sa_auth.post_login_url = '/post_login'
|
61 |
|
62 |
# You may optionally define a page where you want users to be redirected to
|
63 |
# on logout:
|
64 |
base_config.sa_auth.post_logout_url = '/post_logout'
|
65 |
|
66 |
|
67 |
##################################
|
68 |
# Settings specific to Vigiboard #
|
69 |
##################################
|
70 |
|
71 |
# Vigiboard version
|
72 |
base_config['vigilo_version'] = u'2.0-pre0.1' |
73 |
|
74 |
# Links configuration
|
75 |
# XXX Should be part of ini settings.
|
76 |
# Les elements suivants peuvent etre utilises dans la chaine de formatage :
|
77 |
# - idcorrevent : identifiant de l'aggregat (alerte correlee)
|
78 |
# - host : le nom de l'hote concerne par l'alerte
|
79 |
# - service : le nom du service concerne par l'alerte
|
80 |
base_config['vigiboard_links.eventdetails'] = {
|
81 |
'nagios': ['Nagios host details', 'http://example1.com/%(idcorrevent)d'], |
82 |
'metrology': ['Metrology details', 'http://example2.com/%(idcorrevent)d'], |
83 |
'security': ['Security details', 'http://example3.com/%(idcorrevent)d'], |
84 |
'servicetype': ['Service Type', 'http://example4.com/%(idcorrevent)d'], |
85 |
} |
86 |
|
87 |
# Plugins to use
|
88 |
# XXX Should be part of ini settings.
|
89 |
base_config['vigiboard_plugins'] = [
|
90 |
['shn', 'PluginSHN'], |
91 |
] |
92 |
|