mirror of
https://github.com/minio/minio.git
synced 2025-01-13 07:53:21 -05:00
Merge pull request #1241 from harshavardhana/print
[GH-1240] main: Print keys after init and full server initialization.
This commit is contained in:
commit
27c75d8be4
@ -40,7 +40,7 @@ func isValidAccessKey(accessKeyID string) bool {
|
|||||||
|
|
||||||
// isValidSecretKey - validate secret key
|
// isValidSecretKey - validate secret key
|
||||||
func isValidSecretKey(secretKeyID string) bool {
|
func isValidSecretKey(secretKeyID string) bool {
|
||||||
regex := regexp.MustCompile("^[a-zA-Z0-9\\-\\.\\_\\~]{40}$")
|
regex := regexp.MustCompile("^.{40}$")
|
||||||
return regex.MatchString(secretKeyID)
|
return regex.MatchString(secretKeyID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,10 +237,6 @@ func initServer() (*configV2, *probe.Error) {
|
|||||||
if err := setLogger(conf); err != nil {
|
if err := setLogger(conf); err != nil {
|
||||||
return nil, err.Trace()
|
return nil, err.Trace()
|
||||||
}
|
}
|
||||||
if conf != nil {
|
|
||||||
console.Println()
|
|
||||||
console.Println(accessKeys{conf})
|
|
||||||
}
|
|
||||||
return conf, nil
|
return conf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,15 +338,15 @@ func serverMain(c *cli.Context) {
|
|||||||
address := c.GlobalString("address")
|
address := c.GlobalString("address")
|
||||||
checkPortAvailability(getPort(address))
|
checkPortAvailability(getPort(address))
|
||||||
|
|
||||||
conf, err := initServer()
|
|
||||||
fatalIf(err.Trace(), "Failed to read config for minio.", nil)
|
|
||||||
|
|
||||||
certFile := c.GlobalString("cert")
|
certFile := c.GlobalString("cert")
|
||||||
keyFile := c.GlobalString("key")
|
keyFile := c.GlobalString("key")
|
||||||
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
|
if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
|
||||||
fatalIf(probe.NewError(errInvalidArgument), "Both certificate and key are required to enable https.", nil)
|
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")
|
accessKey := os.Getenv("MINIO_ACCESS_KEY")
|
||||||
secretKey := os.Getenv("MINIO_SECRET_KEY")
|
secretKey := os.Getenv("MINIO_SECRET_KEY")
|
||||||
if accessKey != "" && secretKey != "" {
|
if accessKey != "" && secretKey != "" {
|
||||||
@ -398,6 +394,10 @@ func serverMain(c *cli.Context) {
|
|||||||
apiServer, err := configureServer(serverConfig)
|
apiServer, err := configureServer(serverConfig)
|
||||||
errorIf(err.Trace(), "Failed to configure API server.", nil)
|
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:")
|
console.Println("\nMinio Object Storage:")
|
||||||
printServerMsg(apiServer)
|
printServerMsg(apiServer)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user