cpatpa hands the first admin a working login on day one

The installer now seeds a real admin account before anyone touches the app, replacing the old sign-up-and-get-promoted dance.

infrastructuresecurity

The PIP fork's installer wizard now asks the operator whether to auto-generate or supply a starter password for the bootstrap admin. The credentials land in the environment file and the secrets backup, and the final post-install report shows them - so the very first person to hit the login screen can actually sign in, instead of having to register through the public signup form and hope the system promotes them to admin.

There's a nice touch underneath: the seeded account is flagged as not-yet-onboarded, so the first sign-in still walks through the onboarding wizard. A quick follow-up commit cleans up a database bug that had been silently aborting the whole seeding step on fresh installs, leaving operators staring at an "invalid email or password" message with no clue why.

So what Anyone evaluating PIP for a self-hosted legal deployment gets a smoother day-one experience and fewer support tickets from confused operators.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from cpatpa/PIP, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
fcc68098 Installer + backend: seed the bootstrap admin password Claude 2026-05-16 ↗ GitHub
commit body
The installer now asks during the wizard whether to auto-generate
or type a password for the BOOTSTRAP_ADMIN_EMAIL account. The value
is written to .env.compose as BOOTSTRAP_ADMIN_PASSWORD (and into
the secrets-backup file), and surfaced in the post-install final
report so the operator can sign in immediately at /login without
going through the signup form first.

Backend ensureBootstrapAdmin() now creates the user with the
supplied password (hashed via bcrypt, cost 12) if the email doesn't
yet exist. Password must be >= 12 chars or the seeding step is
skipped. onboarded_at is left null so the first sign-in still goes
through the onboarding wizard.

The legacy "sign up via the form, get auto-promoted to admin"
behaviour remains intact when BOOTSTRAP_ADMIN_PASSWORD is empty.
35e409f6 Fix ensureBootstrapAdmin: cast $1 to uuid and target_id to text Claude 2026-05-16 ↗ GitHub
commit body
The audit_events insert in the bootstrap path was reusing $1 for
both user_id (uuid) and target_id (text), which Postgres rejected
with "inconsistent types deduced for parameter $1". The whole
transaction rolled back, so the bootstrap user never got created
on fresh installs and the operator hit "Invalid email or password"
on first sign-in with no other diagnostic.

Use two separate parameters with explicit casts. The metadata cast
to jsonb stays.

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-370.md from inside the repo you want the changes in.

⬇ Download capture-thread-370.md