Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create shared config for AWS and GPaaS #1709

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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