supabase-postgres.git / summary / log / commit / refs
commit 2a8251d4e2acb12cbc0ec58633e299567f8f62f0
Author: Mats Kindahl <mats.kindahl@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Fri Jul 31 11:14:17 2026 +0000
fix(multigres): remove dangling wal-g include from postgresql.conf (#2338)
The Multigres Dockerfile deleted /etc/postgresql-custom/wal-g.conf but
left the include line in /etc/postgresql/postgresql.conf still pointing
at it. pgctld renders its own config and never loads this file today,
but it should stay valid if it is ever loaded directly. Also add a
docker-image-test check that wal-g is fully removed from multigres
images (no dangling include, no inherited wal-g scripts).
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Márton Boros <martonboros@gmail.com>
Dockerfile-multigres | 10 +++++-----
nix/packages/docker-image-test.nix | 16 ++++++++++++++++
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/Dockerfile-multigres b/Dockerfile-multigres
index 1bc0f01b..6162669f 100644
--- a/Dockerfile-multigres
+++ b/Dockerfile-multigres
@@ -101,11 +101,11 @@ COPY --chmod=0755 docker/pgctld/pgctld-layered.sh /usr/local/bin/pgctld
# config from postgresql.conf.tmpl and passes it directly to PostgreSQL, so the
# supabase base config (including wal-g and data_directory settings) is never loaded.
-# wal-g is not used in Multigres (pgbackrest handles backups); remove inherited files.
-RUN rm -f \
- /etc/postgresql-custom/wal-g.conf \
- /home/postgres/wal_fetch.sh \
- /root/wal_change_ownership.sh
+# wal-g is not used in Multigres (pgbackrest handles backups); remove inherited files
+# and delete the now-dangling include line so /etc/postgresql/postgresql.conf stays valid
+# if it is ever loaded directly instead of pgctld's generated config.
+RUN sed -i -e "/^include = '\/etc\/postgresql-custom\/wal-g.conf'/d" /etc/postgresql/postgresql.conf && \
+ rm -f /etc/postgresql-custom/wal-g.conf /home/postgres/wal_fetch.sh /root/wal_change_ownership.sh
# pgctld uses pooler-dir for pgBackRest config, unix sockets, and state files.
RUN mkdir -p /var/lib/pgctld && chown postgres:postgres /var/lib/pgctld
diff --git a/nix/packages/docker-image-test.nix b/nix/packages/docker-image-test.nix
index c899c2e0..324d6d6e 100644
--- a/nix/packages/docker-image-test.nix
+++ b/nix/packages/docker-image-test.nix
@@ -343,6 +343,22 @@ writeShellApplication {
fi
log_info " ✓ /usr/local/bin/pgctld is a wrapper script"
+ # 3.5. wal-g must be fully removed: no include line left dangling in the
+ # static /etc/postgresql/postgresql.conf. (Currently, pgctld doesn't load
+ # this file today, but if it's ever loaded directly it should not error out.
+ # See Dockerfile-multigres.) None of the inherited wal-g files should remain.
+ if docker exec "$container" sh -c "grep -q 'wal-g.conf' /etc/postgresql/postgresql.conf"; then
+ log_error " /etc/postgresql/postgresql.conf still references wal-g.conf"
+ exit 1
+ fi
+ for f in /etc/postgresql-custom/wal-g.conf /home/postgres/wal_fetch.sh /root/wal_change_ownership.sh; do
+ if docker exec "$container" test -e "$f"; then
+ log_error " $f should have been removed from the multigres image"
+ exit 1
+ fi
+ done
+ log_info " ✓ wal-g fully removed (no dangling include, no inherited files)"
+
# 4. pgctld init: initializes PGDATA and runs SQL init scripts (via wrapper's
# --pg-initdb-sql-dirs). Uses pooler-dir for socket dir and pgBackRest config.
local init_out init_rc=0
[parent: 09d60d33f948]