hawat.config module

This module contains default configurations for Hawat application. One of the classes defined in this module may be passed as argument to hawat.app.create_app_full() factory function to bootstrap Hawat default configurations. These values may be then optionally overwritten by external configuration file and/or additional configuration file defined indirrectly via environment variable. Please refer to the documentation of hawat.app.create_app_full() factory function for more details on this process.

There are following predefined configuration classess available:

hawat.config.ProductionConfig

Default configuration suite for production environments.

hawat.config.DevelopmentConfig

Default configuration suite for development environments.

hawat.config.TestingConfig

Default configuration suite for testing environments.

There is also following constant structure containing mapping of simple configuration names to configuration classess:

CONFIG_MAP

It is used from inside of hawat.app.create_app() factory method to pick and apply correct configuration class to application. Please refer to the documentation of hawat.app.create_app() factory function for more details on this process.

hawat.config.CONFIG_MAP = {'default': <class 'hawat.config.ProductionConfig'>, 'development': <class 'hawat.config.DevelopmentConfig'>, 'production': <class 'hawat.config.ProductionConfig'>, 'testing': <class 'hawat.config.TestingConfig'>}

Configuration map for easy mapping of configuration aliases to config objects.

class hawat.config.Config[source]

Bases: vial.config.Config

Base class for default configurations of Hawat application. You are free to extend and customize contents of this class to provide better default values for your particular environment.

The configuration keys must be a valid Flask configuration and so they must be written in UPPERCASE to be correctly recognized.

APPLICATION_ID = 'mentat'
APPLICATION_NAME = 'Mentat'
DISABLED_ENDPOINTS = []

List of endpoints disabled on application level.

ENABLED_BLUEPRINTS = ['vial.blueprints.auth', 'vial.blueprints.auth_api', 'vial.blueprints.design_bs3', 'vial.blueprints.devtools', 'vial.blueprints.changelogs', 'hawat.blueprints.auth_env', 'hawat.blueprints.auth_pwd', 'hawat.blueprints.home', 'hawat.blueprints.reports', 'hawat.blueprints.events', 'hawat.blueprints.hosts', 'hawat.blueprints.timeline', 'hawat.blueprints.dnsr', 'hawat.blueprints.geoip', 'hawat.blueprints.whois', 'hawat.blueprints.performance', 'hawat.blueprints.status', 'hawat.blueprints.dbstatus', 'hawat.blueprints.users', 'hawat.blueprints.groups', 'hawat.blueprints.settings_reporting', 'hawat.blueprints.filters', 'hawat.blueprints.networks']

List of requested application blueprints to be loaded during setup.

HAWAT_CHART_TIMELINE_MAXSTEPS = 200

Maximal number of steps (bars) displayed in timeline chart.

HAWAT_LIMIT_AODS = 20

Limit for number of objects for which to automatically fetch additional data services.

HAWAT_REPORT_FEEDBACK_MAILS = ['root@alchemist.cesnet.cz']

List of system administrator emails, that receive feedback messages for reports.

HAWAT_SEARCH_QUERY_QUOTA = 7

Event search query quota per each user.

MAIL_DEFAULT_SENDER = 'mentat@alchemist.cesnet.cz'
MAIL_SUBJECT_PREFIX = '[Mentat]'
MENU_MAIN_SKELETON = [{'entry_type': 'submenu', 'ident': 'dashboards', 'position': 100, 'title': l'Dashboards', 'resptitle': True, 'icon': 'section-dashboards'}, {'entry_type': 'submenu', 'ident': 'more', 'position': 200, 'title': l'More', 'resptitle': True, 'icon': 'section-more'}, {'entry_type': 'submenu', 'ident': 'admin', 'position': 300, 'authentication': True, 'authorization': ['power'], 'title': l'Administration', 'resptitle': True, 'icon': 'section-administration'}, {'entry_type': 'submenu', 'ident': 'developer', 'position': 400, 'authentication': True, 'authorization': ['developer'], 'title': l'Development', 'resptitle': True, 'icon': 'section-development'}]

Configuration of application menu skeleton.

MIGRATE_DIRECTORY = '/home/buildbot/workers/worker-mentat-py3/mentat-doc/build/lib/hawat/migrations'
MODELS = {'group': <class 'mentat.datatype.sqldb.GroupModel'>, 'item_changelog': <class 'mentat.datatype.sqldb.ItemChangeLogModel'>, 'user': <class 'mentat.datatype.sqldb.UserModel'>}

Models to be used within the application.

ROLES = ['user', 'developer', 'maintainer', 'admin']

List of all valid user roles supported by the application.

SQLALCHEMY_SETUP_ARGS = {'metadata': MetaData(bind=None), 'model_class': <class 'sqlalchemy.ext.declarative.api.Base'>, 'query_class': <class 'mentat.services.sqlstorage.RetryingQuery'>}
class hawat.config.DevelopmentConfig[source]

Bases: hawat.config.Config, vial.config.DevelopmentConfig

Class containing application configurations for development environment.

ENABLED_BLUEPRINTS = ['vial.blueprints.auth', 'vial.blueprints.auth_api', 'vial.blueprints.design_bs3', 'vial.blueprints.devtools', 'vial.blueprints.changelogs', 'hawat.blueprints.auth_env', 'hawat.blueprints.auth_dev', 'hawat.blueprints.auth_pwd', 'hawat.blueprints.home', 'hawat.blueprints.reports', 'hawat.blueprints.events', 'hawat.blueprints.hosts', 'hawat.blueprints.timeline', 'hawat.blueprints.dnsr', 'hawat.blueprints.geoip', 'hawat.blueprints.whois', 'hawat.blueprints.performance', 'hawat.blueprints.status', 'hawat.blueprints.dbstatus', 'hawat.blueprints.users', 'hawat.blueprints.groups', 'hawat.blueprints.settings_reporting', 'hawat.blueprints.filters', 'hawat.blueprints.networks']
class hawat.config.ProductionConfig[source]

Bases: hawat.config.Config, vial.config.ProductionConfig

Class containing application configurations for production environment.

class hawat.config.TestingConfig[source]

Bases: hawat.config.Config, vial.config.TestingConfig

Class containing testing Hawat applications` configurations.

ENABLED_BLUEPRINTS = ['vial.blueprints.auth', 'vial.blueprints.auth_api', 'vial.blueprints.design_bs3', 'vial.blueprints.devtools', 'vial.blueprints.changelogs', 'hawat.blueprints.auth_env', 'hawat.blueprints.auth_dev', 'hawat.blueprints.auth_pwd', 'hawat.blueprints.home', 'hawat.blueprints.reports', 'hawat.blueprints.events', 'hawat.blueprints.hosts', 'hawat.blueprints.timeline', 'hawat.blueprints.dnsr', 'hawat.blueprints.geoip', 'hawat.blueprints.whois', 'hawat.blueprints.performance', 'hawat.blueprints.status', 'hawat.blueprints.dbstatus', 'hawat.blueprints.users', 'hawat.blueprints.groups', 'hawat.blueprints.settings_reporting', 'hawat.blueprints.filters', 'hawat.blueprints.networks']
hawat.config.get_app_root_relative_config()[source]

These configurations are relative to APP_ROOT_PATH environment setting and must be handled separately.

hawat.config.get_default_config_file()[source]

Get path to default configuration file based on the environment.