2022-01-25 20:42:35 +00:00
|
|
|
import bleach
|
|
|
|
from flask_security import uia_email_mapper
|
2022-09-12 20:21:21 +00:00
|
|
|
print("loading default config")
|
|
|
|
|
2022-01-25 20:42:35 +00:00
|
|
|
|
|
|
|
def uia_username_mapper(identity):
|
|
|
|
# we allow pretty much anything - but we bleach it.
|
|
|
|
return bleach.clean(identity, strip=True)
|
|
|
|
|
2022-09-12 20:21:21 +00:00
|
|
|
|
2022-01-25 20:42:35 +00:00
|
|
|
class DefaultConfig(object):
|
|
|
|
DEBUG = False
|
|
|
|
|
|
|
|
SECRET_KEY = 'supersecret'
|
2022-02-04 21:38:26 +00:00
|
|
|
SECURITY_PASSWORD_SALT = 'salty'
|
2022-01-25 20:42:35 +00:00
|
|
|
|
|
|
|
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'
|
2022-02-04 21:13:15 +00:00
|
|
|
TOKEN_FILE = "door_tokens"
|
|
|
|
ADMIN_FILE = 'admins'
|
2022-02-01 22:03:06 +00:00
|
|
|
|
2022-01-25 20:42:35 +00:00
|
|
|
LDAP_URL = "ldaps://ldap.imaginaerraum.de"
|
2022-02-01 22:03:06 +00:00
|
|
|
LDAP_USER_GROUP = 'Users'
|
|
|
|
LDAP_DOMAIN = 'imaginaerraum'
|
|
|
|
LDAP_DOMAIN_EXT = 'de'
|
|
|
|
|
2022-01-25 20:42:35 +00:00
|
|
|
NFC_SOCKET = "/tmp/nfc.sock"
|
2022-02-04 21:13:15 +00:00
|
|
|
LOG_FILE = "webinterface.log"
|
|
|
|
NFC_LOG = "nfc.log"
|
2022-01-25 20:42:35 +00:00
|
|
|
MQTT_HOST = '10.10.21.2'
|