config cleanup
This commit is contained in:
+7
-65
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// SharingWithConfig applies cfg to the root flagset
|
||||
func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,6 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.Sharing.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -142,4 +78,10 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Sharing.PublicDriver,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user