mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-22 23:36:08 -04:00
Compare commits
11 Commits
jim/062722
...
jim/071422
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10ac8fe8ed | ||
|
|
18a04fd719 | ||
|
|
f0cb133129 | ||
|
|
b51e49a662 | ||
|
|
8825e0155d | ||
|
|
e61a2f01aa | ||
|
|
a9a3e4d662 | ||
|
|
4bfd6c9b70 | ||
|
|
3ac3dcd09d | ||
|
|
3457c5a687 | ||
|
|
1b7de2a5dd |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -78,5 +78,6 @@ celerybeat-schedule
|
||||
# CloudFoundry
|
||||
.cf
|
||||
varsfile*
|
||||
.secret*
|
||||
|
||||
/scripts/run_my_tests.sh
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
{
|
||||
"version": "1.2.0",
|
||||
"plugins_used": [
|
||||
{
|
||||
"name": "ArtifactoryDetector"
|
||||
},
|
||||
{
|
||||
"name": "AWSKeyDetector"
|
||||
},
|
||||
{
|
||||
"name": "AzureStorageKeyDetector"
|
||||
},
|
||||
{
|
||||
"name": "Base64HighEntropyString",
|
||||
"limit": 4.5
|
||||
},
|
||||
{
|
||||
"name": "BasicAuthDetector"
|
||||
},
|
||||
{
|
||||
"name": "CloudantDetector"
|
||||
},
|
||||
{
|
||||
"name": "GitHubTokenDetector"
|
||||
},
|
||||
{
|
||||
"name": "HexHighEntropyString",
|
||||
"limit": 3.0
|
||||
},
|
||||
{
|
||||
"name": "IbmCloudIamDetector"
|
||||
},
|
||||
{
|
||||
"name": "IbmCosHmacDetector"
|
||||
},
|
||||
{
|
||||
"name": "JwtTokenDetector"
|
||||
},
|
||||
{
|
||||
"name": "KeywordDetector",
|
||||
"keyword_exclude": ""
|
||||
},
|
||||
{
|
||||
"name": "MailchimpDetector"
|
||||
},
|
||||
{
|
||||
"name": "NpmDetector"
|
||||
},
|
||||
{
|
||||
"name": "PrivateKeyDetector"
|
||||
},
|
||||
{
|
||||
"name": "SendGridDetector"
|
||||
},
|
||||
{
|
||||
"name": "SlackDetector"
|
||||
},
|
||||
{
|
||||
"name": "SoftlayerDetector"
|
||||
},
|
||||
{
|
||||
"name": "SquareOAuthDetector"
|
||||
},
|
||||
{
|
||||
"name": "StripeDetector"
|
||||
},
|
||||
{
|
||||
"name": "TwilioKeyDetector"
|
||||
}
|
||||
],
|
||||
"filters_used": [
|
||||
{
|
||||
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
|
||||
"min_level": 2
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_lock_file"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_sequential_string"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_swagger_file"
|
||||
},
|
||||
{
|
||||
"path": "detect_secrets.filters.heuristic.is_templated_secret"
|
||||
}
|
||||
],
|
||||
"results": {
|
||||
"README.md": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "README.md",
|
||||
"hashed_secret": "3bf710d852e4ffb2bf157dccd3e6099d9cd6654f",
|
||||
"is_verified": false,
|
||||
"line_number": 30
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "README.md",
|
||||
"hashed_secret": "fc5462be70401cb2f7940d506ff413e722bb9bbd",
|
||||
"is_verified": false,
|
||||
"line_number": 31
|
||||
}
|
||||
],
|
||||
"app/config.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "app/config.py",
|
||||
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
|
||||
"is_verified": false,
|
||||
"line_number": 432
|
||||
}
|
||||
],
|
||||
"app/models.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "app/models.py",
|
||||
"hashed_secret": "12322e07b94ee3c7cd65a2952ece441538b53eb3",
|
||||
"is_verified": false,
|
||||
"line_number": 1891
|
||||
}
|
||||
],
|
||||
"docker-compose.devcontainer.yml": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "docker-compose.devcontainer.yml",
|
||||
"hashed_secret": "5b98cf4c3d794c8af1fcd7991e89cd4e52fb42a4",
|
||||
"is_verified": false,
|
||||
"line_number": 12
|
||||
}
|
||||
],
|
||||
"migrations/versions/0025_notify_service_data.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "migrations/versions/0025_notify_service_data.py",
|
||||
"hashed_secret": "14153c7b93d1070d1579eb85d81cf660b330befc",
|
||||
"is_verified": false,
|
||||
"line_number": 83
|
||||
}
|
||||
],
|
||||
"pytest.ini": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "pytest.ini",
|
||||
"hashed_secret": "e501a39b67f82817f7ec580a36f6932e5377e59c",
|
||||
"is_verified": false,
|
||||
"line_number": 5
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "pytest.ini",
|
||||
"hashed_secret": "a3e8fada29009777b0855fa5fadeb0bb91de4ef6",
|
||||
"is_verified": false,
|
||||
"line_number": 6
|
||||
}
|
||||
],
|
||||
"sample.env": [
|
||||
{
|
||||
"type": "Basic Auth Credentials",
|
||||
"filename": "sample.env",
|
||||
"hashed_secret": "5b98cf4c3d794c8af1fcd7991e89cd4e52fb42a4",
|
||||
"is_verified": false,
|
||||
"line_number": 33
|
||||
}
|
||||
],
|
||||
"tests/app/authentication/test_authentication.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/authentication/test_authentication.py",
|
||||
"hashed_secret": "9ba831ebe84a351453e3bd542a5e692316120170",
|
||||
"is_verified": false,
|
||||
"line_number": 42
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/authentication/test_authentication.py",
|
||||
"hashed_secret": "23332b8380ee6a1c573083631c41d8d5130e8d2a",
|
||||
"is_verified": false,
|
||||
"line_number": 186
|
||||
}
|
||||
],
|
||||
"tests/app/aws/test_s3.py": [
|
||||
{
|
||||
"type": "Hex High Entropy String",
|
||||
"filename": "tests/app/aws/test_s3.py",
|
||||
"hashed_secret": "67a74306b06d0c01624fe0d0249a570f4d093747",
|
||||
"is_verified": false,
|
||||
"line_number": 13
|
||||
}
|
||||
],
|
||||
"tests/app/clients/test_cbc_proxy.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/clients/test_cbc_proxy.py",
|
||||
"hashed_secret": "ba59e920f3d2ebb6a219a8b7e40ecb606ea697dd",
|
||||
"is_verified": false,
|
||||
"line_number": 39
|
||||
}
|
||||
],
|
||||
"tests/app/clients/test_document_download.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/clients/test_document_download.py",
|
||||
"hashed_secret": "3acfb2c2b433c0ea7ff107e33df91b18e52f960f",
|
||||
"is_verified": false,
|
||||
"line_number": 16
|
||||
}
|
||||
],
|
||||
"tests/app/conftest.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/conftest.py",
|
||||
"hashed_secret": "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33",
|
||||
"is_verified": false,
|
||||
"line_number": 620
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/conftest.py",
|
||||
"hashed_secret": "4ff75f80957469c4b6af5824cb99bf4919abad98",
|
||||
"is_verified": false,
|
||||
"line_number": 621
|
||||
}
|
||||
],
|
||||
"tests/app/dao/test_services_dao.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/dao/test_services_dao.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 259
|
||||
}
|
||||
],
|
||||
"tests/app/dao/test_users_dao.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/dao/test_users_dao.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 49
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/dao/test_users_dao.py",
|
||||
"hashed_secret": "f2c57870308dc87f432e5912d4de6f8e322721ba",
|
||||
"is_verified": false,
|
||||
"line_number": 164
|
||||
}
|
||||
],
|
||||
"tests/app/db.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/db.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 93
|
||||
},
|
||||
{
|
||||
"type": "Base64 High Entropy String",
|
||||
"filename": "tests/app/db.py",
|
||||
"hashed_secret": "2020f1df1bb8bbe6d7f3e6b2d136cd2a38ad7fed",
|
||||
"is_verified": false,
|
||||
"line_number": 891
|
||||
},
|
||||
{
|
||||
"type": "Base64 High Entropy String",
|
||||
"filename": "tests/app/db.py",
|
||||
"hashed_secret": "0362114f115be22057673eda269208449bec65ff",
|
||||
"is_verified": false,
|
||||
"line_number": 892
|
||||
}
|
||||
],
|
||||
"tests/app/letters/test_returned_letters.py": [
|
||||
{
|
||||
"type": "Hex High Entropy String",
|
||||
"filename": "tests/app/letters/test_returned_letters.py",
|
||||
"hashed_secret": "d782ccb6785b5e3cef91a149f946a38cea88fb81",
|
||||
"is_verified": false,
|
||||
"line_number": 5
|
||||
},
|
||||
{
|
||||
"type": "Hex High Entropy String",
|
||||
"filename": "tests/app/letters/test_returned_letters.py",
|
||||
"hashed_secret": "52f1e518a8f64e70f1f443eebe7cdd2e8cdaf83f",
|
||||
"is_verified": false,
|
||||
"line_number": 7
|
||||
}
|
||||
],
|
||||
"tests/app/notifications/test_receive_notification.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/notifications/test_receive_notification.py",
|
||||
"hashed_secret": "913a73b565c8e2c8ed94497580f619397709b8b6",
|
||||
"is_verified": false,
|
||||
"line_number": 25
|
||||
}
|
||||
],
|
||||
"tests/app/notifications/test_validators.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/notifications/test_validators.py",
|
||||
"hashed_secret": "9c2a6e4809aeef7b7712ca4db05a681452f4f748",
|
||||
"is_verified": false,
|
||||
"line_number": 401
|
||||
}
|
||||
],
|
||||
"tests/app/service/test_rest.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/service/test_rest.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 1297
|
||||
}
|
||||
],
|
||||
"tests/app/template/test_rest.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/template/test_rest.py",
|
||||
"hashed_secret": "3acfb2c2b433c0ea7ff107e33df91b18e52f960f",
|
||||
"is_verified": false,
|
||||
"line_number": 1168
|
||||
}
|
||||
],
|
||||
"tests/app/user/test_rest.py": [
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/user/test_rest.py",
|
||||
"hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8",
|
||||
"is_verified": false,
|
||||
"line_number": 108
|
||||
},
|
||||
{
|
||||
"type": "Secret Keyword",
|
||||
"filename": "tests/app/user/test_rest.py",
|
||||
"hashed_secret": "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33",
|
||||
"is_verified": false,
|
||||
"line_number": 889
|
||||
}
|
||||
],
|
||||
"tests/app/v2/broadcast/test_post_broadcast.py": [
|
||||
{
|
||||
"type": "Hex High Entropy String",
|
||||
"filename": "tests/app/v2/broadcast/test_post_broadcast.py",
|
||||
"hashed_secret": "afddbc89a4e7b99f99eb0b1fad44d7aed566c77f",
|
||||
"is_verified": false,
|
||||
"line_number": 99
|
||||
},
|
||||
{
|
||||
"type": "Hex High Entropy String",
|
||||
"filename": "tests/app/v2/broadcast/test_post_broadcast.py",
|
||||
"hashed_secret": "a1f83866aff48443fffba0f8c6f11da4ad2e6763",
|
||||
"is_verified": false,
|
||||
"line_number": 215
|
||||
}
|
||||
]
|
||||
},
|
||||
"generated_at": "2022-06-27T21:40:11Z"
|
||||
}
|
||||
14
Makefile
14
Makefile
@@ -35,6 +35,10 @@ bootstrap-with-docker: ## Build the image to run the app in Docker
|
||||
run-flask: ## Run flask
|
||||
flask run -p 6011 --host=0.0.0.0
|
||||
|
||||
.PHONY: purge-celery
|
||||
purge-celery: ## cf run-task notifications-api --command="celery -A run_celery.notify_celery purge -f" --name api_purge_celery
|
||||
celery -A run_celery.notify_celery purge -f
|
||||
|
||||
.PHONY: run-celery
|
||||
run-celery: ## Run celery, TODO remove purge for staging/prod
|
||||
celery -A run_celery.notify_celery purge -f
|
||||
@@ -146,16 +150,16 @@ cf-deploy: ## Deploys the app to Cloud Foundry
|
||||
cf-deploy-api-db-migration:
|
||||
$(if ${CF_SPACE},,$(error Must specify CF_SPACE))
|
||||
cf target -o ${CF_ORG} -s ${CF_SPACE}
|
||||
make -s CF_APP=notify-api-db-migration generate-manifest > ${CF_MANIFEST_PATH}
|
||||
make -s CF_APP=notifications-api generate-manifest > ${CF_MANIFEST_PATH}
|
||||
|
||||
cf push notify-api-db-migration --no-route -f ${CF_MANIFEST_PATH}
|
||||
cf push notifications-api --no-route -f ${CF_MANIFEST_PATH}
|
||||
rm ${CF_MANIFEST_PATH}
|
||||
|
||||
cf run-task notify-api-db-migration --command="flask db upgrade" --name api_db_migration
|
||||
cf run-task notifications-api --command="flask db upgrade" --name api_db_migration
|
||||
|
||||
.PHONY: cf-check-api-db-migration-task
|
||||
cf-check-api-db-migration-task: ## Get the status for the last notify-api-db-migration task
|
||||
@cf curl /v3/apps/`cf app --guid notify-api-db-migration`/tasks?order_by=-created_at | jq -r ".resources[0].state"
|
||||
cf-check-api-db-migration-task: ## Get the status for the last notifications-api task
|
||||
@cf curl /v3/apps/`cf app --guid notifications-api`/tasks?order_by=-created_at | jq -r ".resources[0].state"
|
||||
|
||||
.PHONY: cf-rollback
|
||||
cf-rollback: ## Rollbacks the app to the previous release
|
||||
|
||||
106
README.md
106
README.md
@@ -1,6 +1,7 @@
|
||||
# GOV.UK Notify API
|
||||
|
||||
Contains:
|
||||
|
||||
- the public-facing REST API for GOV.UK Notify, which teams can integrate with using [our clients](https://www.notifications.service.gov.uk/documentation)
|
||||
- an internal-only REST API built using Flask to manage services, users, templates, etc (this is what the [admin app](http://github.com/alphagov/notifications-admin) talks to)
|
||||
- asynchronous workers built using Celery to put things on queues and read them off to be processed, sent to providers, updated, etc
|
||||
@@ -19,35 +20,59 @@ We run python 3.9 both locally and in production.
|
||||
|
||||
To run the API you will need appropriate AWS credentials. See the [Wiki](https://github.com/alphagov/notifications-manuals/wiki/aws-accounts#how-to-set-up-local-development) for more details.
|
||||
|
||||
### `environment.sh`
|
||||
### `.env` file
|
||||
|
||||
Creating and edit an environment.sh file.
|
||||
|
||||
```
|
||||
echo "
|
||||
export NOTIFY_ENVIRONMENT='development'
|
||||
|
||||
export MMG_API_KEY='MMG_API_KEY'
|
||||
export FIRETEXT_API_KEY='FIRETEXT_ACTUAL_KEY'
|
||||
export NOTIFICATION_QUEUE_PREFIX='YOUR_OWN_PREFIX'
|
||||
|
||||
export FLASK_APP=application.py
|
||||
export FLASK_ENV=development
|
||||
export WERKZEUG_DEBUG_PIN=off
|
||||
"> environment.sh
|
||||
```
|
||||
Create and edit a .env file, based on sample.env
|
||||
|
||||
Things to change:
|
||||
|
||||
* Replace `YOUR_OWN_PREFIX` with `local_dev_<first name>`.
|
||||
* Run the following in the credentials repo to get the API keys.
|
||||
- Replace `YOUR_OWN_PREFIX` with `local_dev_<first name>`
|
||||
- Replace `NOTIFY_EMAIL_DOMAIN` with the domain your emails will come from (i.e. the "origination email" in your SES project)
|
||||
- Replace `SECRET_KEY` and `DANGEROUS_SALT` with high-entropy secret values
|
||||
- Set up AWS SES and SNS as indicated in next section (AWS Setup), fill in missing AWS env vars
|
||||
|
||||
### AWS Setup
|
||||
|
||||
**Steps to prepare SES**
|
||||
|
||||
1. Go to SES console for \$AWS_REGION and create new origin and destination emails. AWS will send a verification via email which you'll need to complete.
|
||||
2. Find and replace instances in the repo of "testsender", "testreceiver" and "dispostable.com", with your origin and destination email addresses, which you verified in step 1 above.
|
||||
|
||||
TODO: create env vars for these origin and destination email addresses for the root service, and create new migrations to update postgres seed fixtures
|
||||
|
||||
**Steps to prepare SNS**
|
||||
|
||||
1. Go to Pinpoints console for \$AWS_PINPOINT_REGION and choose "create new project", then "configure for sms"
|
||||
2. Tick the box at the top to enable SMS, choose "transactional" as the default type and save
|
||||
3. In the lefthand sidebar, go the "SMS and Voice" (bottom) and choose "Phone Numbers"
|
||||
4. Under "Number Settings" choose "Request Phone Number"
|
||||
5. Choose Toll-free number, tick SMS, untick Voice, choose "transactional", hit next and then "request"
|
||||
6. Go to SNS console for \$AWS_PINPOINT_REGION, look at lefthand sidebar under "Mobile" and go to "Text Messaging (SMS)"
|
||||
7. Scroll down to "Sandbox destination phone numbers" and tap "Add phone number" then follow the steps to verify (you'll need to be able to retrieve a code sent to each number)
|
||||
|
||||
At this point, you _should_ be able to complete both the email and phone verification steps of the Notify user sign up process! 🎉
|
||||
|
||||
### Secrets Detection
|
||||
|
||||
```
|
||||
notify-pass credentials/firetext
|
||||
notify-pass credentials/mmg
|
||||
brew install detect-secrets # or pip install detect-secrets
|
||||
detect-secrets scan
|
||||
#review output of above, make sure none of the baseline entries are sensitive
|
||||
detect-secrets scan > .secrets.baseline
|
||||
#creates the baseline file
|
||||
```
|
||||
|
||||
### Postgres
|
||||
Ideally, you'll install `detect-secrets` so that it's accessible from any environment from which you _might_ commit. You can use `brew install` to make it available globally. You could also install via `pip install` inside a virtual environment, if you're sure you'll _only_ commit from that environment.
|
||||
|
||||
If you open .git/hooks/pre-commit you should see a simple bash script that runs the command below, reads the output and aborts before committing if detect-secrets finds a secret. You should be able to test it by staging a file with any high-entropy string like `"bblfwk3u4bt484+afw4avev5ae+afr4?/fa"` (it also has other ways to detect secrets, this is just the most straightforward to test).
|
||||
|
||||
You can permit exceptions by adding an inline comment containing `pragma: allowlist secret`
|
||||
|
||||
The command that is actually run by the pre-commit hook is: `git diff --staged --name-only -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline`
|
||||
|
||||
You can also run against all tracked files staged or not: `git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline`
|
||||
|
||||
### Postgres [DEPRECATED]
|
||||
|
||||
Install [Postgres.app](http://postgresapp.com/).
|
||||
|
||||
@@ -59,7 +84,7 @@ Currently the API works with PostgreSQL 11. After installation, open the Postgre
|
||||
export PATH=${PATH}:/Applications/Postgres.app/Contents/Versions/11/bin/
|
||||
```
|
||||
|
||||
### Redis
|
||||
### Redis [DEPRECATED]
|
||||
|
||||
To switch redis on you'll need to install it locally. On a Mac you can do:
|
||||
|
||||
@@ -75,36 +100,31 @@ To use redis caching you need to switch it on with an environment variable:
|
||||
export REDIS_ENABLED=1
|
||||
```
|
||||
|
||||
## To run the application
|
||||
## To run the application
|
||||
|
||||
```
|
||||
# install dependencies, etc.
|
||||
make bootstrap
|
||||
# set up AWS SES/SNS as instructed above
|
||||
|
||||
# run the web app
|
||||
# create .env file as instructed above
|
||||
|
||||
# download vscode and install the Remote-Containers plug-in from Microsoft
|
||||
|
||||
# create the external docker network
|
||||
docker network create notify-network
|
||||
|
||||
# Using the command pallette, search "Remote Containers: Open folder in project" and choose devcontainer-api, then wait for docker to build
|
||||
|
||||
# Open a terminal in vscode and run the web server
|
||||
make run-flask
|
||||
|
||||
# run the background tasks
|
||||
# Open another terminal in vscode and run the background tasks
|
||||
make run-celery
|
||||
|
||||
# run scheduled tasks (optional)
|
||||
# Open a third terminal in vscode and run scheduled tasks (optional)
|
||||
make run-celery-beat
|
||||
```
|
||||
|
||||
We've had problems running Celery locally due to one of its dependencies: pycurl. Due to the complexity of the issue, we also support running Celery via Docker:
|
||||
|
||||
```
|
||||
# install dependencies, etc.
|
||||
make bootstrap-with-docker
|
||||
|
||||
# run the background tasks
|
||||
make run-celery-with-docker
|
||||
|
||||
# run scheduled tasks
|
||||
make run-celery-beat-with-docker
|
||||
```
|
||||
|
||||
## To test the application
|
||||
## To test the application
|
||||
|
||||
```
|
||||
# install dependencies, etc.
|
||||
@@ -120,11 +140,13 @@ care about: `flask db` contains alembic migration commands, and `flask command`
|
||||
example, to purge all dynamically generated functional test data, do the following:
|
||||
|
||||
Locally
|
||||
|
||||
```
|
||||
flask command purge_functional_test_data -u <functional tests user name prefix>
|
||||
```
|
||||
|
||||
On the server
|
||||
|
||||
```
|
||||
cf run-task notify-api "flask command purge_functional_test_data -u <functional tests user name prefix>"
|
||||
```
|
||||
|
||||
@@ -82,47 +82,42 @@ class TaskNames(object):
|
||||
|
||||
class Config(object):
|
||||
# URL of admin app
|
||||
ADMIN_BASE_URL = os.getenv('ADMIN_BASE_URL')
|
||||
ADMIN_BASE_URL = os.environ.get('ADMIN_BASE_URL')
|
||||
|
||||
# URL of api app (on AWS this is the internal api endpoint)
|
||||
API_HOST_NAME = os.getenv('API_HOST_NAME')
|
||||
API_HOST_NAME = os.environ.get('API_HOST_NAME')
|
||||
|
||||
# secrets that internal apps, such as the admin app or document download, must use to authenticate with the API
|
||||
ADMIN_CLIENT_ID = 'notify-admin'
|
||||
GOVUK_ALERTS_CLIENT_ID = 'govuk-alerts'
|
||||
|
||||
ADMIN_CLIENT_ID = os.environ.get('ADMIN_CLIENT_ID')
|
||||
GOVUK_ALERTS_CLIENT_ID = 'govuk-alerts' # TODO: can remove?
|
||||
ADMIN_CLIENT_SECRET = os.environ.get('ADMIN_CLIENT_SECRET')
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY')
|
||||
DANGEROUS_SALT = os.environ.get('DANGEROUS_SALT')
|
||||
|
||||
INTERNAL_CLIENT_API_KEYS = json.loads(
|
||||
os.environ.get('INTERNAL_CLIENT_API_KEYS', '{"notify-admin":["dev-notify-secret-key"]}')
|
||||
)
|
||||
|
||||
# encyption secret/salt
|
||||
ADMIN_CLIENT_SECRET = os.getenv('ADMIN_CLIENT_SECRET', 'dev-notify-secret-key')
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', 'dev-notify-secret-key')
|
||||
DANGEROUS_SALT = os.getenv('DANGEROUS_SALT', 'dev-notify-salt ')
|
||||
os.environ.get('INTERNAL_CLIENT_API_KEYS', '{"'+ADMIN_CLIENT_ID+'":["'+ADMIN_CLIENT_SECRET+'"]}')
|
||||
) # TODO: better handled in manifest?
|
||||
|
||||
# DB conection string
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
|
||||
|
||||
# Redis conection string
|
||||
REDIS_URL = os.getenv('REDIS_URL')
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI')
|
||||
|
||||
# AWS SMS
|
||||
AWS_PINPOINT_REGION = os.getenv("AWS_PINPOINT_REGION", "us-west-2")
|
||||
AWS_US_TOLL_FREE_NUMBER = os.getenv("AWS_US_TOLL_FREE_NUMBER", "+18446120782")
|
||||
AWS_PINPOINT_REGION = os.environ.get("AWS_PINPOINT_REGION")
|
||||
AWS_US_TOLL_FREE_NUMBER = os.environ.get("AWS_US_TOLL_FREE_NUMBER")
|
||||
|
||||
# MMG API Key
|
||||
MMG_API_KEY = os.getenv('MMG_API_KEY')
|
||||
MMG_API_KEY = os.environ.get('MMG_API_KEY', 'placeholder')
|
||||
|
||||
# Firetext API Key
|
||||
FIRETEXT_API_KEY = os.getenv("FIRETEXT_API_KEY")
|
||||
FIRETEXT_INTERNATIONAL_API_KEY = os.getenv("FIRETEXT_INTERNATIONAL_API_KEY", "placeholder")
|
||||
FIRETEXT_API_KEY = os.environ.get("FIRETEXT_API_KEY", "placeholder")
|
||||
FIRETEXT_INTERNATIONAL_API_KEY = os.environ.get("FIRETEXT_INTERNATIONAL_API_KEY", "placeholder")
|
||||
|
||||
# Prefix to identify queues in SQS
|
||||
NOTIFICATION_QUEUE_PREFIX = os.getenv('NOTIFICATION_QUEUE_PREFIX')
|
||||
NOTIFICATION_QUEUE_PREFIX = os.environ.get('NOTIFICATION_QUEUE_PREFIX')
|
||||
|
||||
# URL of redis instance
|
||||
REDIS_URL = os.getenv('REDIS_URL')
|
||||
REDIS_ENABLED = True
|
||||
REDIS_URL = os.environ.get('REDIS_URL')
|
||||
REDIS_ENABLED = False
|
||||
EXPIRE_CACHE_TEN_MINUTES = 600
|
||||
EXPIRE_CACHE_EIGHT_DAYS = 8 * 24 * 60 * 60
|
||||
|
||||
@@ -131,7 +126,7 @@ class Config(object):
|
||||
|
||||
# Logging
|
||||
DEBUG = False
|
||||
NOTIFY_LOG_PATH = os.getenv('NOTIFY_LOG_PATH')
|
||||
NOTIFY_LOG_PATH = os.environ.get('NOTIFY_LOG_PATH')
|
||||
|
||||
# Cronitor
|
||||
CRONITOR_ENABLED = False
|
||||
@@ -352,12 +347,12 @@ class Config(object):
|
||||
}
|
||||
|
||||
# we can set celeryd_prefetch_multiplier to be 1 for celery apps which handle only long running tasks
|
||||
if os.getenv('CELERYD_PREFETCH_MULTIPLIER'):
|
||||
CELERY['worker_prefetch_multiplier'] = os.getenv('CELERYD_PREFETCH_MULTIPLIER')
|
||||
if os.environ.get('CELERYD_PREFETCH_MULTIPLIER'):
|
||||
CELERY['worker_prefetch_multiplier'] = os.environ.get('CELERYD_PREFETCH_MULTIPLIER')
|
||||
|
||||
FROM_NUMBER = 'development'
|
||||
|
||||
STATSD_HOST = os.getenv('STATSD_HOST')
|
||||
STATSD_HOST = os.environ.get('STATSD_HOST')
|
||||
STATSD_PORT = 8125
|
||||
STATSD_ENABLED = bool(STATSD_HOST)
|
||||
|
||||
@@ -412,8 +407,6 @@ class Development(Config):
|
||||
DEBUG = True
|
||||
SQLALCHEMY_ECHO = False
|
||||
|
||||
REDIS_ENABLED = os.getenv('REDIS_ENABLED') == '1'
|
||||
|
||||
CSV_UPLOAD_BUCKET_NAME = 'local-notifications-csv-upload'
|
||||
CONTACT_LIST_BUCKET_NAME = 'local-contact-list'
|
||||
TEST_LETTERS_BUCKET_NAME = 'development-test-letters'
|
||||
@@ -439,12 +432,12 @@ class Development(Config):
|
||||
NOTIFY_LOG_PATH = 'application.log'
|
||||
NOTIFY_EMAIL_DOMAIN = "dispostable.com"
|
||||
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
|
||||
REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379/0')
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
|
||||
REDIS_URL = os.environ.get('REDIS_URL')
|
||||
|
||||
ANTIVIRUS_ENABLED = os.getenv('ANTIVIRUS_ENABLED') == '1'
|
||||
ANTIVIRUS_ENABLED = os.environ.get('ANTIVIRUS_ENABLED') == '1'
|
||||
|
||||
API_HOST_NAME = os.getenv('API_HOST_NAME', 'http://localhost:6011')
|
||||
API_HOST_NAME = os.environ.get('API_HOST_NAME', 'http://localhost:6011')
|
||||
API_RATE_LIMIT_ENABLED = True
|
||||
DVLA_EMAIL_ADDRESSES = ['success@simulator.amazonses.com']
|
||||
|
||||
@@ -475,7 +468,7 @@ class Test(Development):
|
||||
LETTER_SANITISE_BUCKET_NAME = 'test-letters-sanitise'
|
||||
|
||||
# this is overriden in jenkins and on cloudfoundry
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI', 'postgresql://postgres:chummy@db:5432/notification_api')
|
||||
|
||||
CELERY = {
|
||||
**Config.CELERY,
|
||||
@@ -535,22 +528,27 @@ class Staging(Config):
|
||||
class Live(Config):
|
||||
NOTIFY_EMAIL_DOMAIN = os.environ.get('NOTIFY_EMAIL_DOMAIN')
|
||||
NOTIFY_ENVIRONMENT = 'live'
|
||||
CSV_UPLOAD_BUCKET_NAME = 'live-notifications-csv-upload'
|
||||
CONTACT_LIST_BUCKET_NAME = 'production-contact-list'
|
||||
TEST_LETTERS_BUCKET_NAME = 'production-test-letters'
|
||||
DVLA_RESPONSE_BUCKET_NAME = 'notifications.service.gov.uk-ftp'
|
||||
LETTERS_PDF_BUCKET_NAME = 'production-letters-pdf'
|
||||
LETTERS_SCAN_BUCKET_NAME = 'production-letters-scan'
|
||||
INVALID_PDF_BUCKET_NAME = 'production-letters-invalid-pdf'
|
||||
TRANSIENT_UPLOADED_LETTERS = 'production-transient-uploaded-letters'
|
||||
LETTER_SANITISE_BUCKET_NAME = 'production-letters-sanitise'
|
||||
FROM_NUMBER = 'GOVUK'
|
||||
# buckets
|
||||
CSV_UPLOAD_BUCKET_NAME = 'notifications-prototype-csv-upload' # created in gsa sandbox
|
||||
CONTACT_LIST_BUCKET_NAME = 'notifications-prototype-contact-list-upload' # created in gsa sandbox
|
||||
# TODO: verify below buckets only used for letters
|
||||
TEST_LETTERS_BUCKET_NAME = 'production-test-letters' # not created in gsa sandbox
|
||||
DVLA_RESPONSE_BUCKET_NAME = 'notifications.service.gov.uk-ftp' # not created in gsa sandbox
|
||||
LETTERS_PDF_BUCKET_NAME = 'production-letters-pdf' # not created in gsa sandbox
|
||||
LETTERS_SCAN_BUCKET_NAME = 'production-letters-scan' # not created in gsa sandbox
|
||||
INVALID_PDF_BUCKET_NAME = 'production-letters-invalid-pdf' # not created in gsa sandbox
|
||||
TRANSIENT_UPLOADED_LETTERS = 'production-transient-uploaded-letters' # not created in gsa sandbox
|
||||
LETTER_SANITISE_BUCKET_NAME = 'production-letters-sanitise' # not created in gsa sandbox
|
||||
|
||||
FROM_NUMBER = 'US Notify'
|
||||
API_RATE_LIMIT_ENABLED = True
|
||||
CHECK_PROXY_HEADER = True
|
||||
SES_STUB_URL = None
|
||||
|
||||
CRONITOR_ENABLED = True
|
||||
|
||||
NOTIFY_LOG_PATH = os.environ.get('NOTIFY_LOG_PATH', 'application.log')
|
||||
REDIS_URL = os.environ.get('REDIS_URL')
|
||||
|
||||
|
||||
class CloudFoundryConfig(Config):
|
||||
pass
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
},
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.pythonPath": "/usr/local/bin/python"
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"python.linting.pylintPath": "/usr/local/share/pip-global/bin/pylint"
|
||||
},
|
||||
"features": {
|
||||
"docker-from-docker": {
|
||||
@@ -22,9 +23,9 @@
|
||||
}
|
||||
},
|
||||
"extensions": [
|
||||
"ms-python.black-formatter",
|
||||
// "ms-python.python",
|
||||
"donjayamanne.python-extension-pack",
|
||||
"ms-azuretools.vscode-docker",
|
||||
// "ms-azuretools.vscode-docker",
|
||||
"ms-python.vscode-pylance",
|
||||
"eamodio.gitlens",
|
||||
"wholroyd.jinja",
|
||||
@@ -32,10 +33,13 @@
|
||||
"visualstudioexptteam.vscodeintellicode",
|
||||
"yzhang.markdown-all-in-one",
|
||||
"ms-ossdata.vscode-postgresql",
|
||||
"GitHub.copilot",
|
||||
"ms-vsliveshare.vsliveshare",
|
||||
"mtxr.sqltools",
|
||||
"mtxr.sqltools-driver-pg",
|
||||
"GitHub.copilot"
|
||||
// "ms-vsliveshare.vsliveshare",
|
||||
// "mtxr.sqltools",
|
||||
// "mtxr.sqltools-driver-pg"
|
||||
],
|
||||
"forwardPorts": [
|
||||
6011
|
||||
],
|
||||
"postCreateCommand": "notify-dev-entrypoint.sh",
|
||||
"remoteUser": "vscode"
|
||||
|
||||
@@ -23,7 +23,7 @@ echo -e "alias lt='exa -al -T -L 2'" >> ~/.zshrc
|
||||
# echo -e "source <(kubectl completion zsh)" >> ~/.zshrc
|
||||
# echo -e "complete -F __start_kubectl k" >> ~/.zshrc
|
||||
|
||||
cd /workspace
|
||||
cd /workspace
|
||||
|
||||
# Warm up git index prior to display status in prompt else it will
|
||||
# be quite slow on every invocation of starship.
|
||||
|
||||
25
logs/app.log.json
Normal file
25
logs/app.log.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T05:41:53", "requestId": "no-request-id", "application": "app", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T05:42:30", "requestId": "no-request-id", "application": "app", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "delivery", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T05:43:02", "requestId": "no-request-id", "application": "delivery", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "delivery", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T05:43:05", "requestId": "no-request-id", "application": "delivery", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T05:59:55", "requestId": "no-request-id", "application": "app", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T06:00:38", "requestId": "no-request-id", "application": "app", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "delivery", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T06:00:52", "requestId": "no-request-id", "application": "delivery", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "delivery", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-06-29T06:00:56", "requestId": "no-request-id", "application": "delivery", "service_id": "no-service-id", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Email already registered for user 7796f6d5-4fba-48d5-bfa1-80c5b3465d24", "pathname": "/workspace/app/user/rest.py", "lineno": 415, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "To email is testreceiver@dispostable.com", "pathname": "/workspace/app/user/rest.py", "lineno": 418, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "template.id is 0880fbb1-a0c6-46f0-9a8e-36c986381ceb", "pathname": "/workspace/app/user/rest.py", "lineno": 423, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "service.id is d6aa2c68-a2d9-4437-ab19-3ae8eb202553", "pathname": "/workspace/app/user/rest.py", "lineno": 424, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Presisting notification", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 108, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Presisting notification with id 6bc43c9a-79d2-4b6e-b9cf-4fb6ec5a10c4", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 114, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Presisting notification with to address: testreceiver@dispostable.com", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 139, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Presisting notification with type: email", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 149, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Presisting notification to formatted email: testreceiver@dispostable.com", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 151, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Firing dao_create_notification", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 159, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Redis enabled, querying cache key for service id: d6aa2c68-a2d9-4437-ab19-3ae8eb202553", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 162, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Redis daily limit cache key: d6aa2c68-a2d9-4437-ab19-3ae8eb202553-2022-06-29-count", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 164, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Redis daily limit cache key does not exist", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 166, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Set redis daily limit cache key to 1", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 172, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "email 6bc43c9a-79d2-4b6e-b9cf-4fb6ec5a10c4 created at 2022-06-29 06:07:57.373123", "pathname": "/workspace/app/notifications/process_notifications.py", "lineno": 177, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Sending notification to queue", "pathname": "/workspace/app/user/rest.py", "lineno": 442, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
{"name": "app", "levelname": "INFO", "message": "Sent notification to queue", "pathname": "/workspace/app/user/rest.py", "lineno": 446, "time": "2022-06-29T06:07:57", "requestId": null, "application": "app", "service_id": "notify-admin", "logType": "application"}
|
||||
@@ -27,16 +27,17 @@ applications:
|
||||
NOTIFICATION_QUEUE_PREFIX: prototype_10x
|
||||
STATSD_HOST: localhost
|
||||
|
||||
INTERNAL_CLIENT_API_KEYS: '{"notify-admin":["dev-notify-secret-key"]}'
|
||||
|
||||
# Credentials variables
|
||||
DANGEROUS_SALT: ((DANGEROUS_SALT))
|
||||
SECRET_KEY: ((SECRET_KEY))
|
||||
ADMIN_CLIENT_ID: ((ADMIN_CLIENT_ID))
|
||||
ADMIN_CLIENT_SECRET: ((ADMIN_CLIENT_SECRET))
|
||||
INTERNAL_CLIENT_API_KEYS: '{"notify-admin":["dev-notify-secret-key"]}'
|
||||
AWS_REGION: us-west-2
|
||||
AWS_PINPOINT_REGION: us-west-2
|
||||
AWS_US_TOLL_FREE_NUMBER: +18446120782
|
||||
AWS_ACCESS_KEY_ID: ((AWS_ACCESS_KEY_ID))
|
||||
AWS_SECRET_ACCESS_KEY: ((AWS_SECRET_ACCESS_KEY))
|
||||
AWS_US_TOLL_FREE_NUMBER: +18446120782
|
||||
|
||||
DVLA_EMAIL_ADDRESSES: []
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ PyJWT==2.4.0
|
||||
SQLAlchemy==1.4.36
|
||||
cachetools==5.1.0
|
||||
beautifulsoup4==4.11.1
|
||||
lxml==4.8.0
|
||||
lxml==4.9.1
|
||||
Werkzeug==2.0.3 # pyup: <2.1.0 # later versions are not compatible with the version of flask-sqlalchemy we have pinned
|
||||
python-dotenv==0.20.0
|
||||
|
||||
|
||||
@@ -77,8 +77,6 @@ docopt==0.6.2
|
||||
# via notifications-python-client
|
||||
docutils==0.16
|
||||
# via awscli
|
||||
python-dotenv==0.20.0
|
||||
# via -r requirements.in
|
||||
eventlet==0.33.1
|
||||
# via gunicorn
|
||||
flask==2.1.2
|
||||
@@ -111,15 +109,15 @@ geojson==2.5.0
|
||||
govuk-bank-holidays==0.11
|
||||
# via notifications-utils
|
||||
greenlet==1.1.2
|
||||
# via eventlet
|
||||
# via
|
||||
# eventlet
|
||||
# sqlalchemy
|
||||
gunicorn @ git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64
|
||||
# via -r requirements.in
|
||||
idna==3.3
|
||||
# via
|
||||
# jsonschema
|
||||
# requests
|
||||
importlib-metadata==4.11.4
|
||||
# via flask
|
||||
iso8601==1.0.2
|
||||
# via -r requirements.in
|
||||
isoduration==20.11.0
|
||||
@@ -143,7 +141,7 @@ jsonschema[format]==4.5.1
|
||||
# via -r requirements.in
|
||||
kombu==5.2.4
|
||||
# via celery
|
||||
lxml==4.8.0
|
||||
lxml==4.9.1
|
||||
# via -r requirements.in
|
||||
mako==1.2.0
|
||||
# via alembic
|
||||
@@ -202,6 +200,8 @@ python-dateutil==2.8.2
|
||||
# arrow
|
||||
# awscli-cwlogs
|
||||
# botocore
|
||||
python-dotenv==0.20.0
|
||||
# via -r requirements.in
|
||||
python-json-logger==2.0.2
|
||||
# via notifications-utils
|
||||
pytz==2022.1
|
||||
@@ -252,8 +252,6 @@ sqlalchemy==1.4.36
|
||||
# marshmallow-sqlalchemy
|
||||
statsd==3.3.0
|
||||
# via notifications-utils
|
||||
typing-extensions==4.2.0
|
||||
# via pypdf2
|
||||
uri-template==1.2.0
|
||||
# via jsonschema
|
||||
urllib3==1.26.9
|
||||
@@ -277,8 +275,6 @@ werkzeug==2.0.3
|
||||
# flask
|
||||
wrapt==1.14.1
|
||||
# via deprecated
|
||||
zipp==3.8.0
|
||||
# via importlib-metadata
|
||||
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
# setuptools
|
||||
|
||||
11
sample.env
11
sample.env
@@ -1,3 +1,5 @@
|
||||
# ## REBUILD THE DEVCONTAINER WHEN YOU MODIFY .ENV ###
|
||||
|
||||
# Debug
|
||||
DEBUG=True
|
||||
ANTIVIRUS_ENABLED=0
|
||||
@@ -7,6 +9,7 @@ STATSD_HOST=localhost
|
||||
SES_STUB_URL=None
|
||||
NOTIFY_APP_NAME=api
|
||||
NOTIFY_EMAIL_DOMAIN=dispostable.com
|
||||
NOTIFY_LOG_PATH=/workspace/logs/app.log
|
||||
|
||||
# secrets that internal apps, such as the admin app or document download, must use to authenticate with the API
|
||||
ADMIN_CLIENT_ID=notify-admin
|
||||
@@ -35,7 +38,7 @@ SQLALCHEMY_DATABASE_TEST_URI=postgresql://postgres:chummy@db:5432/test_notificat
|
||||
|
||||
# AWS
|
||||
AWS_REGION=us-west-2
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_PINPOINT_REGION=
|
||||
AWS_US_TOLL_FREE_NUMBER=
|
||||
AWS_ACCESS_KEY_ID=DO_NOT_ADD_SECRETS_TO_THIS_SAMPLE_FILE
|
||||
AWS_SECRET_ACCESS_KEY=DO_NOT_ADD_SECRETS_TO_THIS_SAMPLE_FILE
|
||||
AWS_PINPOINT_REGION=us-west-2
|
||||
AWS_US_TOLL_FREE_NUMBER=+18001111111
|
||||
@@ -1,16 +1,12 @@
|
||||
SECRET_KEY: "dev-notify-secret-key" # pragma: allowlist secret
|
||||
DANGEROUS_SALT: "dev-notify-salt"
|
||||
AWS_ACCESS_KEY_ID: <replace me>
|
||||
AWS_SECRET_ACCESS_KEY: <replace me>
|
||||
|
||||
ADMIN_BASE_URL: https://notifications-admin.app.cloud.gov
|
||||
ADMIN_CLIENT_ID: notify-admin
|
||||
ADMIN_CLIENT_SECRET: dev-notify-secret-key
|
||||
API_HOST_NAME: https://notifications-api.app.cloud.gov
|
||||
AWS_ACCESS_KEY_ID: placeholder
|
||||
AWS_PINPOINT_REGION: us-west-2
|
||||
AWS_REGION: us-west-2
|
||||
AWS_SECRET_ACCESS_KEY: placeholder
|
||||
AWS_US_TOLL_FREE_NUMBER: 18446120782
|
||||
DANGEROUS_SALT: dev-notify-salt
|
||||
DVLA_EMAIL_ADDRESSES: []
|
||||
|
||||
Reference in New Issue
Block a user