mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 20:50:22 +03:00
config: Add browser parameter (#3807)
browser new parameter receives "on" or "off" parameter which is similar to MINIO_BROWSER
This commit is contained in:
committed by
Harshavardhana
parent
c9619673fb
commit
9b3c014bab
+13
-3
@@ -159,14 +159,24 @@ func checkUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
// envParams holds all env parameters
|
||||
type envParams struct {
|
||||
creds credential
|
||||
browser string
|
||||
}
|
||||
|
||||
// Initializes a new config if it doesn't exist, else migrates any old config
|
||||
// to newer config and finally loads the config to memory.
|
||||
func initConfig() {
|
||||
envCreds := mustGetCredentialFromEnv()
|
||||
|
||||
envs := envParams{
|
||||
creds: mustGetCredentialFromEnv(),
|
||||
browser: mustGetBrowserFromEnv(),
|
||||
}
|
||||
|
||||
// Config file does not exist, we create it fresh and return upon success.
|
||||
if !isConfigFileExists() {
|
||||
if err := newConfig(envCreds); err != nil {
|
||||
if err := newConfig(envs); err != nil {
|
||||
console.Fatalf("Unable to initialize minio config for the first time. Err: %s.\n", err)
|
||||
}
|
||||
console.Println("Created minio configuration file successfully at " + mustGetConfigPath())
|
||||
@@ -177,7 +187,7 @@ func initConfig() {
|
||||
migrate()
|
||||
|
||||
// Once we have migrated all the old config, now load them.
|
||||
if err := loadConfig(envCreds); err != nil {
|
||||
if err := loadConfig(envs); err != nil {
|
||||
console.Fatalf("Unable to initialize minio config. Err: %s.\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user