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:
Shavonn Brown
2019-11-08 11:11:03 +01:00
committed by Marcus Efraimsson
parent 7ebc4a1568
commit 3e5abe7c21
7 changed files with 110 additions and 67 deletions
+2
View File
@@ -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