fix: disinto init fails on re-run — admin password not persisted #158
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
bin/disinto initgenerates a random admin password on first run:This password is stored only in the local variable
_FORGE_ADMIN_PASSand is never written to.env. On re-run, init tries to authenticate asdisinto-adminwith a freshly generated random password, which fails:Root cause
In
bin/disinto, theforge_setup()function: the password is saved to_FORGE_ADMIN_PASSfor Woodpecker OAuth2 token generation, but never persisted to.env. When the admin user already exists on re-run, the script skips creation but still needs to authenticate — and has no way to recover the password.Expected behavior
Re-running
disinto initshould succeed idempotently. The admin password should either be:.env(asFORGE_ADMIN_PASS) on first creation, then re-read on subsequent runs, ORforgejo admin user change-passwordwhen the script detects it cannot authenticateSteps to reproduce
bin/disinto init https://codeberg.org/johba/harb --branch master --yes— succeeds partially, creates admin + bots, then fails at preflightbin/disinto init https://codeberg.org/johba/harb --branch master --yes— fails immediately withError: failed to obtain admin API tokenFiles
bin/disinto— theforge_setup()function, admin user creation block and the token creation block below itBlocked — issue #158
closed_externally2026-04-02T21:18:22Z