Skip to content

Commit 921e4b4

Browse files
committed
fix: gate pg_hba includes on PG_VERSION in Dockerfile-supabase
Dockerfile-supabase (added after this PR was opened) is now the base image for the PG15/17 build matrix, and didn't have the per-version pg_hba split applied. include_if_exists requires PG16+, so PG15 keeps the monolithic pg_hba.conf_15.j2 and drops the include fragments.
1 parent 1c86658 commit 921e4b4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Dockerfile-supabase

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ RUN chown -R postgres:postgres /usr/lib/postgresql && \
145145
# Setup configs
146146
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql.conf.j2 /etc/postgresql/postgresql.conf
147147
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf.j2 /etc/postgresql/pg_hba.conf
148+
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba.conf_15.j2 /etc/postgresql/pg_hba.conf_15.j2
149+
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba_public.conf.j2 /etc/postgresql/pg_hba_public.conf
150+
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_hba_users_public.conf.j2 /etc/postgresql/pg_hba_users_public.conf
151+
# pg_hba.conf include_if_exists requires PG16+; PG15 uses the monolithic file and drops the fragments.
152+
RUN if [ "$PG_VERSION" = "15" ]; then \
153+
mv /etc/postgresql/pg_hba.conf_15.j2 /etc/postgresql/pg_hba.conf; \
154+
rm -f /etc/postgresql/pg_hba_public.conf /etc/postgresql/pg_hba_users_public.conf; \
155+
else \
156+
rm -f /etc/postgresql/pg_hba.conf_15.j2; \
157+
fi
148158
COPY --chown=postgres:postgres ansible/files/postgresql_config/pg_ident.conf.j2 /etc/postgresql/pg_ident.conf
149159
COPY --chown=postgres:postgres ansible/files/postgresql_config/conf.d /etc/postgresql/postgresql.conf.d
150160
COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout-log.conf /etc/postgresql/logging.conf

0 commit comments

Comments
 (0)