config: Migrate to the new version. Remove backend details.

Migrate to new config format v4.
```
{
	"version": "4",
	"credential": {
		"accessKey": "WLGDGYAQYIGI833EV05A",
		"secretKey": "BYvgJM101sHngl2uzjXS/OBF/aMxAN06JrJ3qJlF"
	},
	"region": "us-east-1",
	"logger": {
		"console": {
			"enable": true,
			"level": "fatal"
		},
		"file": {
			"enable": false,
			"fileName": "",
			"level": "error"
		},
		"syslog": {
			"enable": false,
			"address": "",
			"level": "debug"
		}
	}
}
```

This patch also updates [minio cli spec](./minio.md)
This commit is contained in:
Harshavardhana
2016-04-01 19:19:44 -07:00
parent 6037fe66e9
commit 484ba91b08
10 changed files with 255 additions and 227 deletions

View File

@@ -73,10 +73,6 @@ func init() {
if !isContainerized() && os.Geteuid() == 0 {
console.Fatalln("Please run minio as a non-root user.")
}
// Initialize config.
err := initConfig()
fatalIf(err.Trace(), "Unable to initialize minio config.", nil)
}
func migrate() {
@@ -142,7 +138,6 @@ func findClosestCommands(command string) []string {
func registerApp() *cli.App {
// Register all commands.
registerCommand(initCmd)
registerCommand(serverCmd)
registerCommand(versionCmd)
registerCommand(updateCmd)
@@ -199,6 +194,10 @@ func main() {
// Migrate any old version of config / state files to newer format.
migrate()
// Initialize config.
err := initConfig()
fatalIf(err.Trace(), "Unable to initialize minio config.", nil)
// Enable all loggers by now.
enableLoggers()