From 32c32c56336f75c146f6d7cf5b6274a8375b6998 Mon Sep 17 00:00:00 2001 From: nhas Date: Fri, 8 Nov 2024 00:25:33 +1300 Subject: [PATCH] Fix bug in field setting --- .env.dev | 1 + config/config.go | 2 +- docker-compose.yaml | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.env.dev b/.env.dev index 70c0b63..74f3eb4 100644 --- a/.env.dev +++ b/.env.dev @@ -1,3 +1,4 @@ DOMAIN=localhost:8081 GOHUNT_USERNAME=test +DB_PASSWORD=averystrongpassword #GOHUNT_PASSWORD=yourstrongpasswordhere (optional) \ No newline at end of file diff --git a/config/config.go b/config/config.go index 7577747..71e7d94 100644 --- a/config/config.go +++ b/config/config.go @@ -114,7 +114,7 @@ func setField(v interface{}, fieldPath string, value string) { log.Printf("Field not found: %s", fieldPath) } } else { - r = r.FieldByName(part).Elem() + r = r.FieldByName(part) } } } diff --git a/docker-compose.yaml b/docker-compose.yaml index aa02242..d29234e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ services: image: postgres:13 environment: - POSTGRES_USER=gohunt - - POSTGRES_PASSWORD=gohunt + - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_DB=gohunt volumes: - db-data:/var/lib/postgresql/data @@ -24,7 +24,7 @@ services: - Database.User=gohunt - Database.DBname=gohunt - Database.SSLmode=disabled - - Database.Password=gohunt + - Database.Password=${DB_PASSWORD} caddy: image: caddy:2 @@ -36,7 +36,7 @@ services: volumes: - caddy-data:/data - caddy_config:/config - - ./Caddyfile.example:/etc/caddy/Caddyfile + - ./Caddyfile:/etc/caddy/Caddyfile volumes: db-data: