updgrade the micro/cli dependency

This commit is contained in:
David Christofas
2020-01-28 14:41:18 +01:00
parent 64dd8a8b17
commit 11816f75ab
29 changed files with 488 additions and 439 deletions
+33 -34
View File
@@ -1,7 +1,7 @@
package flagset
import (
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -12,35 +12,35 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVar: "REVA_TRACING_ENABLED",
EnvVars: []string{"REVA_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: "jaeger",
Usage: "Tracing backend type",
EnvVar: "REVA_TRACING_TYPE",
EnvVars: []string{"REVA_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: "",
Usage: "Endpoint for the agent",
EnvVar: "REVA_TRACING_ENDPOINT",
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: "",
Usage: "Endpoint for the collector",
EnvVar: "REVA_TRACING_COLLECTOR",
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: "reva",
Usage: "Service name for tracing",
EnvVar: "REVA_TRACING_SERVICE",
EnvVars: []string{"REVA_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
@@ -49,26 +49,26 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9147",
Usage: "Address to bind debug server",
EnvVar: "REVA_AUTH_BASIC_DEBUG_ADDR",
EnvVars: []string{"REVA_AUTH_BASIC_DEBUG_ADDR"},
Destination: &cfg.Reva.AuthBasic.DebugAddr,
},
&cli.StringFlag{
Name: "debug-token",
Value: "",
Usage: "Token to grant metrics access",
EnvVar: "REVA_DEBUG_TOKEN",
EnvVars: []string{"REVA_DEBUG_TOKEN"},
Destination: &cfg.Debug.Token,
},
&cli.BoolFlag{
Name: "debug-pprof",
Usage: "Enable pprof debugging",
EnvVar: "REVA_DEBUG_PPROF",
EnvVars: []string{"REVA_DEBUG_PPROF"},
Destination: &cfg.Debug.Pprof,
},
&cli.BoolFlag{
Name: "debug-zpages",
Usage: "Enable zpages debugging",
EnvVar: "REVA_DEBUG_ZPAGES",
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
Destination: &cfg.Debug.Zpages,
},
@@ -78,7 +78,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "jwt-secret",
Value: "Pive-Fumkiu4",
Usage: "Shared jwt secret for reva service communication",
EnvVar: "REVA_JWT_SECRET",
EnvVars: []string{"REVA_JWT_SECRET"},
Destination: &cfg.Reva.JWTSecret,
},
@@ -88,14 +88,14 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "users-driver",
Value: "demo",
Usage: "user driver: 'demo', 'json' or 'ldap'",
EnvVar: "REVA_USERS_DRIVER",
EnvVars: []string{"REVA_USERS_DRIVER"},
Destination: &cfg.Reva.Users.Driver,
},
&cli.StringFlag{
Name: "users-json",
Value: "",
Usage: "Path to users.json file",
EnvVar: "REVA_USERS_JSON",
EnvVars: []string{"REVA_USERS_JSON"},
Destination: &cfg.Reva.Users.JSON,
},
@@ -105,49 +105,49 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "ldap-hostname",
Value: "localhost",
Usage: "LDAP hostname",
EnvVar: "REVA_LDAP_HOSTNAME",
EnvVars: []string{"REVA_LDAP_HOSTNAME"},
Destination: &cfg.Reva.LDAP.Hostname,
},
&cli.IntFlag{
Name: "ldap-port",
Value: 636,
Usage: "LDAP port",
EnvVar: "REVA_LDAP_PORT",
EnvVars: []string{"REVA_LDAP_PORT"},
Destination: &cfg.Reva.LDAP.Port,
},
&cli.StringFlag{
Name: "ldap-base-dn",
Value: "dc=owncloud,dc=com",
Usage: "LDAP basedn",
EnvVar: "REVA_LDAP_BASE_DN",
EnvVars: []string{"REVA_LDAP_BASE_DN"},
Destination: &cfg.Reva.LDAP.BaseDN,
},
&cli.StringFlag{
Name: "ldap-userfilter",
Value: "(&(objectclass=posixAccount)(cn=%s))",
Usage: "LDAP userfilter",
EnvVar: "REVA_LDAP_USERFILTER",
EnvVars: []string{"REVA_LDAP_USERFILTER"},
Destination: &cfg.Reva.LDAP.UserFilter,
},
&cli.StringFlag{
Name: "ldap-groupfilter",
Value: "(&(objectclass=posixGroup)(cn=%s))",
Usage: "LDAP groupfilter",
EnvVar: "REVA_LDAP_GROUPFILTER",
EnvVars: []string{"REVA_LDAP_GROUPFILTER"},
Destination: &cfg.Reva.LDAP.GroupFilter,
},
&cli.StringFlag{
Name: "ldap-bind-dn",
Value: "cn=admin,dc=owncloud,dc=com",
Usage: "LDAP bind dn",
EnvVar: "REVA_LDAP_BIND_DN",
EnvVars: []string{"REVA_LDAP_BIND_DN"},
Destination: &cfg.Reva.LDAP.BindDN,
},
&cli.StringFlag{
Name: "ldap-bind-password",
Value: "admin",
Usage: "LDAP bind password",
EnvVar: "REVA_LDAP_BIND_PASSWORD",
EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"},
Destination: &cfg.Reva.LDAP.BindPassword,
},
// ldap dn is always the dn
@@ -155,28 +155,28 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "ldap-schema-uid",
Value: "uid",
Usage: "LDAP schema uid",
EnvVar: "REVA_LDAP_SCHEMA_UID",
EnvVars: []string{"REVA_LDAP_SCHEMA_UID"},
Destination: &cfg.Reva.LDAP.Schema.UID,
},
&cli.StringFlag{
Name: "ldap-schema-mail",
Value: "mail",
Usage: "LDAP schema mail",
EnvVar: "REVA_LDAP_SCHEMA_Mail",
EnvVars: []string{"REVA_LDAP_SCHEMA_Mail"},
Destination: &cfg.Reva.LDAP.Schema.Mail,
},
&cli.StringFlag{
Name: "ldap-schema-displayName",
Value: "displayName",
Usage: "LDAP schema displayName",
EnvVar: "REVA_LDAP_SCHEMA_DISPLAYNAME",
EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"},
Destination: &cfg.Reva.LDAP.Schema.DisplayName,
},
&cli.StringFlag{
Name: "ldap-schema-cn",
Value: "cn",
Usage: "LDAP schema cn",
EnvVar: "REVA_LDAP_SCHEMA_CN",
EnvVars: []string{"REVA_LDAP_SCHEMA_CN"},
Destination: &cfg.Reva.LDAP.Schema.CN,
},
@@ -188,36 +188,35 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_AUTH_BASIC_NETWORK",
EnvVars: []string{"REVA_AUTH_BASIC_NETWORK"},
Destination: &cfg.Reva.AuthBasic.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_AUTH_BASIC_PROTOCOL",
EnvVars: []string{"REVA_AUTH_BASIC_PROTOCOL"},
Destination: &cfg.Reva.AuthBasic.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9146",
Usage: "Address to bind reva service",
EnvVar: "REVA_AUTH_BASIC_ADDR",
EnvVars: []string{"REVA_AUTH_BASIC_ADDR"},
Destination: &cfg.Reva.AuthBasic.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9146",
Usage: "URL to use for the reva service",
EnvVar: "REVA_AUTH_BASIC_URL",
EnvVars: []string{"REVA_AUTH_BASIC_URL"},
Destination: &cfg.Reva.AuthBasic.URL,
},
&cli.StringFlag{
Name: "services",
Value: "authprovider",
Usage: "comma separated list of services to include",
EnvVar: "REVA_AUTH_BASIC_SERVICES",
Destination: &cfg.Reva.AuthBasic.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("authprovider"),
Usage: "--service authprovider [--service otherservice]",
EnvVars: []string{"REVA_AUTH_BASIC_SERVICES"},
},
}
}