Simon Pirkelmann
38164aca4b
- use blueprint - read configuration from file (default_app_config.py) and additional file specified by APPLICATION_SETTINGS environment variable
55 lines
1.7 KiB
Python
55 lines
1.7 KiB
Python
print("loading default config")
|
|
import bleach
|
|
from flask_security import uia_email_mapper
|
|
|
|
def uia_username_mapper(identity):
|
|
# we allow pretty much anything - but we bleach it.
|
|
return bleach.clean(identity, strip=True)
|
|
|
|
class DefaultConfig(object):
|
|
DEBUG = False
|
|
|
|
SECRET_KEY = 'supersecret'
|
|
|
|
TEMPLATE_FOLDER = 'templates'
|
|
STATIC_FOLDER = 'static'
|
|
|
|
SECURITY_REGISTERABLE = False
|
|
SECURITY_CHANGEABLE = True
|
|
SECURITY_RECOVERABLE = True
|
|
SECURITY_SEND_PASSWORD_CHANGE_EMAIL = False
|
|
|
|
SECURITY_POST_LOGIN_VIEW = '/'
|
|
SECURITY_EMAIL_SUBJECT_PASSWORD_RESET = 'Passwort zurücksetzen'
|
|
SECURITY_EMAIL_SUBJECT_PASSWORD_NOTICE = 'Passwort wurde zurückgesetzt'
|
|
SECURITY_PASSWORD_LENGTH_MIN = 10
|
|
|
|
SECURITY_USER_IDENTITY_ATTRIBUTES = [
|
|
{"email": {"mapper": uia_email_mapper, "case_insensitive": True}},
|
|
{"username": {"mapper": uia_username_mapper}}
|
|
]
|
|
|
|
# mail configuration
|
|
MAIL_SERVER = ''
|
|
MAIL_PORT = 465
|
|
MAIL_USE_SSL = True
|
|
MAIL_USERNAME = ''
|
|
MAIL_PASSWORD = ''
|
|
MAIL_DEFAULT_SENDER = ''
|
|
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:///admin.db'
|
|
# As of Flask-SQLAlchemy 2.4.0 it is easy to pass in options directly to the
|
|
# underlying engine. This option makes sure that DB connections from the
|
|
# pool are still valid. Important for entire application since
|
|
# many DBaaS options automatically close idle connections.
|
|
SQLALCHEMY_ENGINE_OPTIONS = {
|
|
"pool_pre_ping": True,
|
|
}
|
|
|
|
KEY_FILE = '/root/flask_keys'
|
|
TOKEN_FILE = "/etc/door_tokens"
|
|
LDAP_URL = "ldaps://ldap.imaginaerraum.de"
|
|
NFC_SOCKET = "/tmp/nfc.sock"
|
|
LOG_FILE = "/var/log/webinterface.log"
|
|
NFC_LOG = "/var/log/nfc.log"
|
|
MQTT_HOST = '10.10.21.2' |