From 06d1e55c4ee78e2e1c4a459e8bfcef1c08aad3fe Mon Sep 17 00:00:00 2001
From: le 0 <hewiloo@web.de>
Date: Fri, 13 Oct 2023 19:48:50 +0200
Subject: [PATCH] Fix postgres database environment variable (#141)

---
 .env.example                               | 4 ++--
 docker-compose.dev.yml                     | 4 ++--
 docker-compose.testing.yml                 | 2 +-
 examples/docker-compose/.env.example       | 2 +-
 examples/docker-compose/docker-compose.yml | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/.env.example b/.env.example
index c639800550..7c2d1b3758 100644
--- a/.env.example
+++ b/.env.example
@@ -30,14 +30,14 @@ BH_NEO4J_WEB_PORT=7575
 # BloodHound Postgres
 BH_POSTGRES_USER=bloodhound
 BH_POSTGRES_PASSWORD=bloodhoundcommunityedition
-BH_POSTGRES_DATABASE=bloodhound
+BH_POSTGRES_DB=bloodhound
 BH_POSTGRES_VOLUME=bh-postgres-data
 BH_POSTGRES_PORT=6543
 
 # Integration Postgres
 INTEGRATION_POSTGRES_USER=bloodhound
 INTEGRATION_POSTGRES_PASSWORD=bloodhoundcommunityedition
-INTEGRATION_POSTGRES_DATABASE=bloodhound
+INTEGRATION_POSTGRES_DB=bloodhound
 INTEGRATION_POSTGRES_PORT=65432
 
 # Integration Neo4j
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 91a96ccc57..3e51a5df1d 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -36,7 +36,7 @@ services:
     environment:
       - POSTGRES_USER=${BH_POSTGRES_USER:-bloodhound}
       - POSTGRES_PASSWORD=${BH_POSTGRES_PASSWORD:-bloodhoundcommunityedition}
-      - POSTGRES_DATABASE=${BH_POSTGRES_DATABASE:-bloodhound}
+      - POSTGRES_DB=${BH_POSTGRES_DB:-bloodhound}
     ports:
       - ${BH_POSTGRES_PORT:-5432}:5432
     volumes:
@@ -45,7 +45,7 @@ services:
       test:
         [
           "CMD-SHELL",
-          "pg_isready -U ${BH_POSTGRES_USER:-bloodhound} -d 'dbname=${BH_POSTGRES_DATABASE:-bloodhound}' -h 127.0.0.1 -p 5432"
+          "pg_isready -U ${BH_POSTGRES_USER:-bloodhound} -d 'dbname=${BH_POSTGRES_DB:-bloodhound}' -h 127.0.0.1 -p 5432"
         ]
       interval: 10s
       timeout: 5s
diff --git a/docker-compose.testing.yml b/docker-compose.testing.yml
index 4144ddf7f3..a11ab0838a 100644
--- a/docker-compose.testing.yml
+++ b/docker-compose.testing.yml
@@ -22,7 +22,7 @@ services:
     environment:
       - POSTGRES_USER=bloodhound
       - POSTGRES_PASSWORD=bloodhoundcommunityedition
-      - POSTGRES_DATABASE=bloodhound
+      - POSTGRES_DB=bloodhound
     ports:
       - 65432:5432
     volumes:
diff --git a/examples/docker-compose/.env.example b/examples/docker-compose/.env.example
index 248d5c3c77..3a3b2ee68b 100644
--- a/examples/docker-compose/.env.example
+++ b/examples/docker-compose/.env.example
@@ -4,7 +4,7 @@ BLOODHOUND_TAG=latest
 # Postgres auth configuration
 POSTGRES_USER=bloodhound
 POSTGRES_PASSWORD=bloodhoundcommunityedition
-POSTGRES_DATABASE=bloodhound
+POSTGRES_DB=bloodhound
 
 # Auth string for NEO4J credentials
 NEO4J_AUTH=neo4j/bloodhoundcommunityedition
diff --git a/examples/docker-compose/docker-compose.yml b/examples/docker-compose/docker-compose.yml
index de9ac0d764..de67200694 100644
--- a/examples/docker-compose/docker-compose.yml
+++ b/examples/docker-compose/docker-compose.yml
@@ -21,7 +21,7 @@ services:
     environment:
       - POSTGRES_USER=${POSTGRES_USER:-bloodhound}
       - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-bloodhoundcommunityedition}
-      - POSTGRES_DATABASE=${POSTGRES_DATABASE:-bloodhound}
+      - POSTGRES_DB=${POSTGRES_DB:-bloodhound}
     # Database ports are disabled by default. Please change your database password to something secure before uncommenting
     # ports:
     #   - ${POSTGRES_PORT:-5432}:5432
@@ -31,7 +31,7 @@ services:
       test:
         [
           "CMD-SHELL",
-          "pg_isready -U ${POSTGRES_USER:-bloodhound} -d ${POSTGRES_DATABASE:-bloodhound} -h 127.0.0.1 -p 5432"
+          "pg_isready -U ${POSTGRES_USER:-bloodhound} -d ${POSTGRES_DB:-bloodhound} -h 127.0.0.1 -p 5432"
         ]
       interval: 10s
       timeout: 5s