Skip to content

Commit

Permalink
chore: update username
Browse files Browse the repository at this point in the history
  • Loading branch information
thegentlemanphysicist committed Dec 19, 2023
1 parent 67ec60e commit 52575ec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ JWT_SECRET=verysecuresecret
JWT_TOKEN_EXPIRY=1h
PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGPASSWORD=postgres
PGUSER=<postgres_username>
PGPASSWORD=<postgres_password>
PGDATABASE=realm_registry
PGSSL=false
APP_ENV=development
Expand All @@ -39,7 +39,7 @@ TF_GH_REPO=
TF_MODULE_GH_REF=
GH_ACCESS_TOKEN=
GH_API_TOKEN=
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/realm_registry
DATABASE_URL=postgresql://<postgres_username>:<postgres_password>@localhost:5432/realm_registry
IDIR_REQUESTOR_USER_GUID=
MS_GRAPH_API_AUTHORITY=
MS_GRAPH_API_CLIENT_ID=
Expand Down
12 changes: 7 additions & 5 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ In the app folder run:

Run `make local-setup`

In the folder `app/db/` run:
Create the `.env` file from the `.env.example` file in the app folder.

The values can be found in the project's non-prod vault file. The local database creds are username "postgres", password is the local password for your database.

The CHES config can be changed. If you need to connect to the production CHES the config can be copied from the AWS dev environment variables for the sso-request lambda function.

Update the '<postgres_username>' value with a local postgres username in the `app/db/setup.sh` file. In the folder `app/db/` run:

```
pg_ctl start
./setup.sh
```

Create the `.env` file from the `.env.example` file in the app folder.

The values can be found in the project's non-prod vault file. The local database creds are username "postgres", password is the local password for your database.

Then run the development server:

```bash
Expand Down
6 changes: 4 additions & 2 deletions app/db/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ else
db="realm_registry"
fi

echo "SELECT 'CREATE DATABASE $db' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '$db')\gexec" | psql -U postgres -d postgres
postgres_username=<<postgres_username>>
psql -U postgres -d $db -f "../../helm/webapp/migration.sql" -qtA --set ON_ERROR_STOP=1
echo "SELECT 'CREATE DATABASE $db' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '$db')\gexec" | psql -U $postgres_username -d postgres
psql -U $postgres_username -d $db -f "../../helm/webapp/migration.sql" -qtA --set ON_ERROR_STOP=1

0 comments on commit 52575ec

Please sign in to comment.