mirror of
https://github.com/minio/minio.git
synced 2025-11-23 19:17:43 -05:00
yml-config: Add support of rootUser and rootPassword (#18615)
Users can define the root user and password in the yaml configuration file; Root credentials defined in the environment variable still take precedence
This commit is contained in:
@@ -248,6 +248,10 @@ func mergeServerCtxtFromConfigFile(configFile string, ctxt *serverCtxt) error {
|
||||
if cf.Version != "v1" {
|
||||
return fmt.Errorf("unexpected version: %s", cf.Version)
|
||||
}
|
||||
|
||||
ctxt.RootUser = cf.RootUser
|
||||
ctxt.RootPwd = cf.RootPwd
|
||||
|
||||
if cf.Addr != "" {
|
||||
ctxt.Addr = cf.Addr
|
||||
}
|
||||
@@ -353,11 +357,6 @@ func serverHandleCmdArgs(ctxt serverCtxt) {
|
||||
globalConnWriteDeadline = ctxt.ConnWriteDeadline
|
||||
}
|
||||
|
||||
func serverHandleEnvVars() {
|
||||
// Handle common environment variables.
|
||||
handleCommonEnvVars()
|
||||
}
|
||||
|
||||
var globalHealStateLK sync.RWMutex
|
||||
|
||||
func initAllSubsystems(ctx context.Context) {
|
||||
@@ -654,6 +653,10 @@ func serverMain(ctx *cli.Context) {
|
||||
// Handle all server environment vars.
|
||||
serverHandleEnvVars()
|
||||
|
||||
// Load the root credentials from the shell environment or from
|
||||
// the config file if not defined, set the default one.
|
||||
loadRootCredentials()
|
||||
|
||||
// Initialize globalConsoleSys system
|
||||
bootstrapTrace("newConsoleLogger", func() {
|
||||
globalConsoleSys = NewConsoleLogger(GlobalContext)
|
||||
|
||||
Reference in New Issue
Block a user