separate reva services
update config add desktop client with all localhost ports split flagsets add user docs update readme Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// AuthBasicWithConfig applies cfg to the root flagset
|
||||
func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9147",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Users
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "users-driver",
|
||||
Value: "demo",
|
||||
Usage: "user driver: 'demo', 'json' or 'ldap'",
|
||||
EnvVar: "REVA_USERS_DRIVER",
|
||||
Destination: &cfg.Reva.Users.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "users-json",
|
||||
Value: "",
|
||||
Usage: "Path to users.json file",
|
||||
EnvVar: "REVA_USERS_JSON",
|
||||
Destination: &cfg.Reva.Users.JSON,
|
||||
},
|
||||
|
||||
// LDAP
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-hostname",
|
||||
Value: "localhost",
|
||||
Usage: "LDAP hostname",
|
||||
EnvVar: "REVA_LDAP_HOSTNAME",
|
||||
Destination: &cfg.Reva.LDAP.Hostname,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ldap-port",
|
||||
Value: 389,
|
||||
Usage: "LDAP port",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.BaseDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-userfilter",
|
||||
Value: "(objectclass=posixAccount)",
|
||||
Usage: "LDAP userfilter",
|
||||
EnvVar: "REVA_LDAP_USERFILTER",
|
||||
Destination: &cfg.Reva.LDAP.UserFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-groupfilter",
|
||||
Value: "(objectclass=posixGroup)",
|
||||
Usage: "LDAP groupfilter",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.BindDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-password",
|
||||
Value: "admin",
|
||||
Usage: "LDAP bind password",
|
||||
EnvVar: "REVA_LDAP_BIND_PASSWORD",
|
||||
Destination: &cfg.Reva.LDAP.BindPassword,
|
||||
},
|
||||
// ldap dn is always the dn
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uid",
|
||||
Value: "uid",
|
||||
Usage: "LDAP schema uid",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.Schema.Mail,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-displayName",
|
||||
Value: "displayName",
|
||||
Usage: "LDAP schema displayName",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.Schema.CN,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// AuthBasic
|
||||
|
||||
&cli.StringFlag{
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// AuthBearerWithConfig applies cfg to the root flagset
|
||||
func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9149",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// OIDC
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "oidc-issuer",
|
||||
Value: "http://localhost:9140",
|
||||
Usage: "OIDC issuer",
|
||||
EnvVar: "REVA_OIDC_ISSUER",
|
||||
Destination: &cfg.Reva.OIDC.Issuer,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "oidc-insecure",
|
||||
Usage: "OIDC allow insecure communication",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.OIDC.IDClaim,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// AuthBearer
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// RootWithConfig applies cfg to the root flagset
|
||||
func RootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "config-file",
|
||||
Value: "",
|
||||
Usage: "Path to config file",
|
||||
EnvVar: "REVA_CONFIG_FILE",
|
||||
Destination: &cfg.File,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "log-level",
|
||||
Value: "info",
|
||||
Usage: "Set logging level",
|
||||
EnvVar: "REVA_LOG_LEVEL",
|
||||
Destination: &cfg.Log.Level,
|
||||
},
|
||||
&cli.BoolTFlag{
|
||||
Name: "log-pretty",
|
||||
Usage: "Enable pretty logging",
|
||||
EnvVar: "REVA_LOG_PRETTY",
|
||||
Destination: &cfg.Log.Pretty,
|
||||
},
|
||||
&cli.BoolTFlag{
|
||||
Name: "log-color",
|
||||
Usage: "Enable colored logging",
|
||||
EnvVar: "REVA_LOG_COLOR",
|
||||
Destination: &cfg.Log.Color,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// HealthWithConfig applies cfg to the root flagset
|
||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9109",
|
||||
Usage: "Address to debug endpoint",
|
||||
EnvVar: "REVA_DEBUG_ADDR",
|
||||
Destination: &cfg.Debug.Addr,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ServerWithConfig applies cfg to the root flagset
|
||||
func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9139",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "REVA_DEBUG_ADDR",
|
||||
Destination: &cfg.Debug.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVar: "REVA_DEBUG_TOKEN",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-http-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva http server, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_HTTP_NETWORK",
|
||||
Destination: &cfg.Reva.HTTP.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-http-addr",
|
||||
Value: "0.0.0.0:9135",
|
||||
Usage: "Address to bind http port of reva server",
|
||||
EnvVar: "REVA_HTTP_ADDR",
|
||||
Destination: &cfg.Reva.HTTP.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-http-root",
|
||||
Value: "/",
|
||||
Usage: "Root path of reva server",
|
||||
EnvVar: "REVA__HTTP_ROOT",
|
||||
Destination: &cfg.Reva.HTTP.Root,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-grpc-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva grpc server, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_GRPC_NETWORK",
|
||||
Destination: &cfg.Reva.GRPC.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-grpc-addr",
|
||||
Value: "0.0.0.0:9136",
|
||||
Usage: "Address to bind grpc port of reva server",
|
||||
EnvVar: "REVA_GRPC_ADDR",
|
||||
Destination: &cfg.Reva.GRPC.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-max-cpus",
|
||||
Value: "2",
|
||||
Usage: "Max number of cpus for reva server",
|
||||
EnvVar: "REVA_MAX_CPUS",
|
||||
Destination: &cfg.Reva.MaxCPUs,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-log-level",
|
||||
Value: "info",
|
||||
Usage: "Log level for reva server",
|
||||
EnvVar: "REVA_LOG_LEVEL",
|
||||
Destination: &cfg.Reva.LogLevel,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "reva-authprovider-provider",
|
||||
Value: "",
|
||||
Usage: "URL of the OpenID Connect Provider",
|
||||
EnvVar: "REVA_AUTHPROVIDER_PROVIDER",
|
||||
Destination: &cfg.AuthProvider.Provider,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "reva-authprovider-insecure",
|
||||
Usage: "Allow insecure certificates",
|
||||
EnvVar: "REVA_AUTHPROVIDER_INSECURE",
|
||||
Destination: &cfg.AuthProvider.Insecure,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "asset-path",
|
||||
Value: "",
|
||||
Usage: "Path to custom assets",
|
||||
EnvVar: "REVA_ASSET_PATH",
|
||||
Destination: &cfg.Asset.Path,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// FrontendWithConfig applies cfg to the root flagset
|
||||
func FrontendWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9141",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.TransferSecret,
|
||||
},
|
||||
|
||||
// OIDC
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "oidc-issuer",
|
||||
Value: "http://localhost:9140",
|
||||
Usage: "OIDC issuer",
|
||||
EnvVar: "REVA_OIDC_ISSUER",
|
||||
Destination: &cfg.Reva.OIDC.Issuer,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "oidc-insecure",
|
||||
Usage: "OIDC allow insecure communication",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.OIDC.IDClaim,
|
||||
},
|
||||
|
||||
// TODO allow configuring clients
|
||||
|
||||
// Services
|
||||
|
||||
// Frontend
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Frontend.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9140",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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,
|
||||
},
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "gateway-url",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVar: "REVA_GATEWAY_URL",
|
||||
Destination: &cfg.Reva.Gateway.URL,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// GatewayWithConfig applies cfg to the root flagset
|
||||
func GatewayWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9143",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.TransferSecret,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "transfer-expires",
|
||||
Value: 10,
|
||||
Usage: "Transfer secret for datagateway",
|
||||
EnvVar: "REVA_TRANSFER_EXPIRES",
|
||||
Destination: &cfg.Reva.TransferExpires,
|
||||
},
|
||||
|
||||
// TODO allow configuring clients
|
||||
|
||||
// Services
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Gateway.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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,
|
||||
},
|
||||
// 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",
|
||||
Destination: &cfg.Reva.Gateway.CommitShareToStorageGrant,
|
||||
},
|
||||
|
||||
// other services
|
||||
|
||||
// storage registry
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "frontend-url",
|
||||
Value: "localhost:9140",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Sharing.URL,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-root-url",
|
||||
Value: "localhost:9152",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.StorageRoot.MountID,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-home-url",
|
||||
Value: "localhost:9154",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.StorageHome.MountID,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-home-data-url",
|
||||
Value: "localhost:9156",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "REVA_STORAGE_HOME_DATA_URL",
|
||||
Destination: &cfg.Reva.StorageHomeData.URL,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-oc-url",
|
||||
Value: "localhost:9162",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.StorageOC.MountID,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-oc-data-url",
|
||||
Value: "localhost:9164",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "REVA_STORAGE_OC_DATA_URL",
|
||||
Destination: &cfg.Reva.StorageOCData.URL,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// HealthWithConfig applies cfg to the health flagset
|
||||
func HealthWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9109",
|
||||
Usage: "Address to debug endpoint",
|
||||
EnvVar: "REVA_DEBUG_ADDR",
|
||||
Destination: &cfg.Debug.Addr,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// RootWithConfig applies cfg to the root flagset
|
||||
func RootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "config-file",
|
||||
Value: "",
|
||||
Usage: "Path to config file",
|
||||
EnvVar: "REVA_CONFIG_FILE",
|
||||
Destination: &cfg.File,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "log-level",
|
||||
Value: "info",
|
||||
Usage: "Set logging level",
|
||||
EnvVar: "REVA_LOG_LEVEL",
|
||||
Destination: &cfg.Log.Level,
|
||||
},
|
||||
&cli.BoolTFlag{
|
||||
Name: "log-pretty",
|
||||
Usage: "Enable pretty logging",
|
||||
EnvVar: "REVA_LOG_PRETTY",
|
||||
Destination: &cfg.Log.Pretty,
|
||||
},
|
||||
&cli.BoolTFlag{
|
||||
Name: "log-color",
|
||||
Usage: "Enable colored logging",
|
||||
EnvVar: "REVA_LOG_COLOR",
|
||||
Destination: &cfg.Log.Color,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,507 @@
|
||||
package flagset
|
||||
|
||||
/* TODO move this into dedicated flagsets, along with storage commands
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// ServerWithConfig applies cfg to the root flagset
|
||||
func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-debug-addr",
|
||||
Value: "0.0.0.0:9159",
|
||||
Usage: "Address to bind storage eos debug server",
|
||||
EnvVar: "REVA_STORAGE_EOS_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageEOS.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-debug-addr",
|
||||
Value: "0.0.0.0:9161",
|
||||
Usage: "Address to bind storage eos data debug server",
|
||||
EnvVar: "REVA_STORAGE_HOME_DATA_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageEOSData.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-debug-addr",
|
||||
Value: "0.0.0.0:9167",
|
||||
Usage: "Address to bind storage s3 debug server",
|
||||
EnvVar: "REVA_STORAGE_S3_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageS3.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-debug-addr",
|
||||
Value: "0.0.0.0:9169",
|
||||
Usage: "Address to bind storage s3 data debug server",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageS3Data.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-debug-addr",
|
||||
Value: "0.0.0.0:9171",
|
||||
Usage: "Address to bind storage custom debug server",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageCustom.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-debug-addr",
|
||||
Value: "0.0.0.0:9173",
|
||||
Usage: "Address to bind storage custom data debug server",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_DEBUG_ADDR",
|
||||
Destination: &cfg.Reva.StorageCustomData.DebugAddr,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-eos service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_EOS_NETWORK",
|
||||
Destination: &cfg.Reva.StorageEOS.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-protocol",
|
||||
Value: "grpc",
|
||||
Usage: "protocol for reva storage-eos service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_EOS_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageEOS.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-addr",
|
||||
Value: "0.0.0.0:9158",
|
||||
Usage: "Address to bind reva storage-eos service",
|
||||
EnvVar: "REVA_STORAGE_EOS_ADDR",
|
||||
Destination: &cfg.Reva.StorageEOS.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-url",
|
||||
Value: "localhost:9158",
|
||||
Usage: "URL to use for the reva storage-eos service",
|
||||
EnvVar: "REVA_STORAGE_EOS_URL",
|
||||
Destination: &cfg.Reva.StorageEOS.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-services",
|
||||
Value: "storageprovider",
|
||||
Usage: "comma separated list of services to include in the storage-eos service",
|
||||
EnvVar: "REVA_STORAGE_EOS_SERVICES",
|
||||
Destination: &cfg.Reva.StorageEOS.Services,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-driver",
|
||||
Value: "local",
|
||||
Usage: "eos storage driver",
|
||||
EnvVar: "REVA_STORAGE_EOS_DRIVER",
|
||||
Destination: &cfg.Reva.StorageEOS.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-path-wrapper",
|
||||
Value: "",
|
||||
Usage: "eos storage path wrapper",
|
||||
EnvVar: "REVA_STORAGE_EOS_PATH_WRAPPER",
|
||||
Destination: &cfg.Reva.StorageEOS.PathWrapper,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-path-wrapper-context-prefix",
|
||||
Value: "",
|
||||
Usage: "eos storage path wrapper context prefix",
|
||||
EnvVar: "REVA_STORAGE_EOS_PATH_WRAPPER_CONTEXT_PREFIX",
|
||||
Destination: &cfg.Reva.StorageEOS.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-mount-path",
|
||||
Value: "/eos",
|
||||
Usage: "eos storage mount path",
|
||||
EnvVar: "REVA_STORAGE_EOS_MOUNT_PATH",
|
||||
Destination: &cfg.Reva.StorageEOS.MountPath,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-mount-id",
|
||||
Value: "",
|
||||
Usage: "eos storage mount id",
|
||||
EnvVar: "REVA_STORAGE_EOS_MOUNT_ID",
|
||||
Destination: &cfg.Reva.StorageEOS.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-expose-data-server",
|
||||
Usage: "eos storage exposes a dedicated data server",
|
||||
EnvVar: "REVA_STORAGE_EOS_EXPOSE_DATA_SERVER",
|
||||
Destination: &cfg.Reva.StorageEOS.ExposeDataServer,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-server-url",
|
||||
Value: "",
|
||||
Usage: "eos storage data server url",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_SERVER_URL",
|
||||
Destination: &cfg.Reva.StorageEOS.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage eos data
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-eos data service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_NETWORK",
|
||||
Destination: &cfg.Reva.StorageEOSData.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-protocol",
|
||||
Value: "http",
|
||||
Usage: "protocol for reva storage-eos data service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageEOSData.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-addr",
|
||||
Value: "0.0.0.0:9160",
|
||||
Usage: "Address to bind reva storage-eos data service",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_ADDR",
|
||||
Destination: &cfg.Reva.StorageEOSData.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-url",
|
||||
Value: "localhost:9160",
|
||||
Usage: "URL to use for the reva storage-eos data service",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_URL",
|
||||
Destination: &cfg.Reva.StorageEOSData.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-services",
|
||||
Value: "dataprovider",
|
||||
Usage: "comma separated list of services to include in the storage-eos data service",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_SERVICES",
|
||||
Destination: &cfg.Reva.StorageEOSData.Services,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-driver",
|
||||
Value: "eos",
|
||||
Usage: "eos data storage driver",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_DRIVER",
|
||||
Destination: &cfg.Reva.StorageEOSData.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-prefix",
|
||||
Value: "data",
|
||||
Usage: "prefix for the http endpoint, without leading slash",
|
||||
EnvVar: "REVA_STORAGE_EOS_DATA_PREFIX",
|
||||
Destination: &cfg.Reva.StorageEOSData.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-data-temp-folder",
|
||||
Value: "/var/tmp/",
|
||||
Usage: "storage eos data temp folder",
|
||||
EnvVar: "REVA_STORAGE_HOME_DATA_TEMP_FOLDER",
|
||||
Destination: &cfg.Reva.StorageEOSData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage s3
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-oc service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_S3_NETWORK",
|
||||
Destination: &cfg.Reva.StorageS3.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-protocol",
|
||||
Value: "grpc",
|
||||
Usage: "protocol for reva storage-s3 service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_S3_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageS3.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-addr",
|
||||
Value: "0.0.0.0:9166",
|
||||
Usage: "Address to bind reva storage-s3 service",
|
||||
EnvVar: "REVA_STORAGE_S3_ADDR",
|
||||
Destination: &cfg.Reva.StorageS3.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-url",
|
||||
Value: "localhost:9166",
|
||||
Usage: "URL to use for the reva storage-s3 service",
|
||||
EnvVar: "REVA_STORAGE_S3_URL",
|
||||
Destination: &cfg.Reva.StorageS3.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-services",
|
||||
Value: "storageprovider",
|
||||
Usage: "comma separated list of services to include in the storage-s3 service",
|
||||
EnvVar: "REVA_STORAGE_S3_SERVICES",
|
||||
Destination: &cfg.Reva.StorageS3.Services,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-driver",
|
||||
Value: "local",
|
||||
Usage: "s3 storage driver",
|
||||
EnvVar: "REVA_STORAGE_S3_DRIVER",
|
||||
Destination: &cfg.Reva.StorageS3.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-path-wrapper",
|
||||
Value: "",
|
||||
Usage: "s3 storage path wrapper",
|
||||
EnvVar: "REVA_STORAGE_S3_PATH_WRAPPER",
|
||||
Destination: &cfg.Reva.StorageS3.PathWrapper,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-path-wrapper-context-prefix",
|
||||
Value: "",
|
||||
Usage: "s3 storage path wrapper context prefix",
|
||||
EnvVar: "REVA_STORAGE_S3_PATH_WRAPPER_CONTEXT_PREFIX",
|
||||
Destination: &cfg.Reva.StorageS3.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-mount-path",
|
||||
Value: "",
|
||||
Usage: "s3 storage mount path",
|
||||
EnvVar: "REVA_STORAGE_S3_MOUNT_PATH",
|
||||
Destination: &cfg.Reva.StorageS3.MountPath,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-mount-id",
|
||||
Value: "",
|
||||
Usage: "s3 storage mount id",
|
||||
EnvVar: "REVA_STORAGE_S3_MOUNT_ID",
|
||||
Destination: &cfg.Reva.StorageS3.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-s3-expose-data-server",
|
||||
Usage: "s3 storage exposes a dedicated data server",
|
||||
EnvVar: "REVA_STORAGE_S3_EXPOSE_DATA_SERVER",
|
||||
Destination: &cfg.Reva.StorageS3.ExposeDataServer,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-server-url",
|
||||
Value: "",
|
||||
Usage: "s3 storage data server url",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_SERVER_URL",
|
||||
Destination: &cfg.Reva.StorageS3.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage s3 data
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-s3 data service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_NETWORK",
|
||||
Destination: &cfg.Reva.StorageS3Data.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-protocol",
|
||||
Value: "http",
|
||||
Usage: "protocol for reva storage-s3 data service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageS3Data.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-addr",
|
||||
Value: "0.0.0.0:9168",
|
||||
Usage: "Address to bind reva storage-s3 data service",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_ADDR",
|
||||
Destination: &cfg.Reva.StorageS3Data.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-url",
|
||||
Value: "localhost:9168",
|
||||
Usage: "URL to use for the reva storage-s3 data service",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_URL",
|
||||
Destination: &cfg.Reva.StorageS3Data.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-services",
|
||||
Value: "dataprovider",
|
||||
Usage: "comma separated list of services to include in the storage-s3 data service",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_SERVICES",
|
||||
Destination: &cfg.Reva.StorageS3Data.Services,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-driver",
|
||||
Value: "s3",
|
||||
Usage: "s3 data storage driver",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_DRIVER",
|
||||
Destination: &cfg.Reva.StorageS3Data.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-prefix",
|
||||
Value: "data",
|
||||
Usage: "prefix for the http endpoint, without leading slash",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_PREFIX",
|
||||
Destination: &cfg.Reva.StorageS3Data.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-s3-data-temp-folder",
|
||||
Value: "/var/tmp/",
|
||||
Usage: "storage s3 data temp folder",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_TEMP_FOLDER",
|
||||
Destination: &cfg.Reva.StorageS3Data.TempFolder,
|
||||
},
|
||||
|
||||
// Storage custom
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-custom service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_NETWORK",
|
||||
Destination: &cfg.Reva.StorageCustom.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-protocol",
|
||||
Value: "grpc",
|
||||
Usage: "protocol for reva storage-custom service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageCustom.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-addr",
|
||||
Value: "0.0.0.0:9170",
|
||||
Usage: "Address to bind reva storage-custom service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_ADDR",
|
||||
Destination: &cfg.Reva.StorageCustom.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-url",
|
||||
Value: "localhost:9170",
|
||||
Usage: "URL to use for the reva storage-custom service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_URL",
|
||||
Destination: &cfg.Reva.StorageCustom.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-services",
|
||||
Value: "storageprovider",
|
||||
Usage: "comma separated list of services to include in the storage-custom service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_SERVICES",
|
||||
Destination: &cfg.Reva.StorageCustom.Services,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-driver",
|
||||
Value: "local",
|
||||
Usage: "custom storage driver",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DRIVER",
|
||||
Destination: &cfg.Reva.StorageCustom.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-path-wrapper",
|
||||
Value: "",
|
||||
Usage: "custom storage path wrapper",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_PATH_WRAPPER",
|
||||
Destination: &cfg.Reva.StorageCustom.PathWrapper,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-path-wrapper-context-prefix",
|
||||
Value: "",
|
||||
Usage: "custom storage path wrapper context prefix",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_PATH_WRAPPER_CONTEXT_PREFIX",
|
||||
Destination: &cfg.Reva.StorageCustom.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-mount-path",
|
||||
Value: "",
|
||||
Usage: "custom storage mount path",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_MOUNT_PATH",
|
||||
Destination: &cfg.Reva.StorageCustom.MountPath,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-mount-id",
|
||||
Value: "",
|
||||
Usage: "custom storage mount id",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_MOUNT_ID",
|
||||
Destination: &cfg.Reva.StorageCustom.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-custom-expose-data-server",
|
||||
Usage: "custom storage exposes a dedicated data server",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_EXPOSE_DATA_SERVER",
|
||||
Destination: &cfg.Reva.StorageCustom.ExposeDataServer,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-server-url",
|
||||
Value: "",
|
||||
Usage: "custom storage data server url",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_SERVER_URL",
|
||||
Destination: &cfg.Reva.StorageCustom.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage custom data
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva storage-custom data service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_NETWORK",
|
||||
Destination: &cfg.Reva.StorageCustomData.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-protocol",
|
||||
Value: "http",
|
||||
Usage: "protocol for reva storage-custom data service, can be 'http' or 'grpc'",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_PROTOCOL",
|
||||
Destination: &cfg.Reva.StorageCustomData.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-addr",
|
||||
Value: "0.0.0.0:9172",
|
||||
Usage: "Address to bind reva storage-custom data service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_ADDR",
|
||||
Destination: &cfg.Reva.StorageCustomData.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-url",
|
||||
Value: "localhost:9172",
|
||||
Usage: "URL to use for the reva storage-custom data service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_URL",
|
||||
Destination: &cfg.Reva.StorageCustomData.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-services",
|
||||
Value: "dataprovider",
|
||||
Usage: "comma separated list of services to include in the storage-custom data service",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_SERVICES",
|
||||
Destination: &cfg.Reva.StorageCustomData.Services,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-driver",
|
||||
Value: "",
|
||||
Usage: "custom data storage driver",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_DRIVER",
|
||||
Destination: &cfg.Reva.StorageCustomData.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-prefix",
|
||||
Value: "data",
|
||||
Usage: "prefix for the http endpoint, without leading slash",
|
||||
EnvVar: "REVA_STORAGE_S3_DATA_PREFIX",
|
||||
Destination: &cfg.Reva.StorageCustomData.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-custom-data-temp-folder",
|
||||
Value: "/var/tmp/",
|
||||
Usage: "storage custom data temp folder",
|
||||
EnvVar: "REVA_STORAGE_CUSTOM_DATA_TEMP_FOLDER",
|
||||
Destination: &cfg.Reva.StorageCustomData.TempFolder,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "asset-path",
|
||||
Value: "",
|
||||
Usage: "Path to custom assets",
|
||||
EnvVar: "REVA_ASSET_PATH",
|
||||
Destination: &cfg.Asset.Path,
|
||||
},
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,125 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// SharingWithConfig applies cfg to the root flagset
|
||||
func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9151",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Sharing
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Sharing.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9150",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageHomeWithConfig applies cfg to the root flagset
|
||||
func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9155",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage home
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "owncloud",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.StorageHome.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mount-path",
|
||||
Value: "/home",
|
||||
Usage: "mount path",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageHome.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "expose-data-server",
|
||||
Usage: "exposes a dedicated data server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageHome.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
|
||||
// owncloud
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageHomeDataWithConfig applies cfg to the root flagset
|
||||
func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9157",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage home data
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "owncloud",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageHomeData.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "temp-folder",
|
||||
Value: "/var/tmp/",
|
||||
Usage: "temp folder",
|
||||
EnvVar: "REVA_STORAGE_HOME_DATA_TEMP_FOLDER",
|
||||
Destination: &cfg.Reva.StorageHomeData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
|
||||
// owncloud
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageOCWithConfig applies cfg to the root flagset
|
||||
func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9163",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage oc
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "owncloud",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVar: "REVA_STORAGE_OC_DRIVER",
|
||||
Destination: &cfg.Reva.StorageOC.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "path-wrapper",
|
||||
Value: "",
|
||||
Usage: "path wrapper",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageOC.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mount-path",
|
||||
Value: "/oc",
|
||||
Usage: "mount path",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageOC.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "expose-data-server",
|
||||
Usage: "exposes a dedicated data server",
|
||||
EnvVar: "REVA_STORAGE_OC_EXPOSE_DATA_SERVER",
|
||||
Destination: &cfg.Reva.StorageOC.ExposeDataServer,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "data-server-url",
|
||||
Value: "",
|
||||
Usage: "data server url",
|
||||
EnvVar: "REVA_STORAGE_OC_DATA_SERVER_URL",
|
||||
Destination: &cfg.Reva.StorageOC.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
|
||||
// owncloud
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,260 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageOCDataWithConfig applies cfg to the root flagset
|
||||
func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9165",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage oc data
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "owncloud",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageOCData.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "temp-folder",
|
||||
Value: "/var/tmp/",
|
||||
Usage: "temp folder",
|
||||
EnvVar: "REVA_STORAGE_OC_DATA_TEMP_FOLDER",
|
||||
Destination: &cfg.Reva.StorageOCData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
|
||||
// owncloud
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageRootWithConfig applies cfg to the root flagset
|
||||
func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9153",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage root
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "local",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVar: "REVA_STORAGE_ROOT_DRIVER",
|
||||
Destination: &cfg.Reva.StorageRoot.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "path-wrapper",
|
||||
Value: "",
|
||||
Usage: "path wrapper",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageRoot.PathWrapperContext.Prefix,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mount-path",
|
||||
Value: "/",
|
||||
Usage: "mount path",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageRoot.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "expose-data-server",
|
||||
Usage: "exposes a dedicated data server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.StorageRoot.DataServerURL,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVar: "REVA_STORAGE_LOCAL_ROOT",
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
|
||||
// owncloud
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVar: "REVA_STORAGE_OWNCLOUD_DATADIR",
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// UsersWithConfig applies cfg to the root flagset
|
||||
func UsersWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVar: "REVA_TRACING_ENABLED",
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVar: "REVA_TRACING_TYPE",
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVar: "REVA_TRACING_ENDPOINT",
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVar: "REVA_TRACING_COLLECTOR",
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVar: "REVA_TRACING_SERVICE",
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:9145",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVar: "REVA_DEBUG_PPROF",
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVar: "REVA_DEBUG_ZPAGES",
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVar: "REVA_JWT_SECRET",
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// LDAP
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-hostname",
|
||||
Value: "localhost",
|
||||
Usage: "LDAP hostname",
|
||||
EnvVar: "REVA_LDAP_HOSTNAME",
|
||||
Destination: &cfg.Reva.LDAP.Hostname,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ldap-port",
|
||||
Value: 389,
|
||||
Usage: "LDAP port",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.BaseDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-userfilter",
|
||||
Value: "(objectclass=posixAccount)",
|
||||
Usage: "LDAP userfilter",
|
||||
EnvVar: "REVA_LDAP_USERFILTER",
|
||||
Destination: &cfg.Reva.LDAP.UserFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-groupfilter",
|
||||
Value: "(objectclass=posixGroup)",
|
||||
Usage: "LDAP groupfilter",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.BindDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-password",
|
||||
Value: "admin",
|
||||
Usage: "LDAP bind password",
|
||||
EnvVar: "REVA_LDAP_BIND_PASSWORD",
|
||||
Destination: &cfg.Reva.LDAP.BindPassword,
|
||||
},
|
||||
// ldap dn is always the dn
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uid",
|
||||
Value: "uid",
|
||||
Usage: "LDAP schema uid",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.Schema.Mail,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-displayName",
|
||||
Value: "displayName",
|
||||
Usage: "LDAP schema displayName",
|
||||
EnvVar: "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",
|
||||
Destination: &cfg.Reva.LDAP.Schema.CN,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Users
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVar: "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",
|
||||
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",
|
||||
Destination: &cfg.Reva.Users.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9144",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVar: "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,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "demo",
|
||||
Usage: "user driver: 'demo', 'json' or 'ldap'",
|
||||
EnvVar: "REVA_USERS_DRIVER",
|
||||
Destination: &cfg.Reva.Users.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "json-config",
|
||||
Value: "",
|
||||
Usage: "Path to users.json file",
|
||||
EnvVar: "REVA_USERS_JSON",
|
||||
Destination: &cfg.Reva.Users.JSON,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user