-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
72 lines (47 loc) · 1.62 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
69
70
71
72
import os
basedir = os.path.abspath(os.path.dirname(__file__))
def read_file_secret(name):
if not os.path.exists(f"/run/secrets/{name}"):
return ""
with open(f"/run/secrets/{name}") as r:
return r.read().strip()
class Config(object):
DEBUG = False
TESTING = False
SESSION_TYPE = 'filesystem'
GLOBUS_KEY = os.environ.get('globus_key')
GLOBUS_CLIENT = os.environ.get('globus_client')
SECRET_KEY = os.environ.get('secret_key')
DB_HOST = os.environ.get('db_host')
DB_USER = os.environ.get('db_user')
DB_NAME = os.environ.get('db_name')
DB_PASSWORD = os.environ.get('db_password')
FORWARDER_IP = os.environ.get('forwarder_ip')
REDIS_PORT = os.environ.get('redis_port')
REDIS_HOST = os.environ.get('redis_host')
SERIALIZATION_ADDR = os.environ.get('serialization_addr')
SERIALIZATION_PORT = os.environ.get('serialization_port')
HOSTNAME = os.environ.get('hostname')
class ProductionConfig(Config):
DEBUG = False
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
class TestingConfig(Config):
TESTING = True
class LocalDevelopmentConfig(DevelopmentConfig):
GLOBUS_CLIENT = read_file_secret("globus_client")
GLOBUS_KEY = read_file_secret("globus_key")
DB_HOST = "mockrds"
DB_USER = "funcx"
DB_NAME = "funcx"
DB_PASSWORD = "local-dev-password"
FORWARDER_IP = "forwarder"
REDIS_HOST = "mockredis"
REDIS_PORT = "6379"
SERIALIZATION_ADDR = "serializer"
SERIALIZATION_PORT = "8080"
HOSTNAME = "localhost:8080"