vigiboard / vigiboard / config / app_cfg.py @ 10848680
History | View | Annotate | Download (3.45 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 |
# Pour gérer les thèmes, la notation "pointée" n'est pas utilisée.
|
27 |
# À la place, on indique le nom complet du template (ex: "index.html")
|
28 |
# lors de l'appel au décorateur @expose.
|
29 |
base_config.use_dotted_templatenames = False
|
30 |
|
31 |
# On définit la variable à False. En réalité, le comportement
|
32 |
# est le même que si elle valait toujours True, sauf que l'on
|
33 |
# met en place les middlewares nous même pour pouvoir gérer les
|
34 |
# thèmes (cf. ./middleware.py).
|
35 |
base_config.serve_static = False
|
36 |
|
37 |
base_config.package = vigiboard |
38 |
|
39 |
#Set the default renderer
|
40 |
base_config.default_renderer = 'genshi'
|
41 |
base_config.renderers.append('genshi')
|
42 |
# if you want raw speed and have installed chameleon.genshi
|
43 |
# you should try to use this renderer instead.
|
44 |
# warning: for the moment chameleon does not handle i18n translations
|
45 |
#base_config.renderers.append('chameleon_genshi')
|
46 |
|
47 |
#Configure the base SQLALchemy Setup
|
48 |
base_config.use_sqlalchemy = True
|
49 |
base_config.model = model |
50 |
base_config.DBSession = model.DBSession |
51 |
|
52 |
# Configure the authentication backend
|
53 |
base_config.auth_backend = 'sqlalchemy'
|
54 |
base_config.sa_auth.dbsession = model.DBSession |
55 |
# what is the class you want to use to search for users in the database
|
56 |
base_config.sa_auth.user_class = model.User |
57 |
# what is the class you want to use to search for groups in the database
|
58 |
base_config.sa_auth.group_class = model.UserGroup |
59 |
# what is the class you want to use to search for permissions in the database
|
60 |
base_config.sa_auth.permission_class = model.Permission |
61 |
# The name "groups" is already used for groups of hosts.
|
62 |
# We use "usergroups" when referering to users to avoid confusion.
|
63 |
base_config.sa_auth.translations.groups = 'usergroups'
|
64 |
|
65 |
# override this if you would like to provide a different who plugin for
|
66 |
# managing login and logout of your application
|
67 |
base_config.sa_auth.form_plugin = None
|
68 |
|
69 |
# You may optionally define a page where you want users to be redirected to
|
70 |
# on login:
|
71 |
base_config.sa_auth.post_login_url = '/post_login'
|
72 |
|
73 |
# You may optionally define a page where you want users to be redirected to
|
74 |
# on logout:
|
75 |
base_config.sa_auth.post_logout_url = '/post_logout'
|
76 |
|
77 |
|
78 |
##################################
|
79 |
# Settings specific to Vigiboard #
|
80 |
##################################
|
81 |
|
82 |
# Vigiboard version
|
83 |
base_config['vigiboard_version'] = u'0.1' |
84 |
|
85 |
# Links configuration
|
86 |
# XXX Should be part of ini settings.
|
87 |
base_config['vigiboard_links.eventdetails'] = {
|
88 |
'nagios': ['Nagios host details', 'http://example1.com/%(idaggregate)s'], |
89 |
'metrology': ['Metrology details', 'http://example2.com/%(idaggregate)s'], |
90 |
'security': ['Security details', 'http://example3.com/%(idaggregate)s'], |
91 |
'servicetype': ['Service Type', 'http://example4.com/%(idaggregate)s'], |
92 |
} |
93 |
|
94 |
# Plugins to use
|
95 |
# XXX Should be part of ini settings.
|
96 |
base_config['vigiboard_plugins'] = [
|
97 |
['shn', 'PluginSHN'], |
98 |
] |
99 |
|