mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Order all keys in config (#8541)
New changes - return default values when sub-sys is not configured. - state is hidden parameter now - remove worm mode to be saved in config
This commit is contained in:
@@ -57,16 +57,32 @@ const (
|
||||
// Default KVS for loggerHTTP and loggerAuditHTTP
|
||||
var (
|
||||
DefaultKVS = config.KVS{
|
||||
config.State: config.StateOff,
|
||||
config.Comment: "This is a default HTTP logging configuration",
|
||||
Endpoint: "",
|
||||
AuthToken: "",
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOff,
|
||||
},
|
||||
config.KV{
|
||||
Key: Endpoint,
|
||||
Value: "",
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: "",
|
||||
},
|
||||
}
|
||||
DefaultAuditKVS = config.KVS{
|
||||
config.State: config.StateOff,
|
||||
config.Comment: "This is a default HTTP Audit logging configuration",
|
||||
Endpoint: "",
|
||||
AuthToken: "",
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOff,
|
||||
},
|
||||
config.KV{
|
||||
Key: Endpoint,
|
||||
Value: "",
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: "",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ import "github.com/minio/minio/cmd/config"
|
||||
// Help template for logger http and audit
|
||||
var (
|
||||
Help = config.HelpKVS{
|
||||
config.HelpKV{
|
||||
Key: config.State,
|
||||
Description: "Indicates if HTTP logger is enabled or not",
|
||||
Type: "on|off",
|
||||
},
|
||||
config.HelpKV{
|
||||
Key: Endpoint,
|
||||
Description: `HTTP logger endpoint eg: "http://localhost:8080/minio/logs/server"`,
|
||||
@@ -46,11 +41,6 @@ var (
|
||||
}
|
||||
|
||||
HelpAudit = config.HelpKVS{
|
||||
config.HelpKV{
|
||||
Key: config.State,
|
||||
Description: "Indicates if HTTP Audit logger is enabled or not",
|
||||
Type: "on|off",
|
||||
},
|
||||
config.HelpKV{
|
||||
Key: Endpoint,
|
||||
Description: `HTTP Audit logger endpoint eg: "http://localhost:8080/minio/logs/audit"`,
|
||||
|
||||
@@ -30,9 +30,18 @@ func SetLoggerHTTPAudit(scfg config.Config, k string, args HTTP) {
|
||||
return
|
||||
}
|
||||
scfg[config.AuditWebhookSubSys][k] = config.KVS{
|
||||
config.State: config.StateOn,
|
||||
Endpoint: args.Endpoint,
|
||||
AuthToken: args.AuthToken,
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOn,
|
||||
},
|
||||
config.KV{
|
||||
Key: Endpoint,
|
||||
Value: args.Endpoint,
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: args.AuthToken,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +53,17 @@ func SetLoggerHTTP(scfg config.Config, k string, args HTTP) {
|
||||
}
|
||||
|
||||
scfg[config.LoggerWebhookSubSys][k] = config.KVS{
|
||||
config.State: config.StateOn,
|
||||
Endpoint: args.Endpoint,
|
||||
AuthToken: args.AuthToken,
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOn,
|
||||
},
|
||||
config.KV{
|
||||
Key: Endpoint,
|
||||
Value: args.Endpoint,
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: args.AuthToken,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user