Skip to content

Commit

Permalink
Create shared config for AWS and GPaaS
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-s-ccs committed Nov 29, 2023
1 parent c985da3 commit 082a443
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,23 @@ class Development(Config):
DM_DNB_API_PASSWORD = 'not_a_real_password' # pragma: allowlist secret


class NativeAWS(Config):
class SharedLive(Config):
"""Base config for deployed environments shared between GPaaS and AWS"""
DEBUG = False
DM_APP_NAME = 'supplier-frontend'
DM_HTTP_PROTO = 'https'

# use of invalid email addresses with live api keys annoys Notify
DM_NOTIFY_REDIRECT_DOMAINS_TO_ADDRESS = {
"example.com": "success@simulator.amazonses.com",
"example.gov.uk": "success@simulator.amazonses.com",
"user.marketplace.team": "success@simulator.amazonses.com",
}

DM_FRAMEWORK_AGREEMENTS_EMAIL = 'cloud_digital@crowncommercial.gov.uk'


class NativeAWS(SharedLive):
DM_APP_NAME = 'supplier-frontend'
# DM_LOGIN_URL will be read from env vars - used to avoid incorrect host/port
# redirect from Flask-Login package
DM_LOGIN_URL = None
Expand All @@ -178,20 +191,9 @@ class NativeAWS(Config):
SESSION_COOKIE_DOMAIN = None


class Live(Config):
class Live(SharedLive):
"""Base config for deployed environments"""
DEBUG = False
DM_LOG_PATH = '/var/log/digitalmarketplace/application.log'
DM_HTTP_PROTO = 'https'

# use of invalid email addresses with live api keys annoys Notify
DM_NOTIFY_REDIRECT_DOMAINS_TO_ADDRESS = {
"example.com": "success@simulator.amazonses.com",
"example.gov.uk": "success@simulator.amazonses.com",
"user.marketplace.team": "success@simulator.amazonses.com",
}

DM_FRAMEWORK_AGREEMENTS_EMAIL = 'cloud_digital@crowncommercial.gov.uk'


class Preview(Live):
Expand Down

0 comments on commit 082a443

Please sign in to comment.