Debugging
Rebuilding database
chmod +x ./scripts/yada yada
Secrets
API secrets
dotnet user-secrets init dotnet user-secrets set "Redis:Configuration" "localhost:6379" dotnet user-secrets set "UtahId:Authority" "https://login.dts.utah.gov:443/sso/oauth2" dotnet user-secrets set "UtahId:ClientId" "" dotnet user-secrets set "UtahId:ClientSecret" "" dotnet user-secrets set "CloudSql:Host" "localhost" dotnet user-secrets set "CloudSql:Port" "5432" dotnet user-secrets set "CloudSql:Db" "app" dotnet user-secrets set "CloudSql:Username" "postgres" dotnet user-secrets set "CloudSql:Password" "what password" dotnet user-secrets set "App:AdminEmail" "you@email.com" dotnet user-secrets set "SendGrid:Key" "your send grid api key" dotnet user-secrets set "UPLOAD_BUCKET" "the gcp storage bucket where uploaded files are processed" dotnet user-secrets set "STORAGE_BUCKET" "the gcp bucket where scanned files are stored" dotnet user-secrets set "GroundWaterContacts:Connection" "the connection string for the ground water contacts database"
App secrets
- Duplicate
./src/api/uic-inventory/.envto./src/api/uic-inventory/.env.localand add an API key.
Database
Install the EF Core tools to run the migrations.
dotnet tool install --global dotnet-ef
Run migration script to setup and create schema.
May need to create an empty migration to get it to work the first time.
dotnet ef migrations add empty
One time per dotnet sdk install
dotnet dev-certs https --trust
Running the project
VSCode -> Debug -> .NET Core Launch (web)
Deployment
Warning
There are a lot of chicken and egg issues with this project deployment.
API deployment
- Request the Cloud Run service account is attached to the DTS shared VPC
- Request an authorized network for the Memorystore Redis
- Update those values in the terraform and apply the plan. It will fail.
- Update the
secret-appsettingswith the database password, redis URI, UtahID client information, and report function URI.
Malware scanner deployment
-
Run the
Scheduled EventsGitHub Action to create the clam AV data -
Run the
Workflow Dispatch EventsGitHub Action to create the clam AV Cloud Run -
Rerun the terraform