diff --git a/api-auth-utils.go b/api-auth-utils.go index 642ba3dfb..54b37e4b2 100644 --- a/api-auth-utils.go +++ b/api-auth-utils.go @@ -40,7 +40,7 @@ func isValidAccessKey(accessKeyID string) bool { // isValidSecretKey - validate secret key func isValidSecretKey(secretKeyID string) bool { - regex := regexp.MustCompile("^[a-zA-Z0-9\\-\\.\\_\\~]{40}$") + regex := regexp.MustCompile("^.{40}$") return regex.MatchString(secretKeyID) } diff --git a/server-main.go b/server-main.go index 4a654d022..fffd9b407 100644 --- a/server-main.go +++ b/server-main.go @@ -237,10 +237,6 @@ func initServer() (*configV2, *probe.Error) { if err := setLogger(conf); err != nil { return nil, err.Trace() } - if conf != nil { - console.Println() - console.Println(accessKeys{conf}) - } return conf, nil } @@ -342,15 +338,15 @@ func serverMain(c *cli.Context) { address := c.GlobalString("address") checkPortAvailability(getPort(address)) - conf, err := initServer() - fatalIf(err.Trace(), "Failed to read config for minio.", nil) - certFile := c.GlobalString("cert") keyFile := c.GlobalString("key") if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") { fatalIf(probe.NewError(errInvalidArgument), "Both certificate and key are required to enable https.", nil) } + conf, err := initServer() + fatalIf(err.Trace(), "Failed to read config for minio.", nil) + accessKey := os.Getenv("MINIO_ACCESS_KEY") secretKey := os.Getenv("MINIO_SECRET_KEY") if accessKey != "" && secretKey != "" { @@ -398,6 +394,10 @@ func serverMain(c *cli.Context) { apiServer, err := configureServer(serverConfig) errorIf(err.Trace(), "Failed to configure API server.", nil) + console.Println() + // Print access keys and region. + console.Println(accessKeys{conf}) + console.Println("\nMinio Object Storage:") printServerMsg(apiServer)