config formatting

This commit is contained in:
Jim Moffet
2022-06-13 13:45:07 -07:00
parent 59b72f4853
commit 60262d6031
2 changed files with 66 additions and 108 deletions

View File

@@ -25,7 +25,7 @@ NOTIFY_CREDENTIALS ?= ~/.notify-credentials
bootstrap: generate-version-file ## Set up everything to run the app bootstrap: generate-version-file ## Set up everything to run the app
pip3 install -r requirements_for_test.txt pip3 install -r requirements_for_test.txt
createdb notification_api || true createdb notification_api || true
(. environment.sh && flask db upgrade) || true (flask db upgrade) || true
.PHONY: bootstrap-with-docker .PHONY: bootstrap-with-docker
bootstrap-with-docker: ## Build the image to run the app in Docker bootstrap-with-docker: ## Build the image to run the app in Docker
@@ -33,11 +33,12 @@ bootstrap-with-docker: ## Build the image to run the app in Docker
.PHONY: run-flask .PHONY: run-flask
run-flask: ## Run flask run-flask: ## Run flask
. environment.sh && flask run -p 6011 flask run -p 6011 --host=0.0.0.0
.PHONY: run-celery .PHONY: run-celery
run-celery: ## Run celery run-celery: ## Run celery, TODO remove purge for staging/prod
. environment.sh && celery \ celery -A run_celery.notify_celery purge -f
celery \
-A run_celery.notify_celery worker \ -A run_celery.notify_celery worker \
--pidfile="/tmp/celery.pid" \ --pidfile="/tmp/celery.pid" \
--loglevel=INFO \ --loglevel=INFO \
@@ -49,9 +50,9 @@ run-celery-with-docker: ## Run celery in Docker container (useful if you can't i
.PHONY: run-celery-beat .PHONY: run-celery-beat
run-celery-beat: ## Run celery beat run-celery-beat: ## Run celery beat
. environment.sh && celery \ celery \
-A run_celery.notify_celery beat \ -A run_celery.notify_celery beat \
--loglevel=INFO --loglevel=INFO
.PHONY: run-celery-beat-with-docker .PHONY: run-celery-beat-with-docker
run-celery-beat-with-docker: ## Run celery beat in Docker container (useful if you can't install pycurl locally) run-celery-beat-with-docker: ## Run celery beat in Docker container (useful if you can't install pycurl locally)

View File

