fix(supabase): db:trial database logs no statement from its first start

The image's init (migrate.sh) sent the supabase_admin password as SQL text
while its postgresql.conf logged DDL, so the password reached the container
log. The server now starts with -c log_statement=none, which the entrypoint
also hands to the init server; a harness check pins it, and DEPLOY.md makes
the post-init log scan a production prerequisite.
This commit is contained in:
bchanot committed 2026-11-11 19:53:56 +01:00
1 parent c6c984b954
commit 5f63d2229c
4 files changed
+15 -2

No files matched your search

+6 -1
View File
@@ -426,8 +426,13 @@ sb_psql() {
# rotate-secrets can renew every password through it. A failing ALTER would log its statement,
# password included, at the default log_min_error_statement: the session turns statement logging
# and verbose errors off first (psql sends the literal password, the server would log it).
# The image's own init (migrate.sh) sends the supabase_admin password as SQL text on its init temp
# server, and its postgresql.conf logs DDL: -c log_statement=none on the command line reaches that
# temp server (the entrypoint passes every argument after postgres to it) and the final server, so
# no statement is logged from the first start. The session set lines stay for the schema file itself
# (errors, pgaudit, pg_stat_statements).
# shellcheck disable=SC2016
DB_INIT='cat <<'"'"'EOF'"'"' > /etc/postgresql.schema.sql && exec docker-entrypoint.sh postgres -D /etc/postgresql -c shared_buffers=128MB
DB_INIT='cat <<'"'"'EOF'"'"' > /etc/postgresql.schema.sql && exec docker-entrypoint.sh postgres -D /etc/postgresql -c shared_buffers=128MB -c log_statement=none
\set VERBOSITY terse
set log_statement = '"'"'none'"'"';
set log_min_duration_statement = -1;