Skip to content

Commit d60068f

Browse files
committed
Merge branch 'feature/fix-sink-postgres-ipv6-hba' into 'main'
fix(sink-postgres): permit IPv6 ULA range in pg_hba.conf Closes #200 See merge request postgres-ai/postgresai!268
2 parents 757523a + 3aef773 commit d60068f

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

config/sink-postgres/00-configure-pg-hba.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
cat > ${PGDATA}/pg_hba.conf <<EOF
1616
# PostgreSQL Client Authentication Configuration File
1717
# Custom configuration for sink-postgres container
18-
#
18+
#
1919
# SECURITY CONTEXT:
2020
# This configuration uses trust authentication for connections within Docker networks.
2121
# This is safe because:
@@ -53,11 +53,27 @@ host replication all ::1/128 trust
5353
# 172.16.0.0/12 - Default Docker bridge networks
5454
# 192.168.0.0/16 - User-defined bridge networks
5555
# 10.0.0.0/8 - Additional private network range
56+
# fc00::/7 - IPv6 Unique Local Address range (RFC 4193); the
57+
# IPv6 equivalent of the above three RFC 1918 ranges.
58+
# Docker assigns IPv6 prefixes inside fc00::/7 when
59+
# IPv6 is enabled on a Compose network — which mon
60+
# local-install does by default so containers can
61+
# reach IPv6-only external databases (Supabase
62+
# free-tier db.<ref>.supabase.co, etc.). Without
63+
# this entry, dual-stack hostname resolution serves
64+
# the AAAA result first per RFC 6724 and Python
65+
# clients (flask-pgss-api, postgres-reports) fail
66+
# the connection on pg_hba.conf without falling
67+
# back to IPv4. Go's pgx driver recovers via
68+
# happy-eyeballs but logs ~18 startup-race errors.
5669
host all all 172.16.0.0/12 trust
5770
host all all 192.168.0.0/16 trust
5871
host all all 10.0.0.0/8 trust
72+
host all all fc00::/7 trust
73+
74+
# Replication over the IPv6 ULA range (mirrors the IPv4 docker ranges above)
75+
host replication all fc00::/7 trust
5976
EOF
6077

6178
# Reload PostgreSQL configuration
6279
pg_ctl reload -D ${PGDATA}
63-

0 commit comments

Comments
 (0)