@@ -1,6 +1,7 @@
import json import json
import os import os
from datetime import timedelta from datetime import timedelta
from celery.schedules import crontab from celery.schedules import crontab
from kombu import Exchange, Queue from kombu import Exchange, Queue
@@ -99,19 +100,14 @@ class Config(object):
DANGEROUS_SALT = os.getenv('DANGEROUS_SALT') DANGEROUS_SALT = os.getenv('DANGEROUS_SALT')
# DB conection string # DB conection string
SQLALCHEMY_DATABASE_URI = os.getenv( SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
'SQLALCHEMY_DATABASE_URI',
'postgresql://postgres:chummy@db:5432/notification_api',
)
# MMG API Key # MMG API Key
MMG_API_KEY = os.getenv('MMG_API_KEY') MMG_API_KEY = os.getenv('MMG_API_KEY')
# Firetext API Key # Firetext API Key
FIRETEXT_API_KEY = os.getenv('FIRETEXT_API_KEY') FIRETEXT_API_KEY = os.getenv("FIRETEXT_API_KEY")
FIRETEXT_INTERNATIONAL_API_KEY = os.getenv( FIRETEXT_INTERNATIONAL_API_KEY = os.getenv("FIRETEXT_INTERNATIONAL_API_KEY", "placeholder")
'FIRETEXT_INTERNATIONAL_API_KEY', 'placeholder'
)
# Prefix to identify queues in SQS # Prefix to identify queues in SQS
NOTIFICATION_QUEUE_PREFIX = os.getenv('NOTIFICATION_QUEUE_PREFIX') NOTIFICATION_QUEUE_PREFIX = os.getenv('NOTIFICATION_QUEUE_PREFIX')
@@ -164,7 +160,10 @@ class Config(object):
CHECK_PROXY_HEADER = False CHECK_PROXY_HEADER = False
# these should always add up to 100% # these should always add up to 100%
SMS_PROVIDER_RESTING_POINTS = {'mmg': 50, 'firetext': 50} SMS_PROVIDER_RESTING_POINTS = {
'mmg': 50,
'firetext': 50
}
NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553' NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'
NOTIFY_USER_ID = '6af522d0-2915-4e52-83a3-3690455a5fe6' NOTIFY_USER_ID = '6af522d0-2915-4e52-83a3-3690455a5fe6'
@@ -180,16 +179,10 @@ class Config(object):
ORGANISATION_INVITATION_EMAIL_TEMPLATE_ID = '203566f0-d835-47c5-aa06-932439c86573' ORGANISATION_INVITATION_EMAIL_TEMPLATE_ID = '203566f0-d835-47c5-aa06-932439c86573'
TEAM_MEMBER_EDIT_EMAIL_TEMPLATE_ID = 'c73f1d71-4049-46d5-a647-d013bdeca3f0' TEAM_MEMBER_EDIT_EMAIL_TEMPLATE_ID = 'c73f1d71-4049-46d5-a647-d013bdeca3f0'
TEAM_MEMBER_EDIT_MOBILE_TEMPLATE_ID = '8a31520f-4751-4789-8ea1-fe54496725eb' TEAM_MEMBER_EDIT_MOBILE_TEMPLATE_ID = '8a31520f-4751-4789-8ea1-fe54496725eb'
REPLY_TO_EMAIL_ADDRESS_VERIFICATION_TEMPLATE_ID = ( REPLY_TO_EMAIL_ADDRESS_VERIFICATION_TEMPLATE_ID = 'a42f1d17-9404-46d5-a647-d013bdfca3e1'
'a42f1d17-9404-46d5-a647-d013bdfca3e1'
)
MOU_SIGNER_RECEIPT_TEMPLATE_ID = '4fd2e43c-309b-4e50-8fb8-1955852d9d71' MOU_SIGNER_RECEIPT_TEMPLATE_ID = '4fd2e43c-309b-4e50-8fb8-1955852d9d71'
MOU_SIGNED_ON_BEHALF_SIGNER_RECEIPT_TEMPLATE_ID = ( MOU_SIGNED_ON_BEHALF_SIGNER_RECEIPT_TEMPLATE_ID = 'c20206d5-bf03-4002-9a90-37d5032d9e84'
'c20206d5-bf03-4002-9a90-37d5032d9e84' MOU_SIGNED_ON_BEHALF_ON_BEHALF_RECEIPT_TEMPLATE_ID = '522b6657-5ca5-4368-a294-6b527703bd0b'
)
MOU_SIGNED_ON_BEHALF_ON_BEHALF_RECEIPT_TEMPLATE_ID = (
'522b6657-5ca5-4368-a294-6b527703bd0b'
)
NOTIFY_INTERNATIONAL_SMS_SENDER = '07984404008' NOTIFY_INTERNATIONAL_SMS_SENDER = '07984404008'
LETTERS_VOLUME_EMAIL_TEMPLATE_ID = '11fad854-fd38-4a7c-bd17-805fb13dfc12' LETTERS_VOLUME_EMAIL_TEMPLATE_ID = '11fad854-fd38-4a7c-bd17-805fb13dfc12'
NHS_EMAIL_BRANDING_ID = 'a7dc4e56-660b-4db7-8cff-12c37b12b5ea' NHS_EMAIL_BRANDING_ID = 'a7dc4e56-660b-4db7-8cff-12c37b12b5ea'
@@ -212,85 +205,80 @@ class Config(object):
], ],
# this is overriden by the -Q command, but locally, we should read from all queues # this is overriden by the -Q command, but locally, we should read from all queues
'task_queues': [ 'task_queues': [
Queue(queue, Exchange('default'), routing_key=queue) Queue(queue, Exchange('default'), routing_key=queue) for queue in QueueNames.all_queues()
for queue in QueueNames.all_queues()
], ],
'beat_schedule': { 'beat_schedule': {
# app/celery/scheduled_tasks.py # app/celery/scheduled_tasks.py
'run-scheduled-jobs': { 'run-scheduled-jobs': {
'task': 'run-scheduled-jobs', 'task': 'run-scheduled-jobs',
'schedule': crontab(minute='0,15,30,45'), 'schedule': crontab(minute='0,15,30,45'),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'delete-verify-codes': { 'delete-verify-codes': {
'task': 'delete-verify-codes', 'task': 'delete-verify-codes',
'schedule': timedelta(minutes=63), 'schedule': timedelta(minutes=63),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'delete-invitations': { 'delete-invitations': {
'task': 'delete-invitations', 'task': 'delete-invitations',
'schedule': timedelta(minutes=66), 'schedule': timedelta(minutes=66),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'switch-current-sms-provider-on-slow-delivery': { 'switch-current-sms-provider-on-slow-delivery': {
'task': 'switch-current-sms-provider-on-slow-delivery', 'task': 'switch-current-sms-provider-on-slow-delivery',
'schedule': crontab(), # Every minute 'schedule': crontab(), # Every minute
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'check-job-status': { 'check-job-status': {
'task': 'check-job-status', 'task': 'check-job-status',
'schedule': crontab(), 'schedule': crontab(),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'tend-providers-back-to-middle': { 'tend-providers-back-to-middle': {
'task': 'tend-providers-back-to-middle', 'task': 'tend-providers-back-to-middle',
'schedule': crontab(minute='*/5'), 'schedule': crontab(minute='*/5'),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'check-for-missing-rows-in-completed-jobs': { 'check-for-missing-rows-in-completed-jobs': {
'task': 'check-for-missing-rows-in-completed-jobs', 'task': 'check-for-missing-rows-in-completed-jobs',
'schedule': crontab(minute='*/10'), 'schedule': crontab(minute='*/10'),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'replay-created-notifications': { 'replay-created-notifications': {
'task': 'replay-created-notifications', 'task': 'replay-created-notifications',
'schedule': crontab(minute='0, 15, 30, 45'), 'schedule': crontab(minute='0, 15, 30, 45'),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
# app/celery/nightly_tasks.py # app/celery/nightly_tasks.py
'timeout-sending-notifications': { 'timeout-sending-notifications': {
'task': 'timeout-sending-notifications', 'task': 'timeout-sending-notifications',
'schedule': crontab(hour=0, minute=5), 'schedule': crontab(hour=0, minute=5),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'create-nightly-billing': { 'create-nightly-billing': {
'task': 'create-nightly-billing', 'task': 'create-nightly-billing',
'schedule': crontab(hour=0, minute=15), 'schedule': crontab(hour=0, minute=15),
'options': {'queue': QueueNames.REPORTING}, 'options': {'queue': QueueNames.REPORTING}
}, },
'create-nightly-notification-status': { 'create-nightly-notification-status': {
'task': 'create-nightly-notification-status', 'task': 'create-nightly-notification-status',
'schedule': crontab( 'schedule': crontab(hour=0, minute=30), # after 'timeout-sending-notifications'
hour=0, minute=30 'options': {'queue': QueueNames.REPORTING}
), # after 'timeout-sending-notifications'
'options': {'queue': QueueNames.REPORTING},
}, },
'delete-notifications-older-than-retention': { 'delete-notifications-older-than-retention': {
'task': 'delete-notifications-older-than-retention', 'task': 'delete-notifications-older-than-retention',
'schedule': crontab( 'schedule': crontab(hour=3, minute=0), # after 'create-nightly-notification-status'
hour=3, minute=0 'options': {'queue': QueueNames.REPORTING}
), # after 'create-nightly-notification-status'
'options': {'queue': QueueNames.REPORTING},
}, },
'delete-inbound-sms': { 'delete-inbound-sms': {
'task': 'delete-inbound-sms', 'task': 'delete-inbound-sms',
'schedule': crontab(hour=1, minute=40), 'schedule': crontab(hour=1, minute=40),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'save-daily-notification-processing-time': { 'save-daily-notification-processing-time': {
'task': 'save-daily-notification-processing-time', 'task': 'save-daily-notification-processing-time',
'schedule': crontab(hour=2, minute=0), 'schedule': crontab(hour=2, minute=0),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'remove_sms_email_jobs': { 'remove_sms_email_jobs': {
'task': 'remove_sms_email_jobs', 'task': 'remove_sms_email_jobs',
@@ -306,51 +294,51 @@ class Config(object):
'check-if-letters-still-in-created': { 'check-if-letters-still-in-created': {
'task': 'check-if-letters-still-in-created', 'task': 'check-if-letters-still-in-created',
'schedule': crontab(day_of_week='mon-fri', hour=7, minute=0), 'schedule': crontab(day_of_week='mon-fri', hour=7, minute=0),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'check-if-letters-still-pending-virus-check': { 'check-if-letters-still-pending-virus-check': {
'task': 'check-if-letters-still-pending-virus-check', 'task': 'check-if-letters-still-pending-virus-check',
'schedule': crontab(day_of_week='mon-fri', hour='9,15', minute=0), 'schedule': crontab(day_of_week='mon-fri', hour='9,15', minute=0),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'check-for-services-with-high-failure-rates-or-sending-to-tv-numbers': { 'check-for-services-with-high-failure-rates-or-sending-to-tv-numbers': {
'task': 'check-for-services-with-high-failure-rates-or-sending-to-tv-numbers', 'task': 'check-for-services-with-high-failure-rates-or-sending-to-tv-numbers',
'schedule': crontab(day_of_week='mon-fri', hour=10, minute=30), 'schedule': crontab(day_of_week='mon-fri', hour=10, minute=30),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'raise-alert-if-letter-notifications-still-sending': { 'raise-alert-if-letter-notifications-still-sending': {
'task': 'raise-alert-if-letter-notifications-still-sending', 'task': 'raise-alert-if-letter-notifications-still-sending',
'schedule': crontab(hour=17, minute=00), 'schedule': crontab(hour=17, minute=00),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
# The collate-letter-pdf does assume it is called in an hour that BST does not make a # The collate-letter-pdf does assume it is called in an hour that BST does not make a
# difference to the truncate date which translates to the filename to process # difference to the truncate date which translates to the filename to process
'collate-letter-pdfs-to-be-sent': { 'collate-letter-pdfs-to-be-sent': {
'task': 'collate-letter-pdfs-to-be-sent', 'task': 'collate-letter-pdfs-to-be-sent',
'schedule': crontab(hour=17, minute=50), 'schedule': crontab(hour=17, minute=50),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'raise-alert-if-no-letter-ack-file': { 'raise-alert-if-no-letter-ack-file': {
'task': 'raise-alert-if-no-letter-ack-file', 'task': 'raise-alert-if-no-letter-ack-file',
'schedule': crontab(hour=23, minute=00), 'schedule': crontab(hour=23, minute=00),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'trigger-link-tests': { 'trigger-link-tests': {
'task': 'trigger-link-tests', 'task': 'trigger-link-tests',
'schedule': timedelta(minutes=15), 'schedule': timedelta(minutes=15),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'auto-expire-broadcast-messages': { 'auto-expire-broadcast-messages': {
'task': 'auto-expire-broadcast-messages', 'task': 'auto-expire-broadcast-messages',
'schedule': timedelta(minutes=5), 'schedule': timedelta(minutes=5),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
'remove-yesterdays-planned-tests-on-govuk-alerts': { 'remove-yesterdays-planned-tests-on-govuk-alerts': {
'task': 'remove-yesterdays-planned-tests-on-govuk-alerts', 'task': 'remove-yesterdays-planned-tests-on-govuk-alerts',
'schedule': crontab(hour=00, minute=00), 'schedule': crontab(hour=00, minute=00),
'options': {'queue': QueueNames.PERIODIC}, 'options': {'queue': QueueNames.PERIODIC}
}, },
}, }
} }
# we can set celeryd_prefetch_multiplier to be 1 for celery apps which handle only long running tasks # we can set celeryd_prefetch_multiplier to be 1 for celery apps which handle only long running tasks
@@ -376,53 +364,32 @@ class Config(object):
FREE_SMS_TIER_FRAGMENT_COUNT = 250000 FREE_SMS_TIER_FRAGMENT_COUNT = 250000
SMS_INBOUND_WHITELIST = json.loads(os.environ.get('SMS_INBOUND_WHITELIST', '[]')) SMS_INBOUND_WHITELIST = json.loads(os.environ.get('SMS_INBOUND_WHITELIST', '[]'))
FIRETEXT_INBOUND_SMS_AUTH = json.loads( FIRETEXT_INBOUND_SMS_AUTH = json.loads(os.environ.get('FIRETEXT_INBOUND_SMS_AUTH', '[]'))
os.environ.get('FIRETEXT_INBOUND_SMS_AUTH', '[]')
)
MMG_INBOUND_SMS_AUTH = json.loads(os.environ.get('MMG_INBOUND_SMS_AUTH', '[]')) MMG_INBOUND_SMS_AUTH = json.loads(os.environ.get('MMG_INBOUND_SMS_AUTH', '[]'))
MMG_INBOUND_SMS_USERNAME = json.loads( MMG_INBOUND_SMS_USERNAME = json.loads(os.environ.get('MMG_INBOUND_SMS_USERNAME', '[]'))
os.environ.get('MMG_INBOUND_SMS_USERNAME', '[]')
)
ROUTE_SECRET_KEY_1 = os.environ.get('ROUTE_SECRET_KEY_1', '') ROUTE_SECRET_KEY_1 = os.environ.get('ROUTE_SECRET_KEY_1', '')
ROUTE_SECRET_KEY_2 = os.environ.get('ROUTE_SECRET_KEY_2', '') ROUTE_SECRET_KEY_2 = os.environ.get('ROUTE_SECRET_KEY_2', '')
HIGH_VOLUME_SERVICE = json.loads(os.environ.get('HIGH_VOLUME_SERVICE', '[]')) HIGH_VOLUME_SERVICE = json.loads(os.environ.get('HIGH_VOLUME_SERVICE', '[]'))
TEMPLATE_PREVIEW_API_HOST = os.environ.get( TEMPLATE_PREVIEW_API_HOST = os.environ.get('TEMPLATE_PREVIEW_API_HOST', 'http://localhost:6013')
'TEMPLATE_PREVIEW_API_HOST', 'http://localhost:6013' TEMPLATE_PREVIEW_API_KEY = os.environ.get('TEMPLATE_PREVIEW_API_KEY', 'my-secret-key')
)
TEMPLATE_PREVIEW_API_KEY = os.environ.get(
'TEMPLATE_PREVIEW_API_KEY', 'my-secret-key'
)
DOCUMENT_DOWNLOAD_API_HOST = os.environ.get( DOCUMENT_DOWNLOAD_API_HOST = os.environ.get('DOCUMENT_DOWNLOAD_API_HOST', 'http://localhost:7000')
'DOCUMENT_DOWNLOAD_API_HOST', 'http://localhost:7000' DOCUMENT_DOWNLOAD_API_KEY = os.environ.get('DOCUMENT_DOWNLOAD_API_KEY', 'auth-token')
)
DOCUMENT_DOWNLOAD_API_KEY = os.environ.get(
'DOCUMENT_DOWNLOAD_API_KEY', 'auth-token'
)
# these environment vars aren't defined in the manifest so to set them on paas use `cf set-env` # these environment vars aren't defined in the manifest so to set them on paas use `cf set-env`
MMG_URL = os.environ.get('MMG_URL', 'https://api.mmg.co.uk/jsonv2a/api.php') MMG_URL = os.environ.get("MMG_URL", "https://api.mmg.co.uk/jsonv2a/api.php")
FIRETEXT_URL = os.environ.get( FIRETEXT_URL = os.environ.get("FIRETEXT_URL", "https://www.firetext.co.uk/api/sendsms/json")
'FIRETEXT_URL', 'https://www.firetext.co.uk/api/sendsms/json' SES_STUB_URL = os.environ.get("SES_STUB_URL")
)
SES_STUB_URL = os.environ.get('SES_STUB_URL')
AWS_REGION = 'us-west-2' AWS_REGION = 'us-west-2'
CBC_PROXY_ENABLED = True CBC_PROXY_ENABLED = True
CBC_PROXY_AWS_ACCESS_KEY_ID = os.environ.get('CBC_PROXY_AWS_ACCESS_KEY_ID', '') CBC_PROXY_AWS_ACCESS_KEY_ID = os.environ.get('CBC_PROXY_AWS_ACCESS_KEY_ID', '')
CBC_PROXY_AWS_SECRET_ACCESS_KEY = os.environ.get( CBC_PROXY_AWS_SECRET_ACCESS_KEY = os.environ.get('CBC_PROXY_AWS_SECRET_ACCESS_KEY', '')
'CBC_PROXY_AWS_SECRET_ACCESS_KEY', ''
)
ENABLED_CBCS = { ENABLED_CBCS = {BroadcastProvider.EE, BroadcastProvider.THREE, BroadcastProvider.O2, BroadcastProvider.VODAFONE}
BroadcastProvider.EE,
BroadcastProvider.THREE,
BroadcastProvider.O2,
BroadcastProvider.VODAFONE,
}
# as defined in api db migration 0331_add_broadcast_org.py # as defined in api db migration 0331_add_broadcast_org.py
BROADCAST_ORGANISATION_ID = '38e4bf69-93b0-445d-acee-53ea53fe02df' BROADCAST_ORGANISATION_ID = '38e4bf69-93b0-445d-acee-53ea53fe02df'
@@ -432,7 +399,6 @@ class Config(object):
# Config overrides ### # Config overrides ###
###################### ######################
class Development(Config): class Development(Config):
DEBUG = True DEBUG = True
SQLALCHEMY_ECHO = False SQLALCHEMY_ECHO = False
@@ -451,7 +417,7 @@ class Development(Config):
INTERNAL_CLIENT_API_KEYS = { INTERNAL_CLIENT_API_KEYS = {
Config.ADMIN_CLIENT_ID: ['dev-notify-secret-key'], Config.ADMIN_CLIENT_ID: ['dev-notify-secret-key'],
Config.GOVUK_ALERTS_CLIENT_ID: ['govuk-alerts-secret-key'], Config.GOVUK_ALERTS_CLIENT_ID: ['govuk-alerts-secret-key']
} }
SECRET_KEY = 'dev-notify-secret-key' SECRET_KEY = 'dev-notify-secret-key'
@@ -462,13 +428,10 @@ class Development(Config):
NOTIFY_ENVIRONMENT = 'development' NOTIFY_ENVIRONMENT = 'development'
NOTIFY_LOG_PATH = 'application.log' NOTIFY_LOG_PATH = 'application.log'
NOTIFY_EMAIL_DOMAIN = os.getenv('NOTIFY_EMAIL_DOMAIN', 'dispostable.com') NOTIFY_EMAIL_DOMAIN = "dispostable.com"
SQLALCHEMY_DATABASE_URI = os.getenv( SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
'SQLALCHEMY_DATABASE_URI', REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379/0')
'postgresql://postgres:chummy@db:5432/notification_api',
)
REDIS_URL = os.getenv('REDIS_URL', 'redis://redis:6379/0')
ANTIVIRUS_ENABLED = os.getenv('ANTIVIRUS_ENABLED') == '1' ANTIVIRUS_ENABLED = os.getenv('ANTIVIRUS_ENABLED') == '1'
@@ -503,20 +466,17 @@ class Test(Development):
LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise' LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise'
# this is overriden in jenkins and on cloudfoundry # this is overriden in jenkins and on cloudfoundry
SQLALCHEMY_DATABASE_URI = os.getenv( SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
'SQLALCHEMY_DATABASE_URI',
'postgresql://postgres:chummy@db:5432/notification_api',
)
CELERY = { CELERY = {
**Config.CELERY, **Config.CELERY,
'broker_url': 'you-forgot-to-mock-celery-in-your-tests://', 'broker_url': 'you-forgot-to-mock-celery-in-your-tests://'
} }
ANTIVIRUS_ENABLED = True ANTIVIRUS_ENABLED = True
API_RATE_LIMIT_ENABLED = True API_RATE_LIMIT_ENABLED = True
API_HOST_NAME = 'http://localhost:6011' API_HOST_NAME = "http://localhost:6011"
SMS_INBOUND_WHITELIST = ['203.0.113.195'] SMS_INBOUND_WHITELIST = ['203.0.113.195']
FIRETEXT_INBOUND_SMS_AUTH = ['testkey'] FIRETEXT_INBOUND_SMS_AUTH = ['testkey']
@@ -526,10 +486,7 @@ class Test(Development):
FIRETEXT_URL = 'https://example.com/firetext' FIRETEXT_URL = 'https://example.com/firetext'
CBC_PROXY_ENABLED = True CBC_PROXY_ENABLED = True
DVLA_EMAIL_ADDRESSES = [ DVLA_EMAIL_ADDRESSES = ['success@simulator.amazonses.com', 'success+2@simulator.amazonses.com']
'success@simulator.amazonses.com',
'success+2@simulator.amazonses.com',
]
class Preview(Config): class Preview(Config):
@@ -612,5 +569,5 @@ configs = {
'production': Live, 'production': Live,
'staging': Staging, 'staging': Staging,
'preview': Preview, 'preview': Preview,
'sandbox': Sandbox, 'sandbox': Sandbox
} }