Skip to content

fix(cli): -ru ends the process and needs no gateway - #4

Merged
inkly merged 1 commit into
ReCasaOS:mainfrom
ppenguin:fix/reset-user-exits
Oct 23, 2026
Merged

inkly merged 1 commit into
ReCasaOS:mainfrom
ppenguin:fix/reset-user-exits

Conversation

@ppenguin

Copy link
Copy Markdown
Contributor

-ru (reset a user's password) ends the process and needs no gateway.

Problem Fix
casaos-user-service -ru -user <name> resets in init(), then main() starts a second service next to the running one exit 0 after the reset, 1 for a missing / unknown user
needs the gateway (management.url) → panics on a box whose services are down, where a reset is most needed uses the account store only
  • checked by hand: reset → prints the new password, exit 0; unknown user → exit 1; with no gateway running
  • first-admin switch: separate issue (as agreed in #11)

Context: ReCasaOS/CasaOS#11

🤖 Generated with Claude Code

- was: `casaos-user-service -ru -user <name>` reset the password in init(), then main() started a second service next to the running one
- was: needed the gateway (management.url) → panicked on a box whose services are down, where the reset is most needed
- now: `-ru` uses the account store only, exits 0 after the reset, 1 for a missing/unknown user

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@inkly inkly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this also stops -ru from re-registering the user routes at the gateway and overwriting the address file.

One follow-up, now that exit 0 is something callers can trust: UpdateUserPassword and UpdateUserTOTP swallow their errors and the DB has no busy timeout, so a write blocked by the running service still prints a new password and exits 0. Return the errors and exit 1? Nits: inline accounts, print errors to stderr.

We will squash-merge with a plain commit message (we keep tool attribution trailers out of main's history), so nothing to change there.

@inkly
inkly merged commit 8873ee8 into ReCasaOS:main Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants