Skip to content

Allow account recovery without access to an admin account #1043

Open

Description

@jmattheis

It's possible that the only admin loses their password. Gotify should provide a way to recover the admin account, or create a new admin account.

Options

  • CLI commands for changing the password, creating a new user, changing admin status on user
  • Consume a username:passwordhash file, and then update the username:passwordhash pairs

I think we can ignore the possibility of losing the last admin due to OIDC login demoting a user. If permissions are handled by the IdP, then the admin should be able to configure the IdP to give a user admin permissions on next login.

Activity

  1. added
    a:feature
    on Sep 4, 2026
  2. Shrinet82 commented on Nov 19, 2026

    @Shrinet82

    Hi @jmattheis, I'd like to work on this. I'd start with the CLI option: subcommands to reset a user's password, create a user, and set or unset admin on a user, operating directly on the database. Does that sound like the right direction, or would you prefer the username:passwordhash file approach?

  3. jmattheis commented on Nov 21, 2026

    @jmattheis
    MemberAuthor

    CLI options sound good. I'd propose this:

    gotify user create [--admin] <name> [password]
    # prompts for password if [password] isn't set
    
    gotify user set-password <name> [password]
    # prompts for password if [password] isn't set
    
    gotify user set-admin <name> true|false
    
  4. Shrinet82 commented on Nov 22, 2026

    @Shrinet82

    Thanks @jmattheis, that design works for me. I'll implement gotify user create [--admin] <name> [password], gotify user set-password <name> [password] and gotify user set-admin <name> true|false, with an interactive password prompt when the password isn't given, operating on the configured database, plus tests and docs. Could you assign this to me? I'll open a PR within the next week.

  5. Shrinet82 commented on Nov 23, 2026

    @Shrinet82

    @jmattheis I've opened #1095 for this with the three gotify user commands as you proposed. Could you take a look when you have time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a:feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions