From 4901b44f4a5c55a272aedd9dea1de85b24e6a7eb Mon Sep 17 00:00:00 2001 From: Akira Date: Wed, 3 Sep 2025 04:04:34 +0900 Subject: [PATCH] Update pg_hba.conf --- custom-pg_hba.conf | 31 +++++++++++++++++++++++++++++++ docker-compose-prod.yaml | 1 + 2 files changed, 32 insertions(+) create mode 100644 custom-pg_hba.conf diff --git a/custom-pg_hba.conf b/custom-pg_hba.conf new file mode 100644 index 0000000..cc40507 --- /dev/null +++ b/custom-pg_hba.conf @@ -0,0 +1,31 @@ +# PostgreSQL Client Authentication Configuration File +# =================================================== +# +# TYPE DATABASE USER ADDRESS METHOD + +# Database administrative login by Unix domain socket +local all postgres peer + +# "local" is for Unix domain socket connections only +# md5認証に変更してpeer認証エラーを回避 +local all all md5 + +# IPv4 local connections: +host all all 127.0.0.1/32 md5 + +# IPv6 local connections: +host all all ::1/128 md5 + +# Allow replication connections from localhost, by a user with the +# replication privilege. +local replication all md5 +host replication all 127.0.0.1/32 md5 +host replication all ::1/128 md5 + +# Docker network connections +host all all 172.0.0.0/8 md5 +host all all 192.168.0.0/16 md5 +host all all 0.0.0.0/0 md5 + +# Replication connections +host replication replicator 0.0.0.0/0 md5 diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml index e54f67e..c2af0dc 100644 --- a/docker-compose-prod.yaml +++ b/docker-compose-prod.yaml @@ -6,6 +6,7 @@ services: volumes: - postgres_data:/var/lib/postgresql - ./custom-postgresql.conf:/etc/postgresql/12/main/postgresql.conf + - ./custom-pg_hba.conf:/etc/postgresql/12/main/pg_hba.conf - ./rogaining.sql:/sql/rogaining.sql - ./sqls:/sqls - ./create_location2025_table.sql:/sql/create_location2025_table.sql