admin

package
v1.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package admin implements the Controller's command-line administration: creating the first administrator on a fresh install and recovering an account whose owner is locked out. It talks to the database directly, so it works before anyone can sign in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUser

func CreateUser(ctx context.Context, d Deps, u NewUser) (domain.User, string, error)

CreateUser creates a user with a random one-time password, which it returns for the operator to hand over. The user must replace it at their first sign-in.

func ResetPassword

func ResetPassword(ctx context.Context, d Deps, username string) (string, error)

ResetPassword gives a user a new random one-time password, ends all their sessions and revokes all their API tokens. It returns the password.

Types

type Deps

type Deps struct {
	Store  *store.Store
	Hasher *auth.Hasher
}

Deps are what the commands need.

type NewUser

type NewUser struct {
	Username    string
	Email       string
	DisplayName string
	GlobalAdmin bool
}

NewUser describes the user to create.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL