Fix ocis admin creation for idm

The admin user was created as part of the demo user set. But we need the
admin to be created always.
This commit is contained in:
Ralf Haferkamp
2022-04-11 16:02:18 +02:00
parent a830555794
commit 2a09da2237
5 changed files with 30 additions and 25 deletions
+5 -2
View File
@@ -89,9 +89,13 @@ func bootstrap(logger log.Logger, cfg *config.Config, srvcfg server.Config) erro
}
serviceUsers := []svcUser{
{
Name: "admin",
Password: cfg.ServiceUserPasswords.OcisAdmin,
},
{
Name: "libregraph",
Password: cfg.ServiceUserPasswords.IdmAdmin,
Password: cfg.ServiceUserPasswords.Idm,
},
{
Name: "idp",
@@ -141,7 +145,6 @@ func bootstrap(logger log.Logger, cfg *config.Config, srvcfg server.Config) erro
}
bootstrapData := tmplWriter.String()
if cfg.CreateDemoUsers {
bootstrapData = bootstrapData + "\n" + idm.DemoUsersLDIF
}
+4 -3
View File
@@ -32,7 +32,8 @@ type Settings struct {
}
type ServiceUserPasswords struct {
IdmAdmin string `yaml:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the \"idm\" service users. Either cleartext or an argon2id hash"`
Reva string `yaml:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the \"reva\" service users. Either cleartext or an argon2id hash"`
Idp string `yaml:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the \"idp\" service users. Either cleartext or an argon2id hash"`
OcisAdmin string `yaml:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the ocis \"admin\" user. Either cleartext or an argon2id hash"`
Idm string `yaml:"idm_password" env:"IDM_SVC_PASSWORD" desc:"Password to set for the \"idm\" service user. Either cleartext or an argon2id hash"`
Reva string `yaml:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the \"reva\" service user. Either cleartext or an argon2id hash"`
Idp string `yaml:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the \"idp\" service user. Either cleartext or an argon2id hash"`
}
+4 -3
View File
@@ -23,9 +23,10 @@ func DefaultConfig() *config.Config {
},
CreateDemoUsers: false,
ServiceUserPasswords: config.ServiceUserPasswords{
IdmAdmin: "idm",
Idp: "idp",
Reva: "reva",
OcisAdmin: "admin",
Idm: "idm",
Idp: "idp",
Reva: "reva",
},
IDM: config.Settings{
LDAPSAddr: "127.0.0.1:9235",