-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
152 lines (111 loc) · 4.23 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# coding=utf-8
import os
import jinja2
from dmutils.status import enabled_since, get_version_label
from dmutils.asset_fingerprint import AssetFingerprinter
class Config(object):
VERSION = get_version_label(
os.path.abspath(os.path.dirname(__file__))
)
SESSION_COOKIE_NAME = 'dm_session'
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
PERMANENT_SESSION_LIFETIME = 4*3600
WTF_CSRF_ENABLED = True
WTF_CSRF_TIME_LIMIT = None
DM_DATA_API_URL = None
DM_DATA_API_AUTH_TOKEN = None
DM_CLARIFICATION_QUESTION_EMAIL = '[email protected]'
DM_FRAMEWORK_AGREEMENTS_EMAIL = '[email protected]'
DM_AGREEMENTS_BUCKET = None
DM_COMMUNICATIONS_BUCKET = None
DM_DOCUMENTS_BUCKET = None
DM_SUBMISSIONS_BUCKET = None
DM_ASSETS_URL = None
DEBUG = False
RESET_PASSWORD_EMAIL_NAME = 'Cirrus Admin'
RESET_PASSWORD_EMAIL_FROM = '[email protected]'
RESET_PASSWORD_EMAIL_SUBJECT = 'Reset your Cirrus password'
INVITE_EMAIL_NAME = 'Cirrus Admin'
INVITE_EMAIL_FROM = '[email protected]'
INVITE_EMAIL_SUBJECT = 'Your Cirrus invitation'
CLARIFICATION_EMAIL_NAME = 'Cirrus Admin'
CLARIFICATION_EMAIL_FROM = '[email protected]'
CLARIFICATION_EMAIL_SUBJECT = 'Thanks for your clarification question'
DM_FOLLOW_UP_EMAIL_TO = '[email protected]'
DM_GENERIC_NOREPLY_EMAIL = '[email protected]'
CREATE_USER_SUBJECT = 'Create your Cirrus account'
SECRET_KEY = None
SHARED_EMAIL_KEY = None
RESET_PASSWORD_SALT = 'ResetPasswordSalt'
INVITE_EMAIL_SALT = 'InviteEmailSalt'
STATIC_URL_PATH = '/suppliers/static'
ASSET_PATH = STATIC_URL_PATH + '/'
BASE_TEMPLATE_DATA = {
'header_class': 'with-proposition',
'asset_path': ASSET_PATH,
'asset_fingerprinter': AssetFingerprinter(asset_root=ASSET_PATH)
}
# Feature Flags
RAISE_ERROR_ON_MISSING_FEATURES = True
FEATURE_FLAGS_EDIT_SECTIONS = False
# Logging
DM_LOG_LEVEL = 'DEBUG'
DM_APP_NAME = 'supplier-frontend'
DM_LOG_PATH = '/var/log/digitalmarketplace/application.log'
DM_DOWNSTREAM_REQUEST_ID_HEADER = 'X-Amz-Cf-Id'
@staticmethod
def init_app(app):
repo_root = os.path.abspath(os.path.dirname(__file__))
template_folders = [
os.path.join(repo_root, 'app/templates')
]
jinja_loader = jinja2.FileSystemLoader(template_folders)
app.jinja_loader = jinja_loader
class Test(Config):
DEBUG = True
DM_LOG_LEVEL = 'CRITICAL'
WTF_CSRF_ENABLED = False
SERVER_NAME = 'localhost'
SHARED_EMAIL_KEY = "KEY"
DM_CLARIFICATION_QUESTION_EMAIL = '[email protected]'
FEATURE_FLAGS_EDIT_SECTIONS = enabled_since('2015-06-03')
DM_DATA_API_AUTH_TOKEN = 'myToken'
SECRET_KEY = 'not_very_secret'
DM_SUBMISSIONS_BUCKET = 'inoket-submissions-preview-preview'
DM_COMMUNICATIONS_BUCKET = 'inoket-communications-preview-preview'
DM_ASSETS_URL = 'http://asset-host'
class Development(Config):
DEBUG = False
SESSION_COOKIE_SECURE = False
# Dates not formatted like YYYY-(0)M-(0)D will fail
FEATURE_FLAGS_EDIT_SECTIONS = enabled_since('2015-06-03')
DM_DATA_API_URL = os.getenv('DM_DATA_API_URL', "http://localhost:5000")
DM_DATA_API_AUTH_TOKEN = os.getenv('DM_API_AUTH_TOKEN', "myToken")
DM_API_AUTH_TOKEN = os.getenv('DM_API_AUTH_TOKEN', "myToken")
DM_SUBMISSIONS_BUCKET = "inoket-submissions-preview-preview"
DM_COMMUNICATIONS_BUCKET = "inoket-communications-preview-preview"
DM_AGREEMENTS_BUCKET = "inoket-agreements-preview-preview"
DM_DOCUMENTS_BUCKET = "inoket-documents-preview-preview"
DM_ASSETS_URL = "https://{}.s3-eu-west-1.amazonaws.com".format(DM_SUBMISSIONS_BUCKET)
SHARED_EMAIL_KEY = "very_secret"
SECRET_KEY = 'verySecretKey'
class Live(Config):
"""Base config for deployed environments"""
DEBUG = False
DM_HTTP_PROTO = 'https'
DM_FRAMEWORK_AGREEMENTS_EMAIL = '[email protected]'
class Preview(Live):
pass
class Production(Live):
pass
class Staging(Production):
pass
configs = {
'development': Development,
'preview': Development,
'staging': Staging,
'production': Production,
'test': Test,
}