From e47b6cdec5dc538c4c149e8bb8eb9e2d395394a1 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 28 Feb 2024 19:23:42 +0000 Subject: [PATCH 1/2] fix(env): wrap sample secret in quotes spaces in the value can cause bash to choke when doing e.g. source .env --- .env.sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index fb14ecd8ed..b4c167aee3 100644 --- a/.env.sample +++ b/.env.sample @@ -7,7 +7,6 @@ DJANGO_DB_DIR=. DJANGO_DB_FILE=django.db DJANGO_DB_FIXTURES="benefits/core/migrations/local_fixtures.json" -testsecret=Hello from the local environment! auth_provider_client_id=benefits-oauth-client-id courtesy_card_verifier_api_auth_key=server-auth-token mobility_pass_verifier_api_auth_key=server-auth-token @@ -22,3 +21,5 @@ sacrt_payment_processor_client_cert_root_ca='-----BEGIN CERTIFICATE-----\nPEM DA sbmtd_payment_processor_client_cert='-----BEGIN CERTIFICATE-----\nPEM DATA\n-----END CERTIFICATE-----' sbmtd_payment_processor_client_cert_private_key='-----BEGIN RSA PRIVATE KEY-----\nPEM DATA\n-----END RSA PRIVATE KEY-----' sbmtd_payment_processor_client_cert_root_ca='-----BEGIN CERTIFICATE-----\nPEM DATA\n-----END CERTIFICATE-----' + +testsecret="Hello from the local environment!" From 67bc3f4815ab7597a2a6a301d70cbb73031c4f82 Mon Sep 17 00:00:00 2001 From: Kegan Maher Date: Wed, 28 Feb 2024 19:24:48 +0000 Subject: [PATCH 2/2] fix(reset): correct syntax checking for valid fixtures * remove additional variable FIXTURES that isn't necessary * remove spacing in eval, causing evaluation to fail --- bin/reset_db.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/reset_db.sh b/bin/reset_db.sh index 26529338af..1b3ea0fd82 100755 --- a/bin/reset_db.sh +++ b/bin/reset_db.sh @@ -3,8 +3,6 @@ set -ex # whether to reset database file, defaults to true DB_RESET="${DJANGO_DB_RESET:-true}" -# optional fixtures to import -FIXTURES="${DJANGO_DB_FIXTURES}" if [[ $DB_RESET = true ]]; then # construct the path to the database file from environment or default @@ -25,11 +23,11 @@ else echo "DB_RESET is false, skipping" fi -valid_fixtures=$( echo $FIXTURES | grep -e fixtures\.json$ ) +valid_fixtures=$(echo "$DJANGO_DB_FIXTURES" | grep -e fixtures\.json$) if [[ -n "$valid_fixtures" ]]; then # load data fixtures - python manage.py loaddata "$FIXTURES" + python manage.py loaddata "$DJANGO_DB_FIXTURES" else echo "No JSON fixtures to load" fi