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: object

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.

BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_TIMEZONE = 'UTC'
DEBUG = False
DISABLED_ENDPOINTS = []

List of endpoints disabled on application level.

ENABLED_BLUEPRINTS = ['hawat.blueprints.auth_api', 'hawat.blueprints.auth_env', 'hawat.blueprints.design', '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.devtools', 'hawat.blueprints.users', 'hawat.blueprints.groups', 'hawat.blueprints.settings_reporting', 'hawat.blueprints.filters', 'hawat.blueprints.networks', 'hawat.blueprints.changelogs']

List of requested application blueprints to be loaded during setup.

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

List of system administrator emails.

HAWAT_CHART_TIMELINE_MAXSTEPS = 200

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

HAWAT_ENDPOINT_HOME = 'home.index'

Homepage endpoint.

HAWAT_LIMIT_AODS = 10

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

HAWAT_LOCAL_DEVELOPER_LOGIN = 'account@local'

Developer account for local development login.

HAWAT_LOGIN_MSGCAT = 'info'

Default message category for messages related to user authentication.

HAWAT_LOGIN_REDIRECT = 'home.index'

Default redirection endpoint after login.

HAWAT_LOGIN_VIEW = 'auth_env.login'

Default login view. Users will be redirected to this view in case they are not authenticated, but the authentication is required for the requested endpoint.

HAWAT_LOGOUT_REDIRECT = 'home.index'

Default redirection endpoint after logout.

HAWAT_LOG_DEFAULT_LEVEL = 'info'

Default logging level, case insensitive. One of the values DEBUG, INFO, WARNING, ERROR, CRITICAL.

HAWAT_LOG_EMAIL_LEVEL = 'error'

File logging level, case insensitive. One of the values DEBUG, INFO, WARNING, ERROR, CRITICAL.

HAWAT_LOG_FILE_LEVEL = 'info'

File logging level, case insensitive. One of the values DEBUG, INFO, WARNING, ERROR, CRITICAL.

HAWAT_MENU_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.

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

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

MAIL_DEFAULT_SENDER = 'mentat@alchemist.cesnet.cz'
MAIL_PASSWORD = None
MAIL_PORT = 25
MAIL_SERVER = 'localhost'
MAIL_SUBJECT_PREFIX = '[Mentat]'
MAIL_USERNAME = None
ROLES = ['user', 'developer', 'maintainer', 'admin']

List of all valid user roles supported by the application.

SECRET_KEY = 'default-secret-key'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SUPPORTED_LOCALES = {'cs': 'Česky', 'en': 'English'}

List of all languages (locales) supported by the application.

TESTING = False
WTF_CSRF_ENABLED = True
class hawat.config.DevelopmentConfig[source]

Bases: hawat.config.Config

Class containing application configurations for development environment.

DEBUG = True

Overwrite default hawat.config.Config.DEBUG.

ENABLED_BLUEPRINTS = ['hawat.blueprints.auth_api', 'hawat.blueprints.auth_dev', 'hawat.blueprints.auth_env', 'hawat.blueprints.design', '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.devtools', 'hawat.blueprints.users', 'hawat.blueprints.groups', 'hawat.blueprints.settings_reporting', 'hawat.blueprints.filters', 'hawat.blueprints.networks', 'hawat.blueprints.changelogs']

Overwrite default hawat.config.Config.ENABLED_BLUEPRINTS.

HAWAT_LOGIN_VIEW = 'auth_dev.login'

Overwrite default hawat.config.Config.HAWAT_LOGIN_VIEW.

class hawat.config.ProductionConfig[source]

Bases: hawat.config.Config

Class containing application configurations for production environment.

class hawat.config.TestingConfig[source]

Bases: hawat.config.Config

Class containing testing Hawat applications` configurations.

TESTING = True

Overwrite default hawat.config.Config.TESTING.

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]