-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
68 lines (55 loc) · 2.47 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
#SERVER_NAME = "localhost"
UI_HOST = os.environ.get("UI_HOST")
API_HOST = os.environ.get("API_HOST")
APP_NAME = os.environ.get("APP_NAME","Spate")
APP_SUBTITLE = os.environ.get("APP_SUBTITLE","Workflows made easy")
CR_YEAR = os.environ.get("CR_YEAR","2022")
VERSION = os.environ.get("VERSION","1.0.0")
LOG_TYPE = os.environ.get("LOG_TYPE", "stream")
LOG_LEVEL = os.environ.get("LOG_LEVEL", "WARNING")
SECRET_KEY = os.environ.get('SECRET_KEY') or 'newllkjlreagjeraihgeorvhlkenvol3u4og98u4g893u4g0u3409u34add'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_RECORD_QUERIES = True
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_DEBUG = os.environ.get('MAIL_DEBUG',False)
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
BASE_DIR = basedir
ENABLE_SELF_REGISTRATION = os.environ.get("ENABLE_SELF_REGISTRATION",False)
DOC_LINK = os.environ.get("DOC_LINK","/")
RESTRICTED_FIELDS = ["password_hash"]
DEFAULT_EMAIL = os.environ.get("DEFAULT_EMAIL", "[email protected]")
DEFAULT_PASSWORD = os.environ.get("DEFAULT_PASSWORD", "admin")
BLOCK_TIMEOUT = os.environ.get("BLOCK_TIMEOUT",30)
WORKFLOW_MOUNT_DIRECTORY = os.environ.get("WORKFLOW_MOUNT_DIRECTORY",os.path.join(basedir,"app","workflow_executions"))
if not os.path.exists(WORKFLOW_MOUNT_DIRECTORY):
os.mkdir(WORKFLOW_MOUNT_DIRECTORY)
GIT_SYNC_REPO = os.environ.get("GIT_SYNC_REPO",None)
GIT_SYNC_DIRECTORY = os.environ.get("GIT_SYNC_DIRECTORY","operators")
# network that hosts the postgres_db container (used for local dev)
POSTGRES_NW = os.environ.get("POSTGRES_NW","spate_db_nw")
LOCAL_DB = os.environ.get("LOCAL_DB",True)
BASE_PYTHON_IMAGE = os.environ.get("BASE_PYTHON_IMAGE","base-python")
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URL') or \
"postgresql://db1:db1@postgres_db/db1"
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URL') or \
"postgresql://db1:db1@postgres_db/db1"
WTF_CSRF_ENABLED = False
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'default': DevelopmentConfig
}