mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Add logger command - also migrate from old config to newer config
This commit is contained in:
29
main.go
29
main.go
@@ -22,33 +22,11 @@ import (
|
||||
"os/user"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/minio/cli"
|
||||
)
|
||||
|
||||
// serverConfig - http server config
|
||||
type serverConfig struct {
|
||||
/// HTTP server options
|
||||
Address string // Address:Port listening
|
||||
AccessLog bool // Enable access log handler
|
||||
Anonymous bool // No signature turn off
|
||||
|
||||
/// FS options
|
||||
Path string // Path to export for cloud storage
|
||||
MinFreeDisk int64 // Minimum free disk space for filesystem
|
||||
Expiry time.Duration // Set auto expiry for filesystem
|
||||
|
||||
// TLS service
|
||||
TLS bool // TLS on when certs are specified
|
||||
CertFile string // Domain certificate
|
||||
KeyFile string // Domain key
|
||||
|
||||
/// Advanced HTTP server options
|
||||
RateLimit int // Ratelimited server of incoming connections
|
||||
}
|
||||
|
||||
func init() {
|
||||
// Check for the environment early on and gracefuly report.
|
||||
_, err := user.Current()
|
||||
@@ -64,6 +42,11 @@ func init() {
|
||||
checkGolangRuntimeVersion()
|
||||
}
|
||||
|
||||
func migrate() {
|
||||
// Migrate config file
|
||||
migrateConfig()
|
||||
}
|
||||
|
||||
// Tries to get os/arch/platform specific information
|
||||
// Returns a map of current os/arch/platform/memstats
|
||||
func getSystemData() map[string]string {
|
||||
@@ -101,6 +84,7 @@ func findClosestCommands(command string) []string {
|
||||
func registerApp() *cli.App {
|
||||
// register all commands
|
||||
registerCommand(serverCmd)
|
||||
registerCommand(configCmd)
|
||||
registerCommand(versionCmd)
|
||||
registerCommand(updateCmd)
|
||||
|
||||
@@ -166,6 +150,7 @@ func main() {
|
||||
app := registerApp()
|
||||
app.Before = func(c *cli.Context) error {
|
||||
globalJSONFlag = c.GlobalBool("json")
|
||||
migrate()
|
||||
return nil
|
||||
}
|
||||
app.ExtraInfo = func() map[string]string {
|
||||
|
||||
Reference in New Issue
Block a user