2016-07-03 19:29:30 +02:00
|
|
|
import os
|
2017-11-24 09:08:37 +01:00
|
|
|
|
2016-07-03 19:29:30 +02:00
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
|
|
|
|
SECURITY_REGISTERABLE = True
|
|
|
|
SECURITY_CHANGEABLE = True
|
|
|
|
SECURITY_RECOVERABLE = True
|
|
|
|
SECURITY_PASSWORD_SALT = os.environ.get('SECURITY_PASSWORD_SALT') or 'SOME SECRET STRING'
|
|
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'SOME SECRET STRING'
|
2016-07-16 19:29:25 +02:00
|
|
|
SECURITY_EMAIL_SENDER = 'no-reply@lusiardi.de'
|
2016-07-03 19:29:30 +02:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
2016-07-16 19:29:25 +02:00
|
|
|
MAIL_SERVER = 'mail.nerd2nerd.org'
|
|
|
|
MAIL_PORT = 25
|
2016-07-03 19:29:30 +02:00
|
|
|
MAIL_USE_TLS = True
|
2016-07-16 19:29:25 +02:00
|
|
|
MAIL_USE_SSL = False
|
2016-07-03 19:29:30 +02:00
|
|
|
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
|
|
|
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
|
2016-08-03 08:12:06 +02:00
|
|
|
ADMIN_MAIL = 'joachim@lusiardi.de'
|
2017-10-30 06:49:56 +01:00
|
|
|
TANKERKOENIG_API_KEY = os.environ.get('TANKERKOENIG_API_KEY')
|
2017-11-25 11:12:16 +01:00
|
|
|
DEBUG = False
|
2016-07-03 19:29:30 +02:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def init_app(app):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
|
|
SECURITY_SEND_REGISTER_EMAIL = False
|
|
|
|
DEBUG = True
|
2018-08-11 18:58:25 +02:00
|
|
|
SQLALCHEMY_DATABASE_URI = 'sqlite:////data/data.sqlite'
|
2016-07-03 19:29:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestingConfig(Config):
|
2017-11-24 09:08:37 +01:00
|
|
|
SECURITY_SEND_REGISTER_EMAIL = False
|
|
|
|
DEBUG = True
|
|
|
|
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:{p}@{h}/pitstops'.format(p=os.environ.get('MYSQL_PASSWORD'),
|
|
|
|
h=os.environ.get('MYSQL_HOST'))
|
2016-07-03 19:29:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ProductionConfig(Config):
|
2021-12-21 17:23:15 +01:00
|
|
|
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://pitstops:{h}@localhost/pitstops'.format(
|
2021-12-21 17:21:00 +01:00
|
|
|
h=os.environ.get('MYSQL_PASSWORD'))
|
2016-07-03 19:29:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
'development': DevelopmentConfig,
|
|
|
|
'testing': TestingConfig,
|
|
|
|
'production': ProductionConfig,
|
|
|
|
'default': DevelopmentConfig
|
2017-11-24 09:08:37 +01:00
|
|
|
}
|