server: handle command line and env variables at one place. (#3975)

This commit is contained in:
Bala FA
2017-03-30 23:51:19 +05:30
committed by Harshavardhana
parent 447fdd4097
commit 2df8160f6a
14 changed files with 169 additions and 298 deletions
+5 -2
View File
@@ -144,6 +144,9 @@ func gatewayMain(ctx *cli.Context) {
// Get quiet flag from command line argument.
quietFlag := ctx.Bool("quiet") || ctx.GlobalBool("quiet")
if quietFlag {
log.EnableQuiet()
}
// First argument is selected backend type.
backendType := ctx.Args().First()
@@ -176,8 +179,8 @@ func gatewayMain(ctx *cli.Context) {
apiServer := NewServerMux(ctx.String("address"), registerHandlers(router, handlerFns...))
// Set if we are SSL enabled S3 gateway.
globalIsSSL = isSSL()
_, _, globalIsSSL, err = getSSLConfig()
fatalIf(err, "Invalid SSL key file")
// Start server, automatically configures TLS if certs are available.
go func() {