install.sh: don't silently change POSTGRES_PASSWORD on a re-run

↗ view on GitHub · Claude · 2026-05-16 · 510c379c

The official postgres:alpine image only honours POSTGRES_PASSWORD
when it initialises an EMPTY data directory. If install.sh is
re-run (or the wizard re-runs and chooses "replace") while
${DATA_ROOT}/postgres already holds an initialised cluster,
regenerating POSTGRES_PASSWORD will deauth the backend against the
existing role -> migration crash loop with
"password authentication failed for user 'pip'".

Detect that case up front:
- If ${DATA_ROOT}/postgres is non-empty AND .env.compose already
  had a POSTGRES_PASSWORD value, default to reusing it.
- If the operator deliberately wants a new password, surface a
  warning with the ALTER USER one-liner needed to keep the existing
  data, or the wipe instructions to start fresh.
Repository cpatpa/PIP
Author Claude <noreply@anthropic.com>
Authored
Parents afa7e87a
Stats 1 file changed , +47 , -1
Part of Bare-metal installer + operator tooling

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-510c379c.md from inside the repo you want the change in.

⬇ Download capture-commit-510c379c.md