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
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// AuthBasic is the entrypoint for the auth-basic command.
func AuthBasic(cfg *config.Config) cli.Command {
return cli.Command{
func AuthBasic(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "auth-basic",
Usage: "Start reva authprovider for basic auth",
Flags: flagset.AuthBasicWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.AuthBasic.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// AuthBearer is the entrypoint for the auth-bearer command.
func AuthBearer(cfg *config.Config) cli.Command {
return cli.Command{
func AuthBearer(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "auth-bearer",
Usage: "Start reva authprovider for bearer auth",
Flags: flagset.AuthBearerWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.AuthBearer.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -10,7 +10,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -18,11 +18,16 @@ import (
)
// Frontend is the entrypoint for the frontend command.
func Frontend(cfg *config.Config) cli.Command {
return cli.Command{
func Frontend(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "frontend",
Usage: "Start reva frontend service",
Flags: flagset.FrontendWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Frontend.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// Gateway is the entrypoint for the gateway command.
func Gateway(cfg *config.Config) cli.Command {
return cli.Command{
func Gateway(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "gateway",
Usage: "Start reva gateway",
Flags: flagset.GatewayWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Gateway.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+3 -3
View File
@@ -4,14 +4,14 @@ import (
"fmt"
"net/http"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
)
// Health is the entrypoint for the health command.
func Health(cfg *config.Config) cli.Command {
return cli.Command{
func Health(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "health",
Usage: "Check health status",
Flags: flagset.HealthWithConfig(cfg),
+3 -3
View File
@@ -4,7 +4,7 @@ import (
"os"
"strings"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -22,7 +22,7 @@ func Execute() error {
Usage: "Example service for Reva/oCIS",
Compiled: version.Compiled(),
Authors: []cli.Author{
Authors: []*cli.Author{
{
Name: "ownCloud GmbH",
Email: "support@owncloud.com",
@@ -73,7 +73,7 @@ func Execute() error {
return nil
},
Commands: []cli.Command{
Commands: []*cli.Command{
Frontend(cfg),
Gateway(cfg),
Users(cfg),
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// Sharing is the entrypoint for the sharing command.
func Sharing(cfg *config.Config) cli.Command {
return cli.Command{
func Sharing(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "sharing",
Usage: "Start reva sharing service",
Flags: flagset.SharingWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Sharing.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// StorageHome is the entrypoint for the storage-home command.
func StorageHome(cfg *config.Config) cli.Command {
return cli.Command{
func StorageHome(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-home",
Usage: "Start reva storage-home service",
Flags: flagset.StorageHomeWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageHome.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// StorageHomeData is the entrypoint for the storage-home-data command.
func StorageHomeData(cfg *config.Config) cli.Command {
return cli.Command{
func StorageHomeData(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-home-data",
Usage: "Start reva storage-home-data service",
Flags: flagset.StorageHomeDataWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageHomeData.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// StorageOC is the entrypoint for the storage-oc command.
func StorageOC(cfg *config.Config) cli.Command {
return cli.Command{
func StorageOC(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-oc",
Usage: "Start reva storage-oc service",
Flags: flagset.StorageOCWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageOC.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// StorageOCData is the entrypoint for the storage-oc-data command.
func StorageOCData(cfg *config.Config) cli.Command {
return cli.Command{
func StorageOCData(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-oc-data",
Usage: "Start reva storage-oc-data service",
Flags: flagset.StorageOCDataWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageOCData.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// StorageRoot is the entrypoint for the storage-root command.
func StorageRoot(cfg *config.Config) cli.Command {
return cli.Command{
func StorageRoot(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "storage-root",
Usage: "Start reva storage-root service",
Flags: flagset.StorageRootWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.StorageRoot.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+8 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/cs3org/reva/cmd/revad/runtime"
"github.com/gofrs/uuid"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis-reva/pkg/config"
"github.com/owncloud/ocis-reva/pkg/flagset"
@@ -17,11 +17,16 @@ import (
)
// Users is the entrypoint for the sharing command.
func Users(cfg *config.Config) cli.Command {
return cli.Command{
func Users(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "users",
Usage: "Start reva users service",
Flags: flagset.UsersWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Reva.Users.Services = c.StringSlice("service")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
+1 -3
View File
@@ -35,9 +35,7 @@ type Port struct {
// DebugAddr for the debug endpoint to bind to
DebugAddr string
// Services can be used to give a list of services that should be started on this port
Services string
// used to store the parsed services
servicesList []string
Services []string
// Config can be used to configure the reva instance.
// Services and Protocol will be ignored if this is used
Config map[string]interface{}
+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"},
},
}
}
+23 -24
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 AuthBearerWithConfig(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 AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9149",
Usage: "Address to bind debug server",
EnvVar: "REVA_AUTH_BEARER_DEBUG_ADDR",
EnvVars: []string{"REVA_AUTH_BEARER_DEBUG_ADDR"},
Destination: &cfg.Reva.AuthBearer.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 AuthBearerWithConfig(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,20 +88,20 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
Name: "oidc-issuer",
Value: "http://localhost:9140",
Usage: "OIDC issuer",
EnvVar: "REVA_OIDC_ISSUER",
EnvVars: []string{"REVA_OIDC_ISSUER"},
Destination: &cfg.Reva.OIDC.Issuer,
},
&cli.BoolFlag{
Name: "oidc-insecure",
Usage: "OIDC allow insecure communication",
EnvVar: "REVA_OIDC_INSECURE",
EnvVars: []string{"REVA_OIDC_INSECURE"},
Destination: &cfg.Reva.OIDC.Insecure,
},
&cli.StringFlag{
Name: "oidc-id-claim",
Value: "sub", // sub is stable and defined as unique. the user manager needs to take care of the sub to user metadata lookup
Usage: "OIDC id claim",
EnvVar: "REVA_OIDC_ID_CLAIM",
EnvVars: []string{"REVA_OIDC_ID_CLAIM"},
Destination: &cfg.Reva.OIDC.IDClaim,
},
@@ -113,36 +113,35 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_AUTH_BEARER_NETWORK",
EnvVars: []string{"REVA_AUTH_BEARER_NETWORK"},
Destination: &cfg.Reva.AuthBearer.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_AUTH_BEARER_PROTOCOL",
EnvVars: []string{"REVA_AUTH_BEARER_PROTOCOL"},
Destination: &cfg.Reva.AuthBearer.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9148",
Usage: "Address to bind reva service",
EnvVar: "REVA_AUTH_BEARER_ADDR",
EnvVars: []string{"REVA_AUTH_BEARER_ADDR"},
Destination: &cfg.Reva.AuthBearer.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9148",
Usage: "URL to use for the reva service",
EnvVar: "REVA_AUTH_BEARER_URL",
EnvVars: []string{"REVA_AUTH_BEARER_URL"},
Destination: &cfg.Reva.AuthBearer.URL,
},
&cli.StringFlag{
Name: "services",
Value: "authprovider", // TODO preferences
Usage: "comma separated list of services to include",
EnvVar: "REVA_AUTH_BEARER_SERVICES",
Destination: &cfg.Reva.AuthBearer.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("authprovider"), // TODO preferences
Usage: "--service authprovider [--service otherservice]",
EnvVars: []string{"REVA_AUTH_BEARER_SERVICES"},
},
}
}
+25 -26
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 FrontendWithConfig(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 FrontendWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9141",
Usage: "Address to bind debug server",
EnvVar: "REVA_FRONTEND_DEBUG_ADDR",
EnvVars: []string{"REVA_FRONTEND_DEBUG_ADDR"},
Destination: &cfg.Reva.Frontend.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,14 +78,14 @@ func FrontendWithConfig(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,
},
&cli.StringFlag{
Name: "transfer-secret",
Value: "replace-me-with-a-transfer-secret",
Usage: "Transfer secret for datagateway",
EnvVar: "REVA_TRANSFER_SECRET",
EnvVars: []string{"REVA_TRANSFER_SECRET"},
Destination: &cfg.Reva.TransferSecret,
},
@@ -95,20 +95,20 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Name: "oidc-issuer",
Value: "http://localhost:9140",
Usage: "OIDC issuer",
EnvVar: "REVA_OIDC_ISSUER",
EnvVars: []string{"REVA_OIDC_ISSUER"},
Destination: &cfg.Reva.OIDC.Issuer,
},
&cli.BoolFlag{
Name: "oidc-insecure",
Usage: "OIDC allow insecure communication",
EnvVar: "REVA_OIDC_INSECURE",
EnvVars: []string{"REVA_OIDC_INSECURE"},
Destination: &cfg.Reva.OIDC.Insecure,
},
&cli.StringFlag{
Name: "oidc-id-claim",
Value: "sub", // sub is stable and defined as unique. the user manager needs to take care of the sub to user metadata lookup
Usage: "OIDC id claim",
EnvVar: "REVA_OIDC_ID_CLAIM",
EnvVars: []string{"REVA_OIDC_ID_CLAIM"},
Destination: &cfg.Reva.OIDC.IDClaim,
},
@@ -122,36 +122,35 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_FRONTEND_NETWORK",
EnvVars: []string{"REVA_FRONTEND_NETWORK"},
Destination: &cfg.Reva.Frontend.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "http",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_FRONTEND_PROTOCOL",
EnvVars: []string{"REVA_FRONTEND_PROTOCOL"},
Destination: &cfg.Reva.Frontend.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9140",
Usage: "Address to bind reva service",
EnvVar: "REVA_FRONTEND_ADDR",
EnvVars: []string{"REVA_FRONTEND_ADDR"},
Destination: &cfg.Reva.Frontend.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9140",
Usage: "URL to use for the reva service",
EnvVar: "REVA_FRONTEND_URL",
EnvVars: []string{"REVA_FRONTEND_URL"},
Destination: &cfg.Reva.Frontend.URL,
},
&cli.StringFlag{
Name: "services",
Value: "datagateway,wellknown,oidcprovider,ocdav,ocs",
Usage: "comma separated list of services to include",
EnvVar: "REVA_FRONTEND_SERVICES",
Destination: &cfg.Reva.Frontend.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("datagateway", "wellknown", "oidcprovider", "ocdav", "ocs"),
Usage: "--service datagateway [--service wellknown]",
EnvVars: []string{"REVA_FRONTEND_SERVICES"},
},
// Gateway
@@ -160,7 +159,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Name: "gateway-url",
Value: "localhost:9142",
Usage: "URL to use for the reva gateway service",
EnvVar: "REVA_GATEWAY_URL",
EnvVars: []string{"REVA_GATEWAY_URL"},
Destination: &cfg.Reva.Gateway.URL,
},
}
+39 -40
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 GatewayWithConfig(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 GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9143",
Usage: "Address to bind debug server",
EnvVar: "REVA_GATEWAY_DEBUG_ADDR",
EnvVars: []string{"REVA_GATEWAY_DEBUG_ADDR"},
Destination: &cfg.Reva.Gateway.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,21 +78,21 @@ func GatewayWithConfig(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,
},
&cli.StringFlag{
Name: "transfer-secret",
Value: "replace-me-with-a-transfer-secret",
Usage: "Transfer secret for datagateway",
EnvVar: "REVA_TRANSFER_SECRET",
EnvVars: []string{"REVA_TRANSFER_SECRET"},
Destination: &cfg.Reva.TransferSecret,
},
&cli.IntFlag{
Name: "transfer-expires",
Value: 10,
Usage: "Transfer secret for datagateway",
EnvVar: "REVA_TRANSFER_EXPIRES",
EnvVars: []string{"REVA_TRANSFER_EXPIRES"},
Destination: &cfg.Reva.TransferExpires,
},
@@ -106,42 +106,41 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_GATEWAY_NETWORK",
EnvVars: []string{"REVA_GATEWAY_NETWORK"},
Destination: &cfg.Reva.Gateway.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_GATEWAY_PROTOCOL",
EnvVars: []string{"REVA_GATEWAY_PROTOCOL"},
Destination: &cfg.Reva.Gateway.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9142",
Usage: "Address to bind reva service",
EnvVar: "REVA_GATEWAY_ADDR",
EnvVars: []string{"REVA_GATEWAY_ADDR"},
Destination: &cfg.Reva.Gateway.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9142",
Usage: "URL to use for the reva service",
EnvVar: "REVA_GATEWAY_URL",
EnvVars: []string{"REVA_GATEWAY_URL"},
Destination: &cfg.Reva.Gateway.URL,
},
&cli.StringFlag{
Name: "services",
Value: "gateway,authregistry,storageregistry", // TODO appregistry
Usage: "comma separated list of services to include",
EnvVar: "REVA_GATEWAY_SERVICES",
Destination: &cfg.Reva.Gateway.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("gateway", "authregistry", "storageregistry"), // TODO appregistry
Usage: "--service gateway [--service authregistry]",
EnvVars: []string{"REVA_GATEWAY_SERVICES"},
},
// TODO should defaults to true. reverse logic to 'disable-share-commit'?
&cli.BoolFlag{
Name: "commit-share-to-storage-grant",
Usage: "Commit shares to the share manager as well as as a grant to the storage",
EnvVar: "REVA_GATEWAY_COMMIT_SHARE_TO_STRORAGE_GRANT",
EnvVars: []string{"REVA_GATEWAY_COMMIT_SHARE_TO_STRORAGE_GRANT"},
Destination: &cfg.Reva.Gateway.CommitShareToStorageGrant,
},
@@ -153,35 +152,35 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "frontend-url",
Value: "localhost:9140",
Usage: "URL to use for the reva service",
EnvVar: "REVA_FRONTEND_URL",
EnvVars: []string{"REVA_FRONTEND_URL"},
Destination: &cfg.Reva.Frontend.URL,
},
&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Usage: "URL to use for the reva service",
EnvVar: "REVA_USERS_URL",
EnvVars: []string{"REVA_USERS_URL"},
Destination: &cfg.Reva.Users.URL,
},
&cli.StringFlag{
Name: "auth-basic-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: "auth-bearer-url",
Value: "localhost:9148",
Usage: "URL to use for the reva service",
EnvVar: "REVA_AUTH_BEARER_URL",
EnvVars: []string{"REVA_AUTH_BEARER_URL"},
Destination: &cfg.Reva.AuthBearer.URL,
},
&cli.StringFlag{
Name: "sharing-url",
Value: "localhost:9150",
Usage: "URL to use for the reva service",
EnvVar: "REVA_SHARING_URL",
EnvVars: []string{"REVA_SHARING_URL"},
Destination: &cfg.Reva.Sharing.URL,
},
@@ -189,21 +188,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-root-url",
Value: "localhost:9152",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_ROOT_URL",
EnvVars: []string{"REVA_STORAGE_ROOT_URL"},
Destination: &cfg.Reva.StorageRoot.URL,
},
&cli.StringFlag{
Name: "storage-root-mount-path",
Value: "/",
Usage: "mount path",
EnvVar: "REVA_STORAGE_ROOT_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_PATH"},
Destination: &cfg.Reva.StorageRoot.MountPath,
},
&cli.StringFlag{
Name: "storage-root-mount-id",
Value: "123e4567-e89b-12d3-a456-426655440001",
Usage: "mount id",
EnvVar: "REVA_STORAGE_ROOT_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_ID"},
Destination: &cfg.Reva.StorageRoot.MountID,
},
@@ -211,21 +210,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-home-url",
Value: "localhost:9154",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_HOME_URL",
EnvVars: []string{"REVA_STORAGE_HOME_URL"},
Destination: &cfg.Reva.StorageHome.URL,
},
&cli.StringFlag{
Name: "storage-home-mount-path",
Value: "/home",
Usage: "mount path",
EnvVar: "REVA_STORAGE_HOME_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_PATH"},
Destination: &cfg.Reva.StorageHome.MountPath,
},
&cli.StringFlag{
Name: "storage-home-mount-id",
Value: "123e4567-e89b-12d3-a456-426655440000",
Usage: "mount id",
EnvVar: "REVA_STORAGE_HOME_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_ID"},
Destination: &cfg.Reva.StorageHome.MountID,
},
@@ -233,7 +232,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-home-data-url",
Value: "localhost:9156",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_HOME_DATA_URL",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_URL"},
Destination: &cfg.Reva.StorageHomeData.URL,
},
@@ -241,21 +240,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-oc-url",
Value: "localhost:9162",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_OC_URL",
EnvVars: []string{"REVA_STORAGE_OC_URL"},
Destination: &cfg.Reva.StorageOC.URL,
},
&cli.StringFlag{
Name: "storage-oc-mount-path",
Value: "/oc",
Usage: "mount path",
EnvVar: "REVA_STORAGE_OC_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_OC_MOUNT_PATH"},
Destination: &cfg.Reva.StorageOC.MountPath,
},
&cli.StringFlag{
Name: "storage-oc-mount-id",
Value: "123e4567-e89b-12d3-a456-426655440000",
Usage: "mount id",
EnvVar: "REVA_STORAGE_OC_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"},
Destination: &cfg.Reva.StorageOC.MountID,
},
@@ -263,7 +262,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-oc-data-url",
Value: "localhost:9164",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_OC_DATA_URL",
EnvVars: []string{"REVA_STORAGE_OC_DATA_URL"},
Destination: &cfg.Reva.StorageOCData.URL,
},
}
+2 -2
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,7 +12,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9109",
Usage: "Address to debug endpoint",
EnvVar: "REVA_DEBUG_ADDR",
EnvVars: []string{"REVA_DEBUG_ADDR"},
Destination: &cfg.Debug.Addr,
},
}
+7 -7
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,26 +12,26 @@ func RootWithConfig(cfg *config.Config) []cli.Flag {
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVar: "REVA_CONFIG_FILE",
EnvVars: []string{"REVA_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.StringFlag{
Name: "log-level",
Value: "info",
Usage: "Set logging level",
EnvVar: "REVA_LOG_LEVEL",
EnvVars: []string{"REVA_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-pretty",
Usage: "Enable pretty logging",
EnvVar: "REVA_LOG_PRETTY",
EnvVars: []string{"REVA_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolTFlag{
&cli.BoolFlag{
Name: "log-color",
Usage: "Enable colored logging",
EnvVar: "REVA_LOG_COLOR",
EnvVars: []string{"REVA_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
}
+20 -21
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 SharingWithConfig(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 SharingWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9151",
Usage: "Address to bind debug server",
EnvVar: "REVA_SHARING_DEBUG_ADDR",
EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"},
Destination: &cfg.Reva.Sharing.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 SharingWithConfig(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,
},
@@ -90,36 +90,35 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_SHARING_NETWORK",
EnvVars: []string{"REVA_SHARING_NETWORK"},
Destination: &cfg.Reva.Sharing.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_SHARING_PROTOCOL",
EnvVars: []string{"REVA_SHARING_PROTOCOL"},
Destination: &cfg.Reva.Sharing.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9150",
Usage: "Address to bind reva service",
EnvVar: "REVA_SHARING_ADDR",
EnvVars: []string{"REVA_SHARING_ADDR"},
Destination: &cfg.Reva.Sharing.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9150",
Usage: "URL to use for the reva service",
EnvVar: "REVA_SHARING_URL",
EnvVars: []string{"REVA_SHARING_URL"},
Destination: &cfg.Reva.Sharing.URL,
},
&cli.StringFlag{
Name: "services",
Value: "usershareprovider,publicshareprovider", // TODO osmshareprovider
Usage: "comma separated list of services to include",
EnvVar: "REVA_SHARING_SERVICES",
Destination: &cfg.Reva.Sharing.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("usershareprovider", "publicshareprovider"), // TODO osmshareprovider
Usage: "--service usershareprovider [--service publicshareprovider]",
EnvVars: []string{"REVA_SHARING_SERVICES"},
},
}
}
+42 -43
View File
@@ -3,7 +3,7 @@ package flagset
import (
"os"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -14,35 +14,35 @@ func StorageHomeWithConfig(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,
},
@@ -51,26 +51,26 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9155",
Usage: "Address to bind debug server",
EnvVar: "REVA_STORAGE_HOME_DEBUG_ADDR",
EnvVars: []string{"REVA_STORAGE_HOME_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageHome.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,
},
@@ -80,7 +80,7 @@ func StorageHomeWithConfig(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,
},
@@ -92,84 +92,83 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_STORAGE_HOME_NETWORK",
EnvVars: []string{"REVA_STORAGE_HOME_NETWORK"},
Destination: &cfg.Reva.StorageHome.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_STORAGE_HOME_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_HOME_PROTOCOL"},
Destination: &cfg.Reva.StorageHome.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9154",
Usage: "Address to bind reva service",
EnvVar: "REVA_STORAGE_HOME_ADDR",
EnvVars: []string{"REVA_STORAGE_HOME_ADDR"},
Destination: &cfg.Reva.StorageHome.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9154",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_HOME_URL",
EnvVars: []string{"REVA_STORAGE_HOME_URL"},
Destination: &cfg.Reva.StorageHome.URL,
},
&cli.StringFlag{
Name: "services",
Value: "storageprovider",
Usage: "comma separated list of services to include",
EnvVar: "REVA_STORAGE_HOME_SERVICES",
Destination: &cfg.Reva.StorageHome.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("storageprovider"),
Usage: "--service storageprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_HOME_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "owncloud",
Usage: "storage driver, eg. local, eos, owncloud or s3",
EnvVar: "REVA_STORAGE_HOME_DRIVER",
EnvVars: []string{"REVA_STORAGE_HOME_DRIVER"},
Destination: &cfg.Reva.StorageHome.Driver,
},
&cli.StringFlag{
Name: "path-wrapper",
Value: "context",
Usage: "path wrapper",
EnvVar: "REVA_STORAGE_HOME_PATH_WRAPPER",
EnvVars: []string{"REVA_STORAGE_HOME_PATH_WRAPPER"},
Destination: &cfg.Reva.StorageHome.PathWrapper,
},
&cli.StringFlag{
Name: "path-wrapper-context-prefix",
Value: "",
Usage: "path wrapper context prefix",
EnvVar: "REVA_STORAGE_HOME_PATH_WRAPPER_CONTEXT_PREFIX",
EnvVars: []string{"REVA_STORAGE_HOME_PATH_WRAPPER_CONTEXT_PREFIX"},
Destination: &cfg.Reva.StorageHome.PathWrapperContext.Prefix,
},
&cli.StringFlag{
Name: "mount-path",
Value: "/home",
Usage: "mount path",
EnvVar: "REVA_STORAGE_HOME_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_PATH"},
Destination: &cfg.Reva.StorageHome.MountPath,
},
&cli.StringFlag{
Name: "mount-id",
Value: "123e4567-e89b-12d3-a456-426655440000",
Usage: "mount id",
EnvVar: "REVA_STORAGE_HOME_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_ID"},
Destination: &cfg.Reva.StorageHome.MountID,
},
&cli.BoolFlag{
Name: "expose-data-server",
Usage: "exposes a dedicated data server",
EnvVar: "REVA_STORAGE_HOME_EXPOSE_DATA_SERVER",
EnvVars: []string{"REVA_STORAGE_HOME_EXPOSE_DATA_SERVER"},
Destination: &cfg.Reva.StorageHome.ExposeDataServer,
},
&cli.StringFlag{
Name: "data-server-url",
Value: "http://localhost:9156/data",
Usage: "data server url",
EnvVar: "REVA_STORAGE_HOME_DATA_SERVER_URL",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_SERVER_URL"},
Destination: &cfg.Reva.StorageHome.DataServerURL,
},
@@ -181,87 +180,87 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-eos-namespace",
Value: "",
Usage: "Namespace for metadata operations",
EnvVar: "REVA_STORAGE_EOS_NAMESPACE",
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
Destination: &cfg.Reva.Storages.EOS.Namespace,
},
&cli.StringFlag{
Name: "storage-eos-binary",
Value: "/usr/bin/eos",
Usage: "Location of the eos binary",
EnvVar: "REVA_STORAGE_EOS_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
Destination: &cfg.Reva.Storages.EOS.EosBinary,
},
&cli.StringFlag{
Name: "storage-eos-xrdcopy-binary",
Value: "/usr/bin/xrdcopy",
Usage: "Location of the xrdcopy binary",
EnvVar: "REVA_STORAGE_EOS_XRDCOPY_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
},
&cli.StringFlag{
Name: "storage-eos-master-url",
Value: "root://eos-example.org",
Usage: "URL of the Master EOS MGM",
EnvVar: "REVA_STORAGE_EOS_MASTER_URL",
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
Destination: &cfg.Reva.Storages.EOS.MasterURL,
},
&cli.StringFlag{
Name: "storage-eos-slave-url",
Value: "root://eos-example.org",
Usage: "URL of the Slave EOS MGM",
EnvVar: "REVA_STORAGE_EOS_SLAVE_URL",
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
},
&cli.StringFlag{
Name: "storage-eos-cache-directory",
Value: os.TempDir(),
Usage: "Location on the local fs where to store reads",
EnvVar: "REVA_STORAGE_EOS_CACHE_DIRECTORY",
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
},
&cli.BoolFlag{
Name: "storage-eos-enable-logging",
Usage: "Enables logging of the commands executed",
EnvVar: "REVA_STORAGE_EOS_ENABLE_LOGGING",
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
},
&cli.BoolFlag{
Name: "storage-eos-show-hidden-sysfiles",
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
EnvVar: "REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES",
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
},
&cli.BoolFlag{
Name: "storage-eos-force-singleuser-mode",
Usage: "force connections to EOS to use SingleUsername",
EnvVar: "REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE",
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
},
&cli.BoolFlag{
Name: "storage-eos-use-keytab",
Usage: "authenticate requests by using an EOS keytab",
EnvVar: "REVA_STORAGE_EOS_USE_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
},
&cli.StringFlag{
Name: "storage-eos-sec-protocol",
Value: "",
Usage: "the xrootd security protocol to use between the server and EOS",
EnvVar: "REVA_STORAGE_EOS_SEC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
},
&cli.StringFlag{
Name: "storage-eos-keytab",
Value: "",
Usage: "the location of the keytab to use to authenticate to EOS",
EnvVar: "REVA_STORAGE_EOS_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.Keytab,
},
&cli.StringFlag{
Name: "storage-eos-single-username",
Value: "",
Usage: "the username to use when SingleUserMode is enabled",
EnvVar: "REVA_STORAGE_EOS_SINGLE_USERNAME",
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
},
@@ -271,7 +270,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-local-root",
Value: "/var/tmp/reva/root",
Usage: "the path to the local storage root",
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
Destination: &cfg.Reva.Storages.Local.Root,
},
@@ -281,7 +280,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-owncloud-datadir",
Value: "/var/tmp/reva/data",
Usage: "the path to the owncloud data directory",
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
},
}
+39 -40
View File
@@ -3,7 +3,7 @@ package flagset
import (
"os"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -14,35 +14,35 @@ func StorageHomeDataWithConfig(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,
},
@@ -51,26 +51,26 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9157",
Usage: "Address to bind debug server",
EnvVar: "REVA_STORAGE_HOME_DATA_DEBUG_ADDR",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageHomeData.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,
},
@@ -80,7 +80,7 @@ func StorageHomeDataWithConfig(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,
},
@@ -92,56 +92,55 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_STORAGE_HOME_DATA_NETWORK",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_NETWORK"},
Destination: &cfg.Reva.StorageHomeData.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "http",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_STORAGE_HOME_DATA_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_PROTOCOL"},
Destination: &cfg.Reva.StorageHomeData.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9156",
Usage: "Address to bind reva service",
EnvVar: "REVA_STORAGE_HOME_DATA_ADDR",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_ADDR"},
Destination: &cfg.Reva.StorageHomeData.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9156",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_HOME_DATA_URL",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_URL"},
Destination: &cfg.Reva.StorageHomeData.URL,
},
&cli.StringFlag{
Name: "services",
Value: "dataprovider",
Usage: "comma separated list of services to include",
EnvVar: "REVA_STORAGE_HOME_DATA_SERVICES",
Destination: &cfg.Reva.StorageHomeData.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("dataprovider"),
Usage: "--service dataprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "owncloud",
Usage: "storage driver, eg. local, eos, owncloud or s3",
EnvVar: "REVA_STORAGE_HOME_DATA_DRIVER",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_DRIVER"},
Destination: &cfg.Reva.StorageHomeData.Driver,
},
&cli.StringFlag{
Name: "prefix",
Value: "data",
Usage: "prefix for the http endpoint, without leading slash",
EnvVar: "REVA_STORAGE_HOME_DATA_PREFIX",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_PREFIX"},
Destination: &cfg.Reva.StorageHomeData.Prefix,
},
&cli.StringFlag{
Name: "temp-folder",
Value: "/var/tmp/",
Usage: "temp folder",
EnvVar: "REVA_STORAGE_HOME_DATA_TEMP_FOLDER",
EnvVars: []string{"REVA_STORAGE_HOME_DATA_TEMP_FOLDER"},
Destination: &cfg.Reva.StorageHomeData.TempFolder,
},
@@ -153,87 +152,87 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-eos-namespace",
Value: "",
Usage: "Namespace for metadata operations",
EnvVar: "REVA_STORAGE_EOS_NAMESPACE",
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
Destination: &cfg.Reva.Storages.EOS.Namespace,
},
&cli.StringFlag{
Name: "storage-eos-binary",
Value: "/usr/bin/eos",
Usage: "Location of the eos binary",
EnvVar: "REVA_STORAGE_EOS_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
Destination: &cfg.Reva.Storages.EOS.EosBinary,
},
&cli.StringFlag{
Name: "storage-eos-xrdcopy-binary",
Value: "/usr/bin/xrdcopy",
Usage: "Location of the xrdcopy binary",
EnvVar: "REVA_STORAGE_EOS_XRDCOPY_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
},
&cli.StringFlag{
Name: "storage-eos-master-url",
Value: "root://eos-example.org",
Usage: "URL of the Master EOS MGM",
EnvVar: "REVA_STORAGE_EOS_MASTER_URL",
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
Destination: &cfg.Reva.Storages.EOS.MasterURL,
},
&cli.StringFlag{
Name: "storage-eos-slave-url",
Value: "root://eos-example.org",
Usage: "URL of the Slave EOS MGM",
EnvVar: "REVA_STORAGE_EOS_SLAVE_URL",
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
},
&cli.StringFlag{
Name: "storage-eos-cache-directory",
Value: os.TempDir(),
Usage: "Location on the local fs where to store reads",
EnvVar: "REVA_STORAGE_EOS_CACHE_DIRECTORY",
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
},
&cli.BoolFlag{
Name: "storage-eos-enable-logging",
Usage: "Enables logging of the commands executed",
EnvVar: "REVA_STORAGE_EOS_ENABLE_LOGGING",
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
},
&cli.BoolFlag{
Name: "storage-eos-show-hidden-sysfiles",
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
EnvVar: "REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES",
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
},
&cli.BoolFlag{
Name: "storage-eos-force-singleuser-mode",
Usage: "force connections to EOS to use SingleUsername",
EnvVar: "REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE",
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
},
&cli.BoolFlag{
Name: "storage-eos-use-keytab",
Usage: "authenticate requests by using an EOS keytab",
EnvVar: "REVA_STORAGE_EOS_USE_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
},
&cli.StringFlag{
Name: "storage-eos-sec-protocol",
Value: "",
Usage: "the xrootd security protocol to use between the server and EOS",
EnvVar: "REVA_STORAGE_EOS_SEC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
},
&cli.StringFlag{
Name: "storage-eos-keytab",
Value: "",
Usage: "the location of the keytab to use to authenticate to EOS",
EnvVar: "REVA_STORAGE_EOS_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.Keytab,
},
&cli.StringFlag{
Name: "storage-eos-single-username",
Value: "",
Usage: "the username to use when SingleUserMode is enabled",
EnvVar: "REVA_STORAGE_EOS_SINGLE_USERNAME",
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
},
@@ -243,7 +242,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-local-root",
Value: "/var/tmp/reva/root",
Usage: "the path to the local storage root",
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
Destination: &cfg.Reva.Storages.Local.Root,
},
@@ -253,7 +252,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-owncloud-datadir",
Value: "/var/tmp/reva/data",
Usage: "the path to the owncloud data directory",
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
},
@@ -263,7 +262,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "gateway-url",
Value: "localhost:9142",
Usage: "URL to use for the reva gateway service",
EnvVar: "REVA_GATEWAY_URL",
EnvVars: []string{"REVA_GATEWAY_URL"},
Destination: &cfg.Reva.Gateway.URL,
},
}
+42 -43
View File
@@ -3,7 +3,7 @@ package flagset
import (
"os"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -14,35 +14,35 @@ func StorageOCWithConfig(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,
},
@@ -51,26 +51,26 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9163",
Usage: "Address to bind debug server",
EnvVar: "REVA_STORAGE_OC_DEBUG_ADDR",
EnvVars: []string{"REVA_STORAGE_OC_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageOC.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,
},
@@ -80,7 +80,7 @@ func StorageOCWithConfig(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,
},
@@ -92,84 +92,83 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_STORAGE_OC_NETWORK",
EnvVars: []string{"REVA_STORAGE_OC_NETWORK"},
Destination: &cfg.Reva.StorageOC.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_STORAGE_OC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_OC_PROTOCOL"},
Destination: &cfg.Reva.StorageOC.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9162",
Usage: "Address to bind reva service",
EnvVar: "REVA_STORAGE_OC_ADDR",
EnvVars: []string{"REVA_STORAGE_OC_ADDR"},
Destination: &cfg.Reva.StorageOC.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9162",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_OC_URL",
EnvVars: []string{"REVA_STORAGE_OC_URL"},
Destination: &cfg.Reva.StorageOC.URL,
},
&cli.StringFlag{
Name: "services",
Value: "storageprovider",
Usage: "comma separated list of services to include",
EnvVar: "REVA_STORAGE_OC_SERVICES",
Destination: &cfg.Reva.StorageOC.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("storageprovider"),
Usage: "--service storageprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_OC_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "owncloud",
Usage: "storage driver, eg. local, eos, owncloud or s3",
EnvVar: "REVA_STORAGE_OC_DRIVER",
EnvVars: []string{"REVA_STORAGE_OC_DRIVER"},
Destination: &cfg.Reva.StorageOC.Driver,
},
&cli.StringFlag{
Name: "path-wrapper",
Value: "",
Usage: "path wrapper",
EnvVar: "REVA_STORAGE_OC_PATH_WRAPPER",
EnvVars: []string{"REVA_STORAGE_OC_PATH_WRAPPER"},
Destination: &cfg.Reva.StorageOC.PathWrapper,
},
&cli.StringFlag{
Name: "path-wrapper-context-prefix",
Value: "",
Usage: "path wrapper context prefix",
EnvVar: "REVA_STORAGE_OC_PATH_WRAPPER_CONTEXT_PREFIX",
EnvVars: []string{"REVA_STORAGE_OC_PATH_WRAPPER_CONTEXT_PREFIX"},
Destination: &cfg.Reva.StorageOC.PathWrapperContext.Prefix,
},
&cli.StringFlag{
Name: "mount-path",
Value: "/oc",
Usage: "mount path",
EnvVar: "REVA_STORAGE_OC_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_OC_MOUNT_PATH"},
Destination: &cfg.Reva.StorageOC.MountPath,
},
&cli.StringFlag{
Name: "mount-id",
Value: "123e4567-e89b-12d3-a456-426655440000",
Usage: "mount id",
EnvVar: "REVA_STORAGE_OC_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"},
Destination: &cfg.Reva.StorageOC.MountID,
},
&cli.BoolFlag{
Name: "expose-data-server",
Usage: "exposes a dedicated data server",
EnvVar: "REVA_STORAGE_OC_EXPOSE_DATA_SERVER",
EnvVars: []string{"REVA_STORAGE_OC_EXPOSE_DATA_SERVER"},
Destination: &cfg.Reva.StorageOC.ExposeDataServer,
},
&cli.StringFlag{
Name: "data-server-url",
Value: "http://localhost:9164/data",
Usage: "data server url",
EnvVar: "REVA_STORAGE_OC_DATA_SERVER_URL",
EnvVars: []string{"REVA_STORAGE_OC_DATA_SERVER_URL"},
Destination: &cfg.Reva.StorageOC.DataServerURL,
},
@@ -181,87 +180,87 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-eos-namespace",
Value: "",
Usage: "Namespace for metadata operations",
EnvVar: "REVA_STORAGE_EOS_NAMESPACE",
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
Destination: &cfg.Reva.Storages.EOS.Namespace,
},
&cli.StringFlag{
Name: "storage-eos-binary",
Value: "/usr/bin/eos",
Usage: "Location of the eos binary",
EnvVar: "REVA_STORAGE_EOS_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
Destination: &cfg.Reva.Storages.EOS.EosBinary,
},
&cli.StringFlag{
Name: "storage-eos-xrdcopy-binary",
Value: "/usr/bin/xrdcopy",
Usage: "Location of the xrdcopy binary",
EnvVar: "REVA_STORAGE_EOS_XRDCOPY_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
},
&cli.StringFlag{
Name: "storage-eos-master-url",
Value: "root://eos-example.org",
Usage: "URL of the Master EOS MGM",
EnvVar: "REVA_STORAGE_EOS_MASTER_URL",
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
Destination: &cfg.Reva.Storages.EOS.MasterURL,
},
&cli.StringFlag{
Name: "storage-eos-slave-url",
Value: "root://eos-example.org",
Usage: "URL of the Slave EOS MGM",
EnvVar: "REVA_STORAGE_EOS_SLAVE_URL",
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
},
&cli.StringFlag{
Name: "storage-eos-cache-directory",
Value: os.TempDir(),
Usage: "Location on the local fs where to store reads",
EnvVar: "REVA_STORAGE_EOS_CACHE_DIRECTORY",
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
},
&cli.BoolFlag{
Name: "storage-eos-enable-logging",
Usage: "Enables logging of the commands executed",
EnvVar: "REVA_STORAGE_EOS_ENABLE_LOGGING",
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
},
&cli.BoolFlag{
Name: "storage-eos-show-hidden-sysfiles",
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
EnvVar: "REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES",
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
},
&cli.BoolFlag{
Name: "storage-eos-force-singleuser-mode",
Usage: "force connections to EOS to use SingleUsername",
EnvVar: "REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE",
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
},
&cli.BoolFlag{
Name: "storage-eos-use-keytab",
Usage: "authenticate requests by using an EOS keytab",
EnvVar: "REVA_STORAGE_EOS_USE_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
},
&cli.StringFlag{
Name: "storage-eos-sec-protocol",
Value: "",
Usage: "the xrootd security protocol to use between the server and EOS",
EnvVar: "REVA_STORAGE_EOS_SEC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
},
&cli.StringFlag{
Name: "storage-eos-keytab",
Value: "",
Usage: "the location of the keytab to use to authenticate to EOS",
EnvVar: "REVA_STORAGE_EOS_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.Keytab,
},
&cli.StringFlag{
Name: "storage-eos-single-username",
Value: "",
Usage: "the username to use when SingleUserMode is enabled",
EnvVar: "REVA_STORAGE_EOS_SINGLE_USERNAME",
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
},
@@ -271,7 +270,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-local-root",
Value: "/var/tmp/reva/root",
Usage: "the path to the local storage root",
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
Destination: &cfg.Reva.Storages.Local.Root,
},
@@ -281,7 +280,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-owncloud-datadir",
Value: "/var/tmp/reva/data",
Usage: "the path to the owncloud data directory",
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
},
}
+39 -40
View File
@@ -3,7 +3,7 @@ package flagset
import (
"os"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -14,35 +14,35 @@ func StorageOCDataWithConfig(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,
},
@@ -51,26 +51,26 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9165",
Usage: "Address to bind debug server",
EnvVar: "REVA_STORAGE_OC_DATA_DEBUG_ADDR",
EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageOCData.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,
},
@@ -80,7 +80,7 @@ func StorageOCDataWithConfig(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,
},
@@ -92,56 +92,55 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_STORAGE_OC_DATA_NETWORK",
EnvVars: []string{"REVA_STORAGE_OC_DATA_NETWORK"},
Destination: &cfg.Reva.StorageOCData.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "http",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_STORAGE_OC_DATA_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_OC_DATA_PROTOCOL"},
Destination: &cfg.Reva.StorageOCData.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9164",
Usage: "Address to bind reva service",
EnvVar: "REVA_STORAGE_OC_DATA_ADDR",
EnvVars: []string{"REVA_STORAGE_OC_DATA_ADDR"},
Destination: &cfg.Reva.StorageOCData.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9164",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_OC_DATA_URL",
EnvVars: []string{"REVA_STORAGE_OC_DATA_URL"},
Destination: &cfg.Reva.StorageOCData.URL,
},
&cli.StringFlag{
Name: "services",
Value: "dataprovider",
Usage: "comma separated list of services to include in the storage-oc data service",
EnvVar: "REVA_STORAGE_OC_DATA_SERVICES",
Destination: &cfg.Reva.StorageOCData.Services,
&cli.StringSliceFlag{
Name: "service",
Value: cli.NewStringSlice("dataprovider"),
Usage: "--service dataprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_OC_DATA_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "owncloud",
Usage: "storage driver, eg. local, eos, owncloud or s3",
EnvVar: "REVA_STORAGE_OC_DATA_DRIVER",
EnvVars: []string{"REVA_STORAGE_OC_DATA_DRIVER"},
Destination: &cfg.Reva.StorageOCData.Driver,
},
&cli.StringFlag{
Name: "prefix",
Value: "data",
Usage: "prefix for the http endpoint, without leading slash",
EnvVar: "REVA_STORAGE_OC_DATA_PREFIX",
EnvVars: []string{"REVA_STORAGE_OC_DATA_PREFIX"},
Destination: &cfg.Reva.StorageOCData.Prefix,
},
&cli.StringFlag{
Name: "temp-folder",
Value: "/var/tmp/",
Usage: "temp folder",
EnvVar: "REVA_STORAGE_OC_DATA_TEMP_FOLDER",
EnvVars: []string{"REVA_STORAGE_OC_DATA_TEMP_FOLDER"},
Destination: &cfg.Reva.StorageOCData.TempFolder,
},
@@ -153,87 +152,87 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-eos-namespace",
Value: "",
Usage: "Namespace for metadata operations",
EnvVar: "REVA_STORAGE_EOS_NAMESPACE",
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
Destination: &cfg.Reva.Storages.EOS.Namespace,
},
&cli.StringFlag{
Name: "storage-eos-binary",
Value: "/usr/bin/eos",
Usage: "Location of the eos binary",
EnvVar: "REVA_STORAGE_EOS_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
Destination: &cfg.Reva.Storages.EOS.EosBinary,
},
&cli.StringFlag{
Name: "storage-eos-xrdcopy-binary",
Value: "/usr/bin/xrdcopy",
Usage: "Location of the xrdcopy binary",
EnvVar: "REVA_STORAGE_EOS_XRDCOPY_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
},
&cli.StringFlag{
Name: "storage-eos-master-url",
Value: "root://eos-example.org",
Usage: "URL of the Master EOS MGM",
EnvVar: "REVA_STORAGE_EOS_MASTER_URL",
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
Destination: &cfg.Reva.Storages.EOS.MasterURL,
},
&cli.StringFlag{
Name: "storage-eos-slave-url",
Value: "root://eos-example.org",
Usage: "URL of the Slave EOS MGM",
EnvVar: "REVA_STORAGE_EOS_SLAVE_URL",
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
},
&cli.StringFlag{
Name: "storage-eos-cache-directory",
Value: os.TempDir(),
Usage: "Location on the local fs where to store reads",
EnvVar: "REVA_STORAGE_EOS_CACHE_DIRECTORY",
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
},
&cli.BoolFlag{
Name: "storage-eos-enable-logging",
Usage: "Enables logging of the commands executed",
EnvVar: "REVA_STORAGE_EOS_ENABLE_LOGGING",
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
},
&cli.BoolFlag{
Name: "storage-eos-show-hidden-sysfiles",
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
EnvVar: "REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES",
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
},
&cli.BoolFlag{
Name: "storage-eos-force-singleuser-mode",
Usage: "force connections to EOS to use SingleUsername",
EnvVar: "REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE",
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
},
&cli.BoolFlag{
Name: "storage-eos-use-keytab",
Usage: "authenticate requests by using an EOS keytab",
EnvVar: "REVA_STORAGE_EOS_USE_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
},
&cli.StringFlag{
Name: "storage-eos-sec-protocol",
Value: "",
Usage: "the xrootd security protocol to use between the server and EOS",
EnvVar: "REVA_STORAGE_EOS_SEC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
},
&cli.StringFlag{
Name: "storage-eos-keytab",
Value: "",
Usage: "the location of the keytab to use to authenticate to EOS",
EnvVar: "REVA_STORAGE_EOS_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.Keytab,
},
&cli.StringFlag{
Name: "storage-eos-single-username",
Value: "",
Usage: "the username to use when SingleUserMode is enabled",
EnvVar: "REVA_STORAGE_EOS_SINGLE_USERNAME",
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
},
@@ -243,7 +242,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-local-root",
Value: "/var/tmp/reva/root",
Usage: "the path to the local storage root",
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
Destination: &cfg.Reva.Storages.Local.Root,
},
@@ -253,7 +252,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-owncloud-datadir",
Value: "/var/tmp/reva/data",
Usage: "the path to the owncloud data directory",
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
},
@@ -263,7 +262,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
Name: "gateway-url",
Value: "localhost:9142",
Usage: "URL to use for the reva gateway service",
EnvVar: "REVA_GATEWAY_URL",
EnvVars: []string{"REVA_GATEWAY_URL"},
Destination: &cfg.Reva.Gateway.URL,
},
}
+41 -42
View File
@@ -3,7 +3,7 @@ package flagset
import (
"os"
"github.com/micro/cli"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-reva/pkg/config"
)
@@ -14,35 +14,35 @@ func StorageRootWithConfig(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,
},
@@ -51,26 +51,26 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9153",
Usage: "Address to bind debug server",
EnvVar: "REVA_STORAGE_ROOT_DEBUG_ADDR",
EnvVars: []string{"REVA_STORAGE_ROOT_DEBUG_ADDR"},
Destination: &cfg.Reva.StorageRoot.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,
},
@@ -80,7 +80,7 @@ func StorageRootWithConfig(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,
},
@@ -92,84 +92,83 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_STORAGE_ROOT_NETWORK",
EnvVars: []string{"REVA_STORAGE_ROOT_NETWORK"},
Destination: &cfg.Reva.StorageRoot.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_STORAGE_ROOT_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_ROOT_PROTOCOL"},
Destination: &cfg.Reva.StorageRoot.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9152",
Usage: "Address to bind reva service",
EnvVar: "REVA_STORAGE_ROOT_ADDR",
EnvVars: []string{"REVA_STORAGE_ROOT_ADDR"},
Destination: &cfg.Reva.StorageRoot.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9152",
Usage: "URL to use for the reva service",
EnvVar: "REVA_STORAGE_ROOT_URL",
EnvVars: []string{"REVA_STORAGE_ROOT_URL"},
Destination: &cfg.Reva.StorageRoot.URL,
},
&cli.StringFlag{
Name: "services",
Value: "storageprovider",
Usage: "comma separated list of services to include in the storage-root service",
EnvVar: "REVA_STORAGE_ROOT_SERVICES",
Destination: &cfg.Reva.StorageRoot.Services,
Name: "service",
Value: "storageprovider",
Usage: "--service storageprovider [--service otherservice]",
EnvVars: []string{"REVA_STORAGE_ROOT_SERVICES"},
},
&cli.StringFlag{
Name: "driver",
Value: "local",
Usage: "storage driver, eg. local, eos, owncloud or s3",
EnvVar: "REVA_STORAGE_ROOT_DRIVER",
EnvVars: []string{"REVA_STORAGE_ROOT_DRIVER"},
Destination: &cfg.Reva.StorageRoot.Driver,
},
&cli.StringFlag{
Name: "path-wrapper",
Value: "",
Usage: "path wrapper",
EnvVar: "REVA_STORAGE_ROOT_PATH_WRAPPER",
EnvVars: []string{"REVA_STORAGE_ROOT_PATH_WRAPPER"},
Destination: &cfg.Reva.StorageRoot.PathWrapper,
},
&cli.StringFlag{
Name: "path-wrapper-context-prefix",
Value: "",
Usage: "path wrapper context prefix",
EnvVar: "REVA_STORAGE_ROOT_PATH_WRAPPER_CONTEXT_PREFIX",
EnvVars: []string{"REVA_STORAGE_ROOT_PATH_WRAPPER_CONTEXT_PREFIX"},
Destination: &cfg.Reva.StorageRoot.PathWrapperContext.Prefix,
},
&cli.StringFlag{
Name: "mount-path",
Value: "/",
Usage: "mount path",
EnvVar: "REVA_STORAGE_ROOT_MOUNT_PATH",
EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_PATH"},
Destination: &cfg.Reva.StorageRoot.MountPath,
},
&cli.StringFlag{
Name: "mount-id",
Value: "123e4567-e89b-12d3-a456-426655440001",
Usage: "mount id",
EnvVar: "REVA_STORAGE_ROOT_MOUNT_ID",
EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_ID"},
Destination: &cfg.Reva.StorageRoot.MountID,
},
&cli.BoolFlag{
Name: "expose-data-server",
Usage: "exposes a dedicated data server",
EnvVar: "REVA_STORAGE_ROOT_EXPOSE_DATA_SERVER",
EnvVars: []string{"REVA_STORAGE_ROOT_EXPOSE_DATA_SERVER"},
Destination: &cfg.Reva.StorageRoot.ExposeDataServer,
},
&cli.StringFlag{
Name: "data-server-url",
Value: "",
Usage: "data server url",
EnvVar: "REVA_STORAGE_ROOT_DATA_SERVER_URL",
EnvVars: []string{"REVA_STORAGE_ROOT_DATA_SERVER_URL"},
Destination: &cfg.Reva.StorageRoot.DataServerURL,
},
@@ -181,87 +180,87 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-eos-namespace",
Value: "",
Usage: "Namespace for metadata operations",
EnvVar: "REVA_STORAGE_EOS_NAMESPACE",
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
Destination: &cfg.Reva.Storages.EOS.Namespace,
},
&cli.StringFlag{
Name: "storage-eos-binary",
Value: "/usr/bin/eos",
Usage: "Location of the eos binary",
EnvVar: "REVA_STORAGE_EOS_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
Destination: &cfg.Reva.Storages.EOS.EosBinary,
},
&cli.StringFlag{
Name: "storage-eos-xrdcopy-binary",
Value: "/usr/bin/xrdcopy",
Usage: "Location of the xrdcopy binary",
EnvVar: "REVA_STORAGE_EOS_XRDCOPY_BINARY",
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
},
&cli.StringFlag{
Name: "storage-eos-master-url",
Value: "root://eos-example.org",
Usage: "URL of the Master EOS MGM",
EnvVar: "REVA_STORAGE_EOS_MASTER_URL",
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
Destination: &cfg.Reva.Storages.EOS.MasterURL,
},
&cli.StringFlag{
Name: "storage-eos-slave-url",
Value: "root://eos-example.org",
Usage: "URL of the Slave EOS MGM",
EnvVar: "REVA_STORAGE_EOS_SLAVE_URL",
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
},
&cli.StringFlag{
Name: "storage-eos-cache-directory",
Value: os.TempDir(),
Usage: "Location on the local fs where to store reads",
EnvVar: "REVA_STORAGE_EOS_CACHE_DIRECTORY",
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
},
&cli.BoolFlag{
Name: "storage-eos-enable-logging",
Usage: "Enables logging of the commands executed",
EnvVar: "REVA_STORAGE_EOS_ENABLE_LOGGING",
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
},
&cli.BoolFlag{
Name: "storage-eos-show-hidden-sysfiles",
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
EnvVar: "REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES",
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
},
&cli.BoolFlag{
Name: "storage-eos-force-singleuser-mode",
Usage: "force connections to EOS to use SingleUsername",
EnvVar: "REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE",
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
},
&cli.BoolFlag{
Name: "storage-eos-use-keytab",
Usage: "authenticate requests by using an EOS keytab",
EnvVar: "REVA_STORAGE_EOS_USE_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
},
&cli.StringFlag{
Name: "storage-eos-sec-protocol",
Value: "",
Usage: "the xrootd security protocol to use between the server and EOS",
EnvVar: "REVA_STORAGE_EOS_SEC_PROTOCOL",
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
},
&cli.StringFlag{
Name: "storage-eos-keytab",
Value: "",
Usage: "the location of the keytab to use to authenticate to EOS",
EnvVar: "REVA_STORAGE_EOS_KEYTAB",
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
Destination: &cfg.Reva.Storages.EOS.Keytab,
},
&cli.StringFlag{
Name: "storage-eos-single-username",
Value: "",
Usage: "the username to use when SingleUserMode is enabled",
EnvVar: "REVA_STORAGE_EOS_SINGLE_USERNAME",
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
},
@@ -271,7 +270,7 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-local-root",
Value: "/var/tmp/reva/root",
Usage: "the path to the local storage root",
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
Destination: &cfg.Reva.Storages.Local.Root,
},
@@ -281,7 +280,7 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
Name: "storage-owncloud-datadir",
Value: "/var/tmp/reva/data",
Usage: "the path to the owncloud data directory",
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
},
}
+32 -33
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 UsersWithConfig(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 UsersWithConfig(cfg *config.Config) []cli.Flag {
Name: "debug-addr",
Value: "0.0.0.0:9145",
Usage: "Address to bind debug server",
EnvVar: "REVA_SHARING_DEBUG_ADDR",
EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"},
Destination: &cfg.Reva.Users.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 UsersWithConfig(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,49 +88,49 @@ func UsersWithConfig(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
@@ -138,28 +138,28 @@ func UsersWithConfig(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,
},
@@ -171,50 +171,49 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
Name: "network",
Value: "tcp",
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
EnvVar: "REVA_USERS_NETWORK",
EnvVars: []string{"REVA_USERS_NETWORK"},
Destination: &cfg.Reva.Users.Network,
},
&cli.StringFlag{
Name: "protocol",
Value: "grpc",
Usage: "protocol for reva service, can be 'http' or 'grpc'",
EnvVar: "REVA_USERS_PROTOCOL",
EnvVars: []string{"REVA_USERS_PROTOCOL"},
Destination: &cfg.Reva.Users.Protocol,
},
&cli.StringFlag{
Name: "addr",
Value: "0.0.0.0:9144",
Usage: "Address to bind reva service",
EnvVar: "REVA_USERS_ADDR",
EnvVars: []string{"REVA_USERS_ADDR"},
Destination: &cfg.Reva.Users.Addr,
},
&cli.StringFlag{
Name: "url",
Value: "localhost:9144",
Usage: "URL to use for the reva service",
EnvVar: "REVA_USERS_URL",
EnvVars: []string{"REVA_USERS_URL"},
Destination: &cfg.Reva.Users.URL,
},
&cli.StringFlag{
Name: "services",
Value: "userprovider", // TODO preferences
Usage: "comma separated list of services to include",
EnvVar: "REVA_USERS_SERVICES",
Destination: &cfg.Reva.Users.Services,
Name: "service",
Value: "userprovider", // TODO preferences
Usage: "--service userprovider [--service otherservice]",
EnvVars: []string{"REVA_USERS_SERVICES"},
},
&cli.StringFlag{
Name: "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: "json-config",
Value: "",
Usage: "Path to users.json file",
EnvVar: "REVA_USERS_JSON",
EnvVars: []string{"REVA_USERS_JSON"},
Destination: &cfg.Reva.Users.JSON,
},
}