Admin: Adds setting to disable creating initial admin user (#19505)
Adds a new setting disable_admin_user and when true the default admin user will not be created when Grafana starts for the first time (or no users exists in the system). Closes #19038
This commit is contained in:
committed by
Marcus Efraimsson
parent
7ebc4a1568
commit
3e5abe7c21
@@ -243,6 +243,7 @@ type Cfg struct {
|
||||
RendererLimitAlerting int
|
||||
|
||||
// Security
|
||||
DisableInitAdminCreation bool
|
||||
DisableBruteForceLoginProtection bool
|
||||
CookieSecure bool
|
||||
CookieSameSite http.SameSite
|
||||
@@ -763,6 +764,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
||||
}
|
||||
|
||||
// admin
|
||||
cfg.DisableInitAdminCreation = security.Key("disable_initial_admin_creation").MustBool(false)
|
||||
AdminUser, err = valueAsString(security, "admin_user", "")
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user