Update db_fixer command to find and fix all pg_hba.conf files and append rules

This commit is contained in:
2026-08-11 12:55:01 +05:30
parent 7122d55e38
commit 9fa8ce4186
+2 -2
View File
@@ -6,7 +6,7 @@ services:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: sop_monitoring
FORCE_RESTART: 1
FORCE_RESTART: 2
ports:
- "5432:5432"
volumes:
@@ -19,7 +19,7 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
command: >
sh -c "sed -i 's/hostssl/host/g' /var/lib/postgresql/data/pg_hba.conf || true; sed -i 's/hostnossl/host/g' /var/lib/postgresql/data/pg_hba.conf || true; echo 'host all all all scram-sha-256' >> /var/lib/postgresql/data/pg_hba.conf; echo 'host all all all md5' >> /var/lib/postgresql/data/pg_hba.conf"
sh -c "find /var/lib/postgresql/data -name pg_hba.conf -exec sed -i 's/hostssl/host/g' {} + || true; find /var/lib/postgresql/data -name pg_hba.conf -exec sh -c 'echo \"host all all all md5\" >> \"$1\"; echo \"host all all all scram-sha-256\" >> \"$1\"' _ {} \;"
api: