mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 15:59:49 -04:00
2
.github/workflows/deploy-demo.yml
vendored
2
.github/workflows/deploy-demo.yml
vendored
@@ -55,6 +55,7 @@ jobs:
|
|||||||
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
|
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
|
||||||
REDIS_ENABLED: ${{ secrets.REDIS_ENABLED }}
|
REDIS_ENABLED: ${{ secrets.REDIS_ENABLED }}
|
||||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||||
|
NR_BROWSER_KEY: ${{ secrets.NR_BROWSER_KEY }}
|
||||||
with:
|
with:
|
||||||
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||||
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||||
@@ -70,6 +71,7 @@ jobs:
|
|||||||
--var BASIC_AUTH_USERNAME="curiousabout"
|
--var BASIC_AUTH_USERNAME="curiousabout"
|
||||||
--var BASIC_AUTH_PASSWORD="$BASIC_AUTH_PASSWORD"
|
--var BASIC_AUTH_PASSWORD="$BASIC_AUTH_PASSWORD"
|
||||||
--var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY"
|
--var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY"
|
||||||
|
--var NR_BROWSER_KEY="$NR_BROWSER_KEY"
|
||||||
|
|
||||||
- name: Check for changes to egress config
|
- name: Check for changes to egress config
|
||||||
id: changed-egress-config
|
id: changed-egress-config
|
||||||
|
|||||||
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -60,6 +60,7 @@ jobs:
|
|||||||
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
|
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
|
||||||
REDIS_ENABLED: ${{ secrets.REDIS_ENABLED }}
|
REDIS_ENABLED: ${{ secrets.REDIS_ENABLED }}
|
||||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||||
|
NR_BROWSER_KEY: ${{ secrets.NR_BROWSER_KEY }}
|
||||||
with:
|
with:
|
||||||
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
cf_username: ${{ secrets.CLOUDGOV_USERNAME }}
|
||||||
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
cf_password: ${{ secrets.CLOUDGOV_PASSWORD }}
|
||||||
@@ -75,6 +76,7 @@ jobs:
|
|||||||
--var BASIC_AUTH_USERNAME="curiousabout"
|
--var BASIC_AUTH_USERNAME="curiousabout"
|
||||||
--var BASIC_AUTH_PASSWORD="$BASIC_AUTH_PASSWORD"
|
--var BASIC_AUTH_PASSWORD="$BASIC_AUTH_PASSWORD"
|
||||||
--var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY"
|
--var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY"
|
||||||
|
--var NR_BROWSER_KEY="$NR_BROWSER_KEY"
|
||||||
|
|
||||||
- name: Check for changes to egress config
|
- name: Check for changes to egress config
|
||||||
id: changed-egress-config
|
id: changed-egress-config
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
from os import getenv
|
from os import getenv
|
||||||
|
|
||||||
|
import newrelic.agent
|
||||||
import pytz
|
import pytz
|
||||||
|
|
||||||
from app.cloudfoundry_config import cloud_config
|
from app.cloudfoundry_config import cloud_config
|
||||||
@@ -28,6 +29,14 @@ class Config(object):
|
|||||||
BASIC_AUTH_USERNAME = getenv('BASIC_AUTH_USERNAME')
|
BASIC_AUTH_USERNAME = getenv('BASIC_AUTH_USERNAME')
|
||||||
BASIC_AUTH_PASSWORD = getenv('BASIC_AUTH_PASSWORD')
|
BASIC_AUTH_PASSWORD = getenv('BASIC_AUTH_PASSWORD')
|
||||||
|
|
||||||
|
NR_ACCOUNT_ID = getenv('NR_ACCOUNT_ID')
|
||||||
|
NR_TRUST_KEY = getenv('NR_TRUST_KEY')
|
||||||
|
NR_AGENT_ID = getenv('NR_AGENT_ID')
|
||||||
|
NR_APP_ID = getenv('NR_APP_ID')
|
||||||
|
NR_BROWSER_KEY = getenv('NR_BROWSER_KEY')
|
||||||
|
settings = newrelic.agent.global_settings()
|
||||||
|
NR_MONITOR_ON = settings and settings.monitor_mode
|
||||||
|
|
||||||
TEMPLATE_PREVIEW_API_HOST = getenv('TEMPLATE_PREVIEW_API_HOST', 'http://localhost:9999')
|
TEMPLATE_PREVIEW_API_HOST = getenv('TEMPLATE_PREVIEW_API_HOST', 'http://localhost:9999')
|
||||||
TEMPLATE_PREVIEW_API_KEY = getenv('TEMPLATE_PREVIEW_API_KEY', 'my-secret-key')
|
TEMPLATE_PREVIEW_API_KEY = getenv('TEMPLATE_PREVIEW_API_KEY', 'my-secret-key')
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,13 @@
|
|||||||
<html lang="{{ htmlLang | default('en') }}" class="govuk-template {{ htmlClasses }}">
|
<html lang="{{ htmlLang | default('en') }}" class="govuk-template {{ htmlClasses }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>{% block pageTitle %}GOV.UK - The best place to find government services and information{% endblock %}</title>
|
<title>{% block pageTitle %}U.S. Notify{% endblock %}</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}
|
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}
|
||||||
|
{% if config['NR_MONITOR_ON'] %}
|
||||||
|
{% include "partials/newrelic.html" -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Ensure that older IE versions always render with the correct rendering engine #}
|
{# Ensure that older IE versions always render with the correct rendering engine #}
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
|
||||||
|
|||||||
7
app/templates/partials/newrelic.html
Normal file
7
app/templates/partials/newrelic.html
Normal file
File diff suppressed because one or more lines are too long
@@ -2,3 +2,5 @@ env: demo
|
|||||||
instances: 1
|
instances: 1
|
||||||
memory: 1G
|
memory: 1G
|
||||||
public_admin_route: notify-demo.app.cloud.gov
|
public_admin_route: notify-demo.app.cloud.gov
|
||||||
|
nr_agent_id: "1134302465"
|
||||||
|
nr_app_id: "1083160688"
|
||||||
|
|||||||
@@ -2,3 +2,5 @@ env: production
|
|||||||
instances: 2
|
instances: 2
|
||||||
memory: 1G
|
memory: 1G
|
||||||
public_admin_route: notify.app.cloud.gov
|
public_admin_route: notify.app.cloud.gov
|
||||||
|
nr_agent_id: ""
|
||||||
|
nr_app_id: ""
|
||||||
|
|||||||
@@ -9,3 +9,6 @@ SECRET_KEY: sandbox-notify-secret-key
|
|||||||
BASIC_AUTH_USERNAME: sandbox
|
BASIC_AUTH_USERNAME: sandbox
|
||||||
BASIC_AUTH_PASSWORD: sandbox
|
BASIC_AUTH_PASSWORD: sandbox
|
||||||
REDIS_ENABLED: 1
|
REDIS_ENABLED: 1
|
||||||
|
nr_agent_id: ""
|
||||||
|
nr_app_id: ""
|
||||||
|
NR_BROWSER_KEY: ""
|
||||||
|
|||||||
@@ -2,3 +2,5 @@ env: staging
|
|||||||
instances: 1
|
instances: 1
|
||||||
memory: 1G
|
memory: 1G
|
||||||
public_admin_route: notify-staging.app.cloud.gov
|
public_admin_route: notify-staging.app.cloud.gov
|
||||||
|
nr_agent_id: "1134291385"
|
||||||
|
nr_app_id: "1031640326"
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ applications:
|
|||||||
NEW_RELIC_CONFIG_FILE: newrelic.ini
|
NEW_RELIC_CONFIG_FILE: newrelic.ini
|
||||||
NEW_RELIC_ENVIRONMENT: ((env))
|
NEW_RELIC_ENVIRONMENT: ((env))
|
||||||
|
|
||||||
|
NR_ACCOUNT_ID=3389907
|
||||||
|
NR_TRUST_KEY=562946
|
||||||
|
NR_AGENT_ID=((nr_agent_id))
|
||||||
|
NR_APP_ID=((nr_app_id))
|
||||||
|
NR_BROWSER_KEY=((NR_BROWSER_KEY))
|
||||||
|
|
||||||
REDIS_ENABLED: ((REDIS_ENABLED))
|
REDIS_ENABLED: ((REDIS_ENABLED))
|
||||||
ADMIN_BASE_URL: https://((public_admin_route))
|
ADMIN_BASE_URL: https://((public_admin_route))
|
||||||
API_HOST_NAME: https://notify-api-((env)).apps.internal:61443
|
API_HOST_NAME: https://notify-api-((env)).apps.internal:61443
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ distributed_tracing.enabled = true
|
|||||||
# application and reports this data to the New Relic UI at
|
# application and reports this data to the New Relic UI at
|
||||||
# newrelic.com. This global switch is normally overridden for
|
# newrelic.com. This global switch is normally overridden for
|
||||||
# each environment below.
|
# each environment below.
|
||||||
monitor_mode = true
|
monitor_mode = false
|
||||||
|
|
||||||
# Sets the name of a file to log agent messages to. Useful for
|
# Sets the name of a file to log agent messages to. Useful for
|
||||||
# debugging any issues with the agent. This is not set by
|
# debugging any issues with the agent. This is not set by
|
||||||
@@ -177,7 +177,7 @@ error_collector.ignore_errors =
|
|||||||
# For those Python web frameworks that are supported, this
|
# For those Python web frameworks that are supported, this
|
||||||
# setting enables the auto-insertion of the browser monitoring
|
# setting enables the auto-insertion of the browser monitoring
|
||||||
# JavaScript fragments.
|
# JavaScript fragments.
|
||||||
browser_monitoring.auto_instrument = true
|
browser_monitoring.auto_instrument = false
|
||||||
|
|
||||||
# A thread profiling session can be scheduled via the UI when
|
# A thread profiling session can be scheduled via the UI when
|
||||||
# this option is enabled. The thread profiler will periodically
|
# this option is enabled. The thread profiler will periodically
|
||||||
|
|||||||
@@ -27,3 +27,8 @@ REDIS_URL=redis://localhost:6379/0
|
|||||||
# New Relic
|
# New Relic
|
||||||
NEW_RELIC_CONFIG_FILE=newrelic.ini
|
NEW_RELIC_CONFIG_FILE=newrelic.ini
|
||||||
NEW_RELIC_LICENSE_KEY="don't write secrets to the sample file"
|
NEW_RELIC_LICENSE_KEY="don't write secrets to the sample file"
|
||||||
|
NR_ACCOUNT_ID=3389907
|
||||||
|
NR_TRUST_KEY=562946
|
||||||
|
NR_AGENT_ID=1134289521
|
||||||
|
NR_APP_ID=1013682065
|
||||||
|
NR_BROWSER_KEY="don't write secrets to the sample file"
|
||||||
|
|||||||
Reference in New Issue
Block a user