|
|
@ -25,7 +25,6 @@ import ( |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
humanize "github.com/dustin/go-humanize" |
|
|
|
humanize "github.com/dustin/go-humanize" |
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
|
|
|
|
xnet "github.com/minio/minio/pkg/net" |
|
|
|
xnet "github.com/minio/minio/pkg/net" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -122,19 +121,19 @@ func printServerCommonMsg(apiEndpoints []string) { |
|
|
|
apiEndpointStr := strings.Join(apiEndpoints, " ") |
|
|
|
apiEndpointStr := strings.Join(apiEndpoints, " ") |
|
|
|
|
|
|
|
|
|
|
|
// Colorize the message and print.
|
|
|
|
// Colorize the message and print.
|
|
|
|
logger.StartupMessage(colorBlue("Endpoint: ") + colorBold(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 1), apiEndpointStr))) |
|
|
|
logStartupMessage(colorBlue("Endpoint: ") + colorBold(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 1), apiEndpointStr))) |
|
|
|
if isTerminal() && !globalCLIContext.Anonymous { |
|
|
|
if isTerminal() && !globalCLIContext.Anonymous { |
|
|
|
logger.StartupMessage(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKey))) |
|
|
|
logStartupMessage(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKey))) |
|
|
|
logger.StartupMessage(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretKey))) |
|
|
|
logStartupMessage(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretKey))) |
|
|
|
if region != "" { |
|
|
|
if region != "" { |
|
|
|
logger.StartupMessage(colorBlue("Region: ") + colorBold(fmt.Sprintf(getFormatStr(len(region), 3), region))) |
|
|
|
logStartupMessage(colorBlue("Region: ") + colorBold(fmt.Sprintf(getFormatStr(len(region), 3), region))) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
printEventNotifiers() |
|
|
|
printEventNotifiers() |
|
|
|
|
|
|
|
|
|
|
|
if globalIsBrowserEnabled { |
|
|
|
if globalIsBrowserEnabled { |
|
|
|
logger.StartupMessage(colorBlue("\nBrowser Access:")) |
|
|
|
logStartupMessage(colorBlue("\nBrowser Access:")) |
|
|
|
logger.StartupMessage(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 3), apiEndpointStr)) |
|
|
|
logStartupMessage(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 3), apiEndpointStr)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -150,7 +149,7 @@ func printEventNotifiers() { |
|
|
|
arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(arn), 1), arn)) |
|
|
|
arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(arn), 1), arn)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger.StartupMessage(arnMsg) |
|
|
|
logStartupMessage(arnMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prints startup message for command line access. Prints link to our documentation
|
|
|
|
// Prints startup message for command line access. Prints link to our documentation
|
|
|
@ -161,25 +160,25 @@ func printCLIAccessMsg(endPoint string, alias string) { |
|
|
|
|
|
|
|
|
|
|
|
// Configure 'mc', following block prints platform specific information for minio client.
|
|
|
|
// Configure 'mc', following block prints platform specific information for minio client.
|
|
|
|
if isTerminal() { |
|
|
|
if isTerminal() { |
|
|
|
logger.StartupMessage(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide) |
|
|
|
logStartupMessage(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide) |
|
|
|
if runtime.GOOS == globalWindowsOSName { |
|
|
|
if runtime.GOOS == globalWindowsOSName { |
|
|
|
mcMessage := fmt.Sprintf("$ mc.exe config host add %s %s %s %s", alias, endPoint, cred.AccessKey, cred.SecretKey) |
|
|
|
mcMessage := fmt.Sprintf("$ mc.exe config host add %s %s %s %s", alias, endPoint, cred.AccessKey, cred.SecretKey) |
|
|
|
logger.StartupMessage(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)) |
|
|
|
logStartupMessage(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mcMessage := fmt.Sprintf("$ mc config host add %s %s %s %s", alias, endPoint, cred.AccessKey, cred.SecretKey) |
|
|
|
mcMessage := fmt.Sprintf("$ mc config host add %s %s %s %s", alias, endPoint, cred.AccessKey, cred.SecretKey) |
|
|
|
logger.StartupMessage(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)) |
|
|
|
logStartupMessage(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prints startup message for Object API acces, prints link to our SDK documentation.
|
|
|
|
// Prints startup message for Object API acces, prints link to our SDK documentation.
|
|
|
|
func printObjectAPIMsg() { |
|
|
|
func printObjectAPIMsg() { |
|
|
|
logger.StartupMessage(colorBlue("\nObject API (Amazon S3 compatible):")) |
|
|
|
logStartupMessage(colorBlue("\nObject API (Amazon S3 compatible):")) |
|
|
|
logger.StartupMessage(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide)) |
|
|
|
logStartupMessage(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide)) |
|
|
|
logger.StartupMessage(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide)) |
|
|
|
logStartupMessage(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide)) |
|
|
|
logger.StartupMessage(colorBlue(" Python: ") + fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide)) |
|
|
|
logStartupMessage(colorBlue(" Python: ") + fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide)) |
|
|
|
logger.StartupMessage(colorBlue(" JavaScript: ") + jsQuickStartGuide) |
|
|
|
logStartupMessage(colorBlue(" JavaScript: ") + jsQuickStartGuide) |
|
|
|
logger.StartupMessage(colorBlue(" .NET: ") + fmt.Sprintf(getFormatStr(len(dotnetQuickStartGuide), 6), dotnetQuickStartGuide)) |
|
|
|
logStartupMessage(colorBlue(" .NET: ") + fmt.Sprintf(getFormatStr(len(dotnetQuickStartGuide), 6), dotnetQuickStartGuide)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get formatted disk/storage info message.
|
|
|
|
// Get formatted disk/storage info message.
|
|
|
@ -195,7 +194,7 @@ func getStorageInfoMsg(storageInfo StorageInfo) string { |
|
|
|
// Prints startup message of storage capacity and erasure information.
|
|
|
|
// Prints startup message of storage capacity and erasure information.
|
|
|
|
func printStorageInfo(storageInfo StorageInfo) { |
|
|
|
func printStorageInfo(storageInfo StorageInfo) { |
|
|
|
if msg := getStorageInfoMsg(storageInfo); msg != "" { |
|
|
|
if msg := getStorageInfoMsg(storageInfo); msg != "" { |
|
|
|
logger.StartupMessage(msg) |
|
|
|
logStartupMessage(msg) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -203,7 +202,7 @@ func printCacheStorageInfo(storageInfo CacheStorageInfo) { |
|
|
|
msg := fmt.Sprintf("%s %s Free, %s Total", colorBlue("Cache Capacity:"), |
|
|
|
msg := fmt.Sprintf("%s %s Free, %s Total", colorBlue("Cache Capacity:"), |
|
|
|
humanize.IBytes(uint64(storageInfo.Free)), |
|
|
|
humanize.IBytes(uint64(storageInfo.Free)), |
|
|
|
humanize.IBytes(uint64(storageInfo.Total))) |
|
|
|
humanize.IBytes(uint64(storageInfo.Total))) |
|
|
|
logger.StartupMessage(msg) |
|
|
|
logStartupMessage(msg) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Prints certificate expiry date warning
|
|
|
|
// Prints certificate expiry date warning
|
|
|
@ -226,5 +225,5 @@ func getCertificateChainMsg(certs []*x509.Certificate) string { |
|
|
|
|
|
|
|
|
|
|
|
// Prints the certificate expiry message.
|
|
|
|
// Prints the certificate expiry message.
|
|
|
|
func printCertificateMsg(certs []*x509.Certificate) { |
|
|
|
func printCertificateMsg(certs []*x509.Certificate) { |
|
|
|
logger.StartupMessage(getCertificateChainMsg(certs)) |
|
|
|
logStartupMessage(getCertificateChainMsg(certs)) |
|
|
|
} |
|
|
|
} |
|
|
|