This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
config.py
207 lines (156 loc) · 5.86 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
import os
import hashlib
from dmutils.status import enabled_since, get_version_label
import pendulum
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
VERSION = get_version_label(
os.path.abspath(os.path.dirname(__file__))
)
URL_PREFIX = ''
SESSION_COOKIE_NAME = 'dm_session'
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_SAMESITE = 'Lax'
CSRF_ENABLED = True
CSRF_TIME_LIMIT = 8*3600
DM_TIMEZONE = 'Australia/Sydney'
DM_DATA_API_URL = None
DM_DATA_API_AUTH_TOKEN = None
DM_HTTP_PROTO = 'http'
DM_DEFAULT_CACHE_MAX_AGE = 24*3600
DM_EMAIL_RETURN_ADDRESS = None
DM_SEND_EMAIL_TO_STDERR = False
DM_CACHE_TYPE = 'dev'
# matches api(s)
DM_SEARCH_PAGE_SIZE = 100
DM_GA_CODE = 'UA-72722909-6'
# This is just a placeholder
ES_ENABLED = True
DEBUG = False
DM_TEAM_EMAIL = None
DM_TEAM_SLACK_WEBHOOK = None
DM_GENERIC_NOREPLY_EMAIL = 'no-reply@marketplace.digital.gov.au'
DM_GENERIC_ADMIN_NAME = 'Digital Marketplace Admin'
DM_GENERIC_SUPPORT_EMAIL = 'marketplace@dta.gov.au'
DM_GENERIC_SUPPORT_NAME = 'Digital Marketplace'
RESET_PASSWORD_EMAIL_NAME = DM_GENERIC_ADMIN_NAME
RESET_PASSWORD_EMAIL_FROM = DM_GENERIC_NOREPLY_EMAIL
RESET_PASSWORD_EMAIL_SUBJECT = 'Reset your Digital Marketplace password [SEC=UNCLASSIFIED]'
BUYER_INVITE_REQUEST_SUBJECT = 'Buyer Account Invite Request [SEC=UNCLASSIFIED]'
BUYER_INVITE_REQUEST_ADMIN_EMAIL = 'marketplace@dta.gov.au'
BUYER_INVITE_REQUEST_EMAIL_FROM = DM_GENERIC_NOREPLY_EMAIL
BUYER_INVITE_REQUEST_EMAIL_NAME = DM_GENERIC_ADMIN_NAME
BUYER_INVITE_MANAGER_CONFIRMATION_SUBJECT = 'Digital Marketplace buyer account request [SEC=UNCLASSIFIED]'
BUYER_INVITE_MANAGER_CONFIRMATION_NAME = DM_GENERIC_ADMIN_NAME
SELLER_NEW_OPPORTUNITY_EMAIL_SUBJECT = 'Digital Marketplace - new business opportunity'
SELLER_NEW_OPPORTUNITY_EMAIL_FROM = DM_GENERIC_NOREPLY_EMAIL
CREATE_USER_SUBJECT = 'Create your Digital Marketplace account [SEC=UNCLASSIFIED]'
SECRET_KEY = None
SHARED_EMAIL_KEY = None
RESET_PASSWORD_SALT = 'ResetPasswordSalt'
INVITE_EMAIL_SALT = 'InviteEmailSalt'
BUYER_CREATION_TOKEN_SALT = 'BuyerCreation'
SIGNUP_INVITATION_TOKEN_SALT = 'NewUserInviteEmail'
ASSET_PATH = URL_PREFIX + '/static'
# Throw an exception in dev when a feature flag is used in code but not defined.
RAISE_ERROR_ON_MISSING_FEATURES = True
# List all your feature flags below
FEATURE_FLAGS = {
'CASE_STUDY': True,
'XLSX_EXPORT': True,
'SELLER_REGISTRATION': True,
'DM_FRAMEWORK': True,
'TEAM_VIEW': True
}
# LOGGING
DM_LOG_LEVEL = 'DEBUG'
DM_LOG_PATH = None
DM_APP_NAME = 'buyer-frontend'
DM_DOWNSTREAM_REQUEST_ID_HEADER = 'X-Vcap-Request-Id'
REACT_BUNDLE_URL = 'https://dm-dev-frontend.apps.y.cld.gov.au/bundle/'
REACT_RENDER_URL = 'https://dm-dev-frontend.apps.y.cld.gov.au/render'
REACT_RENDER = not DEBUG
ROLLBAR_TOKEN = None
S3_BUCKET_NAME = None
S3_ENDPOINT_URL = 's3-ap-southeast-2.amazonaws.com'
AWS_DEFAULT_REGION = None
GENERIC_EMAIL_DOMAINS = ['bigpond.com', 'digital.gov.au', 'gmail.com', 'hotmail.com', 'icloud.com',
'iinet.net.au', 'internode.on.net', 'live.com.au', 'me.com', 'msn.com',
'optusnet.com.au', 'outlook.com', 'outlook.com.au', 'ozemail.com.au',
'yahoo.com', 'yahoo.com.au']
MULTI_CANDIDATE_PUBLISHED_DATE = pendulum.datetime(2018, 4, 17)
# redis
REDIS_SESSIONS = True
REDIS_SERVER_HOST = '127.0.0.1'
REDIS_SERVER_PORT = 6379
REDIS_SERVER_PASSWORD = None
REDIS_SSL = False
REDIS_SSL_HOST_REQ = None
REDIS_SSL_CA_CERTS = None
class Test(Config):
DEBUG = True
DM_LOG_LEVEL = 'CRITICAL'
CSRF_ENABLED = False
CSRF_FAKED = True
DM_DATA_API_URL = "http://localhost:5000/api/"
DM_DATA_API_AUTH_TOKEN = "myToken"
# Used a fixed timezone for tests. Using Sydney timezone will catch more timezone bugs than London.
DM_TIMEZONE = 'Australia/Sydney'
SECRET_KEY = 'TestKeyTestKeyTestKeyTestKeyTestKeyTestKeyX='
SHARED_EMAIL_KEY = SECRET_KEY
SERVER_NAME = 'localhost'
FEATURE_FLAGS = {
'CASE_STUDY': True,
'XLSX_EXPORT': True,
'SELLER_REGISTRATION': True,
'DM_FRAMEWORK': False,
'TEAM_VIEW': True
}
REDIS_SESSIONS = False
class Development(Config):
DEBUG = True
SESSION_COOKIE_SECURE = False
DM_SEARCH_PAGE_SIZE = 5
DM_DATA_API_URL = "http://localhost:5000/api/"
DM_DATA_API_AUTH_TOKEN = "myToken"
DM_DEFAULT_CACHE_MAX_AGE = 60
SECRET_KEY = 'DevKeyDevKeyDevKeyDevKeyDevKeyDevKeyDevKeyX='
SHARED_EMAIL_KEY = SECRET_KEY
DM_SEND_EMAIL_TO_STDERR = True
class Live(Config):
"""Base config for deployed environments"""
DEBUG = False
DM_HTTP_PROTO = 'https'
DM_GA_CODE = 'UA-72722909-5'
DM_CACHE_TYPE = 'prod'
# If a feature flag is used in code but not defined in prod, assume it is False.
RAISE_ERROR_ON_MISSING_FEATURES = False
# List all your feature flags below
FEATURE_FLAGS = {
'CASE_STUDY': False,
'XLSX_EXPORT': False,
'SELLER_REGISTRATION': True,
'DM_FRAMEWORK': True,
'TEAM_VIEW': True
}
REACT_BUNDLE_URL = 'https://dm-frontend.apps.b.cld.gov.au/bundle/'
REACT_RENDER_URL = 'https://dm-frontend.apps.b.cld.gov.au/render'
REACT_RENDER = True
REDIS_SSL = True
REDIS_SSL_CA_CERTS = '/etc/ssl/certs/ca-certificates.crt'
REDIS_SSL_HOST_REQ = True
class Preview(Live):
pass
class Staging(Live):
pass
class Production(Live):
pass
configs = {
'development': Development,
'test': Test,
'preview': Preview,
'staging': Staging,
'production': Production,
}