Skip to content

Improve default admin user creation #1022

@jescalada

Description

@jescalada

Is your feature request related to a problem? Please describe.
Currently, a default admin user is created when running git-proxy for the first time:

/**
 * Create the default admin user if it doesn't exist
 */
export const createDefaultAdmin = async () => {
  const admin = await db.findUser('admin');
  if (!admin) {
    await db.createUser('admin', 'admin', '[email protected]', 'none', true);
  }
};

Describe the solution you'd like
One suggestion by @sam-holmes2 in #963, is to have a randomly generated password for the default admin user, and then force to change the password on the first login. Another possible solution is to show a signup form to create the admin user on the first UI load.

Another suggestion by @kriswest is to simply make this configurable in proxy.config.json. That would get rid of the security concern altogether, unless the GitProxy administrator didn't change the default admin credentials there.

Additional context
I modified some of the related code in #963, and made this issue as I thought it's beyond the scope of the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions