mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 19:34:15 -05:00
Merge pull request #928 from alphagov/rationalise-configs
Simplified the config files for admin.
This commit is contained in:
11
README.md
11
README.md
@@ -64,15 +64,12 @@ in a separate terminal from the app
|
||||
```
|
||||
echo "
|
||||
export NOTIFY_ENVIRONMENT='development'
|
||||
export ADMIN_CLIENT_SECRET='dev-notify-secret-key'
|
||||
export ADMIN_CLIENT_USER_NAME='dev-notify-admin'
|
||||
export ADMIN_CLIENT_SECRET='notify-secret-key'
|
||||
export API_HOST_NAME='http://localhost:6011'
|
||||
export DANGEROUS_SALT='dev-notify-salt'
|
||||
export SECRET_KEY='dev-notify-secret-key'
|
||||
export DESKPRO_API_HOST=""
|
||||
export DESKPRO_API_KEY=""
|
||||
export DESKPRO_DEPT_ID=""
|
||||
export DESKPRO_ASSIGNED_AGENT_TEAM_ID=""
|
||||
export SECRET_KEY='notify-secret-key'
|
||||
export DESKPRO_API_HOST="some-host"
|
||||
export DESKPRO_API_KEY="some-key"
|
||||
"> environment.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -242,23 +242,6 @@ def view_notifications(service_id, message_type):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/jobs/<job_id>/notification/<string:notification_id>")
|
||||
@login_required
|
||||
@user_has_permissions('view_activity', admin_override=True)
|
||||
def view_notification(service_id, job_id, notification_id):
|
||||
now = time.strftime('%H:%M')
|
||||
|
||||
return render_template(
|
||||
'views/notification.html',
|
||||
message=[
|
||||
message for message in messages if message['id'] == notification_id
|
||||
][0],
|
||||
delivered_at=now,
|
||||
uploaded_at=now,
|
||||
job_id=job_id
|
||||
)
|
||||
|
||||
|
||||
def get_status_filters(service, message_type, statistics):
|
||||
stats = statistics[message_type]
|
||||
stats['sending'] = stats['requested'] - stats['delivered'] - stats['failed']
|
||||
@@ -307,20 +290,20 @@ def _get_job_counts(job, help_argument):
|
||||
count
|
||||
) for label, query_param, count in [
|
||||
[
|
||||
'total', '',
|
||||
job.get('notification_count', 0)
|
||||
'total', '',
|
||||
job.get('notification_count', 0)
|
||||
],
|
||||
[
|
||||
'sending', 'sending',
|
||||
sending
|
||||
'sending', 'sending',
|
||||
sending
|
||||
],
|
||||
[
|
||||
'delivered', 'delivered',
|
||||
job.get('notifications_delivered', 0)
|
||||
'delivered', 'delivered',
|
||||
job.get('notifications_delivered', 0)
|
||||
],
|
||||
[
|
||||
'failed', 'failed',
|
||||
job.get('notifications_failed', 0)
|
||||
'failed', 'failed',
|
||||
job.get('notifications_failed', 0)
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
18
config.py
18
config.py
@@ -3,13 +3,20 @@ from datetime import timedelta
|
||||
|
||||
|
||||
class Config(object):
|
||||
DEBUG = False
|
||||
ADMIN_CLIENT_SECRET = os.environ['ADMIN_CLIENT_SECRET']
|
||||
ADMIN_CLIENT_USER_NAME = os.environ['ADMIN_CLIENT_USER_NAME']
|
||||
API_HOST_NAME = os.environ['API_HOST_NAME']
|
||||
SECRET_KEY = os.environ['SECRET_KEY']
|
||||
DANGEROUS_SALT = os.environ['DANGEROUS_SALT']
|
||||
DESKPRO_API_HOST = os.environ['DESKPRO_API_HOST']
|
||||
DESKPRO_API_KEY = os.environ['DESKPRO_API_KEY']
|
||||
|
||||
DESKPRO_DEPT_ID = 5
|
||||
DESKPRO_ASSIGNED_AGENT_TEAM_ID = 5
|
||||
|
||||
DEBUG = False
|
||||
ADMIN_CLIENT_USER_NAME = 'notify-admin'
|
||||
ASSETS_DEBUG = False
|
||||
AWS_REGION = 'eu-west-1'
|
||||
DANGEROUS_SALT = os.environ['DANGEROUS_SALT']
|
||||
DEFAULT_SERVICE_LIMIT = 50
|
||||
EMAIL_EXPIRY_SECONDS = 3600 * 24 * 7 # one week
|
||||
HEADER_COLOUR = '#FFBF47' # $yellow
|
||||
@@ -23,7 +30,6 @@ class Config(object):
|
||||
REMEMBER_COOKIE_HTTPONLY = True
|
||||
REMEMBER_COOKIE_NAME = 'notify_admin_remember_me'
|
||||
REMEMBER_COOKIE_SECURE = True
|
||||
SECRET_KEY = os.environ['SECRET_KEY']
|
||||
SEND_FILE_MAX_AGE_DEFAULT = 365 * 24 * 60 * 60 # 1 year
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_NAME = 'notify_admin_session'
|
||||
@@ -33,11 +39,7 @@ class Config(object):
|
||||
TOKEN_MAX_AGE_SECONDS = 3600
|
||||
WTF_CSRF_ENABLED = True
|
||||
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
||||
DESKPRO_API_HOST = os.environ['DESKPRO_API_HOST']
|
||||
DESKPRO_API_KEY = os.environ['DESKPRO_API_KEY']
|
||||
DESKPRO_PERSON_EMAIL = 'donotreply@notifications.service.gov.uk'
|
||||
DESKPRO_DEPT_ID = os.environ['DESKPRO_DEPT_ID']
|
||||
DESKPRO_ASSIGNED_AGENT_TEAM_ID = os.environ['DESKPRO_ASSIGNED_AGENT_TEAM_ID']
|
||||
ACTIVITY_STATS_LIMIT_DAYS = 7
|
||||
TEST_MESSAGE_FILENAME = 'Test message'
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
export NOTIFY_ENVIRONMENT='test'
|
||||
export ADMIN_CLIENT_SECRET='dev-notify-secret-key'
|
||||
export ADMIN_CLIENT_USER_NAME='dev-notify-admin'
|
||||
export API_HOST_NAME=''
|
||||
export DANGEROUS_SALT='dev-notify-salt'
|
||||
export SECRET_KEY='dev-notify-secret-key'
|
||||
export DESKPRO_API_HOST=""
|
||||
export DESKPRO_API_KEY=""
|
||||
export DESKPRO_DEPT_ID=""
|
||||
export DESKPRO_ASSIGNED_AGENT_TEAM_ID=""
|
||||
|
||||
Reference in New Issue
Block a user