mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-18 23:47:05 -04:00
config cleanup
This commit is contained in:
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// 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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,6 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_AUTH_BASIC_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.AuthBasic.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Auth
|
||||
|
||||
@@ -99,87 +35,6 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.AuthProvider.JSON,
|
||||
},
|
||||
|
||||
// LDAP
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-hostname",
|
||||
Value: "localhost",
|
||||
Usage: "LDAP hostname",
|
||||
EnvVars: []string{"REVA_LDAP_HOSTNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Hostname,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ldap-port",
|
||||
Value: 9126,
|
||||
Usage: "LDAP port",
|
||||
EnvVars: []string{"REVA_LDAP_PORT"},
|
||||
Destination: &cfg.Reva.LDAP.Port,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-base-dn",
|
||||
Value: "dc=example,dc=org",
|
||||
Usage: "LDAP basedn",
|
||||
EnvVars: []string{"REVA_LDAP_BASE_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BaseDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-loginfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(cn={{login}})(mail={{login}})))",
|
||||
Usage: "LDAP login filter",
|
||||
EnvVars: []string{"REVA_LDAP_LOGINFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.LoginFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-dn",
|
||||
Value: "cn=reva,ou=sysusers,dc=example,dc=org",
|
||||
Usage: "LDAP bind dn",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BindDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-password",
|
||||
Value: "reva",
|
||||
Usage: "LDAP bind password",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"},
|
||||
Destination: &cfg.Reva.LDAP.BindPassword,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-idp",
|
||||
Value: "https://localhost:9200",
|
||||
Usage: "Identity provider to use for users",
|
||||
EnvVars: []string{"REVA_LDAP_IDP"},
|
||||
Destination: &cfg.Reva.LDAP.IDP,
|
||||
},
|
||||
// ldap dn is always the dn
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uid",
|
||||
Value: "ownclouduuid",
|
||||
Usage: "LDAP schema uid",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_UID"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.UID,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-mail",
|
||||
Value: "mail",
|
||||
Usage: "LDAP schema mail",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.Mail,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-displayName",
|
||||
Value: "displayname",
|
||||
Usage: "LDAP schema displayName",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.DisplayName,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-cn",
|
||||
Value: "cn",
|
||||
Usage: "LDAP schema cn",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_CN"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.CN,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// AuthBasic
|
||||
@@ -219,4 +74,11 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_AUTH_BASIC_SERVICES"},
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, LDAPWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// 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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,6 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_AUTH_BEARER_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.AuthBearer.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// OIDC
|
||||
|
||||
@@ -165,4 +101,10 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_AUTH_BEARER_SERVICES"},
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
31
pkg/flagset/debug.go
Normal file
31
pkg/flagset/debug.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// DebugWithConfig applies common debug config cfg to the flagset
|
||||
func DebugWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
}
|
||||
}
|
||||
133
pkg/flagset/drivereos.go
Normal file
133
pkg/flagset/drivereos.go
Normal file
@@ -0,0 +1,133 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// DriverEOSWithConfig applies cfg to the root flagset
|
||||
func DriverEOSWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "/eos/dockertest/reva",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.Common.Root,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "/Shares",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.Common.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.Common.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.Common.UserLayout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
}
|
||||
}
|
||||
19
pkg/flagset/driverlocal.go
Normal file
19
pkg/flagset/driverlocal.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// DriverLocalWithConfig applies cfg to the root flagset
|
||||
func DriverLocalWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"},
|
||||
Destination: &cfg.Reva.Storages.Local.Root,
|
||||
},
|
||||
}
|
||||
}
|
||||
47
pkg/flagset/driverowncloud.go
Normal file
47
pkg/flagset/driverowncloud.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// DriverOwnCloudWithConfig applies cfg to the root flagset
|
||||
func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-datadir",
|
||||
Value: "/var/tmp/reva/data",
|
||||
Usage: "the path to the owncloud data directory",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.Common.Root,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.Common.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.Common.UserLayout,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// 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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,9 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_FRONTEND_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.Frontend.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "transfer-secret",
|
||||
Value: "replace-me-with-a-transfer-secret",
|
||||
@@ -202,4 +141,10 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.UploadHTTPMethodOverride,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// 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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,9 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_GATEWAY_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.Gateway.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "transfer-secret",
|
||||
Value: "replace-me-with-a-transfer-secret",
|
||||
@@ -229,6 +168,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Sharing.URL,
|
||||
},
|
||||
|
||||
&cli.StringSliceFlag{
|
||||
Name: "storage-registry-rule",
|
||||
Value: cli.NewStringSlice(),
|
||||
Usage: `Replace the generated storage registry rules with this set --storage-registry-rule "/eos=localhost:9158" [--storage-registry-rule "1284d238-aa92-42ce-bdc4-0b0000009162=localhost:9162"]`,
|
||||
EnvVars: []string{"REVA_STORAGE_REGISTRY_RULES"},
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-root-url",
|
||||
Value: "localhost:9152",
|
||||
@@ -266,11 +212,8 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageHome.MountPath,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-home-mount-id",
|
||||
// This is tho mount id of the /oc storage
|
||||
// set it to 1284d238-aa92-42ce-bdc4-0b0000009158 for /eos
|
||||
// Value: "1284d238-aa92-42ce-bdc4-0b0000009162", /os
|
||||
Value: "1284d238-aa92-42ce-bdc4-0b0000009154", // /home
|
||||
Name: "storage-home-mount-id",
|
||||
Value: "1284d238-aa92-42ce-bdc4-0b0000009154",
|
||||
Usage: "mount id",
|
||||
EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_ID"},
|
||||
Destination: &cfg.Reva.StorageHome.MountID,
|
||||
@@ -319,12 +262,27 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"},
|
||||
Destination: &cfg.Reva.StorageOC.MountID,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "public-links-url",
|
||||
Name: "public-link-url",
|
||||
Value: "localhost:10054",
|
||||
Usage: "URL to use for the public links service",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.URL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-public-link-mount-path",
|
||||
Value: "/public/",
|
||||
Usage: "mount path",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.MountPath,
|
||||
},
|
||||
// public-link has no mount id
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
134
pkg/flagset/ldap.go
Normal file
134
pkg/flagset/ldap.go
Normal file
@@ -0,0 +1,134 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// LDAPWithConfig applies LDAP cfg to the flagset
|
||||
func LDAPWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-hostname",
|
||||
Value: "localhost",
|
||||
Usage: "LDAP hostname",
|
||||
EnvVars: []string{"REVA_LDAP_HOSTNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Hostname,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ldap-port",
|
||||
Value: 9126,
|
||||
Usage: "LDAP port",
|
||||
EnvVars: []string{"REVA_LDAP_PORT"},
|
||||
Destination: &cfg.Reva.LDAP.Port,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-base-dn",
|
||||
Value: "dc=example,dc=org",
|
||||
Usage: "LDAP basedn",
|
||||
EnvVars: []string{"REVA_LDAP_BASE_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BaseDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-loginfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(cn={{login}})(mail={{login}})))",
|
||||
Usage: "LDAP login filter",
|
||||
EnvVars: []string{"REVA_LDAP_LOGINFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.LoginFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-userfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(ownclouduuid={{.OpaqueId}})(cn={{.OpaqueId}})))",
|
||||
Usage: "LDAP filter used when getting a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.",
|
||||
EnvVars: []string{"REVA_LDAP_USERFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.UserFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-attributefilter",
|
||||
Value: "(&(objectclass=posixAccount)({{attr}}={{value}}))",
|
||||
Usage: "LDAP filter used when searching for a user by claim/attribute. {{attr}} will be replaced with the attribute, {{value}} with the value.",
|
||||
EnvVars: []string{"REVA_LDAP_ATTRIBUTEFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.AttributeFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-findfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)))",
|
||||
Usage: "LDAP filter used when searching for recipients. {{query}} will be replaced with the search query",
|
||||
EnvVars: []string{"REVA_LDAP_FINDFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.FindFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-groupfilter",
|
||||
// FIXME the reva implementation needs to use the memberof overlay to get the cn when it only has the uuid,
|
||||
// because the ldap schema either uses the dn or the member(of) attributes to establish membership
|
||||
Value: "(&(objectclass=posixGroup)(ownclouduuid={{.OpaqueId}}*))", // This filter will never work
|
||||
Usage: "LDAP filter used when getting the groups of a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.",
|
||||
EnvVars: []string{"REVA_LDAP_GROUPFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.GroupFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-dn",
|
||||
Value: "cn=reva,ou=sysusers,dc=example,dc=org",
|
||||
Usage: "LDAP bind dn",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BindDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-password",
|
||||
Value: "reva",
|
||||
Usage: "LDAP bind password",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"},
|
||||
Destination: &cfg.Reva.LDAP.BindPassword,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-idp",
|
||||
Value: "https://localhost:9200",
|
||||
Usage: "Identity provider to use for users",
|
||||
EnvVars: []string{"REVA_LDAP_IDP"},
|
||||
Destination: &cfg.Reva.LDAP.IDP,
|
||||
},
|
||||
// ldap dn is always the dn
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uid",
|
||||
Value: "ownclouduuid",
|
||||
Usage: "LDAP schema uid",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_UID"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.UID,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-mail",
|
||||
Value: "mail",
|
||||
Usage: "LDAP schema mail",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.Mail,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-displayName",
|
||||
Value: "displayname",
|
||||
Usage: "LDAP schema displayName",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.DisplayName,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-cn",
|
||||
Value: "cn",
|
||||
Usage: "LDAP schema cn",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_CN"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.CN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uidnumber",
|
||||
Value: "uidnumber",
|
||||
Usage: "LDAP schema uidnumber",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_UID_NUMBER"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.UIDNumber,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-gidnumber",
|
||||
Value: "gidnumber",
|
||||
Usage: "LDAP schema gidnumber",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_GIDNUMBER"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.GIDNumber,
|
||||
},
|
||||
}
|
||||
}
|
||||
19
pkg/flagset/secret.go
Normal file
19
pkg/flagset/secret.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// SecretWithConfig applies cfg to the root flagset
|
||||
func SecretWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// SharingWithConfig applies cfg to the root flagset
|
||||
func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,35 +17,6 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.Sharing.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -142,4 +78,10 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Sharing.PublicDriver,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageEOSWithConfig applies cfg to the root flagset
|
||||
func StorageEOSWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,39 +17,8 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageEOS.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Storage oc
|
||||
// Storage eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
@@ -165,176 +97,14 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME_CREATION"},
|
||||
Destination: &cfg.Reva.StorageEOS.EnableHomeCreation,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "/eos/dockertest/reva",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "/Shares",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// StorageEOSDataWithConfig applies cfg to the root flagset
|
||||
func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageEOSData.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -144,177 +78,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageEOSData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "/eos/dockertest/reva",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "/Shares",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -324,5 +87,24 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_GATEWAY_URL"},
|
||||
Destination: &cfg.Reva.Gateway.URL,
|
||||
},
|
||||
|
||||
// User provider
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "users-url",
|
||||
Value: "localhost:9144",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVars: []string{"REVA_USERS_URL"},
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_HOME_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageHome.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -170,178 +104,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageHome.EnableHomeCreation,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "/eos/dockertest/reva/users",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "/Shares",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Value: true,
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: true,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
|
||||
// User provider
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -352,4 +114,13 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_HOME_DATA_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageHomeData.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -144,178 +78,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageHomeData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "/eos/dockertest/reva/users",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "/Shares",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-mgm1.eoscluster.cern.ch:1094",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Value: true,
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: true,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -336,4 +98,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_OC_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageOC.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -166,180 +100,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageOC.EnableHomeCreation,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Value: "",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Value: "",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Value: "",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
|
||||
// User provider
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -350,4 +110,13 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageOCData.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -144,180 +78,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.StorageOCData.TempFolder,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-shadow-namespace",
|
||||
// Defaults to path.Join(c.Namespace, ".shadow")
|
||||
Usage: "Shadow namespace where share references are stored",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShadowNamespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-share-folder",
|
||||
Value: "",
|
||||
Usage: "name of the share folder",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShareFolder,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Value: "",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Value: "",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Value: "",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -338,4 +98,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -7,74 +7,16 @@ import (
|
||||
|
||||
// StoragePublicLink applies cfg to the root flagset
|
||||
func StoragePublicLink(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: "0.0.0.0:10053",
|
||||
Value: "0.0.0.0:9179",
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
@@ -91,74 +33,19 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag {
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "addr",
|
||||
Value: "localhost:10054",
|
||||
Value: "0.0.0.0:9178",
|
||||
Usage: "Address to bind reva service",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ADDR"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.Addr,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service",
|
||||
Value: cli.NewStringSlice("storageprovider"),
|
||||
Usage: "--service storageprovider [--service otherservice]",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_SERVICES"},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9178",
|
||||
Usage: "Address to bind reva service",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.URL,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "public_share_provider_addr",
|
||||
Value: "localhost:9150",
|
||||
Usage: "public share provider service address",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLICLINK_PUBLIC_SHARE_PROVIDER_ADDR"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.PublicShareProviderAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "user_provider_addr",
|
||||
Value: "localhost:9144",
|
||||
Usage: "user provider service address",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLICLINK_USER_PROVIDER_ADDR"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.UserProviderAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage_provider_addr",
|
||||
Value: "localhost:9154",
|
||||
Usage: "storage provider service address",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLICLINK_STORAGE_PROVIDER_ADDR"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.StorageProviderAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "owncloud",
|
||||
Usage: "storage driver, eg. local, eos, owncloud or s3",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DRIVER"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mount-id",
|
||||
Value: "e1a73ede-549b-4226-abdf-40e69ca8230d",
|
||||
Usage: "mount id",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_ID"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.MountID,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "expose-data-server",
|
||||
Value: false,
|
||||
Usage: "exposes a dedicated data server",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.ExposeDataServer,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "data-server-url",
|
||||
Value: "http://localhost:9156/data",
|
||||
Usage: "data server url",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DATA_SERVER_URL"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.DataServerURL,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "enable-home-creation",
|
||||
Value: true,
|
||||
Usage: "if enabled home dirs will be automatically created",
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ENABLE_HOME_CREATION"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.EnableHomeCreation,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mount-path",
|
||||
Value: "/public/",
|
||||
@@ -166,6 +53,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"},
|
||||
Destination: &cfg.Reva.StoragePublicLink.MountPath,
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "gateway-url",
|
||||
Value: "localhost:9142",
|
||||
@@ -174,4 +62,10 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.Gateway.URL,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
@@ -1,50 +1,13 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -54,35 +17,6 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_ROOT_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.StorageRoot.DebugAddr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
},
|
||||
|
||||
// REVA
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
@@ -163,165 +97,14 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"},
|
||||
Destination: &cfg.Reva.StorageHome.EnableHomeCreation,
|
||||
},
|
||||
|
||||
// Storage drivers
|
||||
|
||||
// Eos
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-namespace",
|
||||
Value: "",
|
||||
Usage: "Namespace for metadata operations",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Namespace,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-binary",
|
||||
Value: "/usr/bin/eos",
|
||||
Usage: "Location of the eos binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EosBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-xrdcopy-binary",
|
||||
Value: "/usr/bin/xrdcopy",
|
||||
Usage: "Location of the xrdcopy binary",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-master-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Master EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.MasterURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-slave-url",
|
||||
Value: "root://eos-example.org",
|
||||
Usage: "URL of the Slave EOS MGM",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SlaveURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-cache-directory",
|
||||
Value: os.TempDir(),
|
||||
Usage: "Location on the local fs where to store reads",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"},
|
||||
Destination: &cfg.Reva.Storages.EOS.CacheDirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-logging",
|
||||
Usage: "Enables logging of the commands executed",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableLogging,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-show-hidden-sysfiles",
|
||||
Usage: "show internal EOS files like .sys.v# and .sys.a# files.",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-force-singleuser-mode",
|
||||
Usage: "force connections to EOS to use SingleUsername",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"},
|
||||
Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-use-keytab",
|
||||
Usage: "authenticate requests by using an EOS keytab",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.UseKeytab,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-eos-enable-home",
|
||||
Usage: "enable the creation of home directories",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-sec-protocol",
|
||||
Value: "",
|
||||
Usage: "the xrootd security protocol to use between the server and EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SecProtocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-keytab",
|
||||
Value: "",
|
||||
Usage: "the location of the keytab to use to authenticate to EOS",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Keytab,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-single-username",
|
||||
Value: "",
|
||||
Usage: "the username to use when SingleUserMode is enabled",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"},
|
||||
Destination: &cfg.Reva.Storages.EOS.SingleUsername,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-layout",
|
||||
Value: "{{substr 0 1 .Username}}/{{.Username}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.EOS.Layout,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-eos-gatewaysvc",
|
||||
Value: "localhost:9142",
|
||||
Usage: "URL to use for the reva gateway service",
|
||||
EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"},
|
||||
Destination: &cfg.Reva.Storages.EOS.GatewaySVC,
|
||||
},
|
||||
|
||||
// local
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "storage-local-root",
|
||||
Value: "/var/tmp/reva/root",
|
||||
Usage: "the path to the local storage root",
|
||||
EnvVars: []string{"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",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-scan",
|
||||
Value: true,
|
||||
Usage: "scan files on startup to add fileids",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Scan,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-redis",
|
||||
Value: ":6379",
|
||||
Usage: "the address of the redis server",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Redis,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "storage-owncloud-enable-home",
|
||||
Value: false,
|
||||
Usage: "enable the creation of home storages",
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.EnableHome,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "storage-owncloud-layout",
|
||||
Value: "{{.Id.OpaqueId}}",
|
||||
Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `,
|
||||
EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"},
|
||||
Destination: &cfg.Reva.Storages.OwnCloud.Layout,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, DriverEOSWithConfig(cfg)...)
|
||||
flags = append(flags, DriverLocalWithConfig(cfg)...)
|
||||
flags = append(flags, DriverOwnCloudWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
47
pkg/flagset/tracing.go
Normal file
47
pkg/flagset/tracing.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-reva/pkg/config"
|
||||
)
|
||||
|
||||
// TracingWithConfig applies cfg to the root flagset
|
||||
func TracingWithConfig(cfg *config.Config) []cli.Flag {
|
||||
return []cli.Flag{
|
||||
|
||||
&cli.BoolFlag{
|
||||
Name: "tracing-enabled",
|
||||
Usage: "Enable sending traces",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -7,42 +7,7 @@ import (
|
||||
|
||||
// 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",
|
||||
EnvVars: []string{"REVA_TRACING_ENABLED"},
|
||||
Destination: &cfg.Tracing.Enabled,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-type",
|
||||
Value: "jaeger",
|
||||
Usage: "Tracing backend type",
|
||||
EnvVars: []string{"REVA_TRACING_TYPE"},
|
||||
Destination: &cfg.Tracing.Type,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-endpoint",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the agent",
|
||||
EnvVars: []string{"REVA_TRACING_ENDPOINT"},
|
||||
Destination: &cfg.Tracing.Endpoint,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-collector",
|
||||
Value: "",
|
||||
Usage: "Endpoint for the collector",
|
||||
EnvVars: []string{"REVA_TRACING_COLLECTOR"},
|
||||
Destination: &cfg.Tracing.Collector,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "tracing-service",
|
||||
Value: "reva",
|
||||
Usage: "Service name for tracing",
|
||||
EnvVars: []string{"REVA_TRACING_SERVICE"},
|
||||
Destination: &cfg.Tracing.Service,
|
||||
},
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
@@ -52,153 +17,63 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.Users.DebugAddr,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Users
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "debug-token",
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVars: []string{"REVA_USERS_NETWORK"},
|
||||
Destination: &cfg.Reva.Users.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "protocol",
|
||||
Value: "grpc",
|
||||
Usage: "protocol for reva service, can be 'http' or 'grpc'",
|
||||
EnvVars: []string{"REVA_USERS_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Users.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "addr",
|
||||
Value: "0.0.0.0:9144",
|
||||
Usage: "Address to bind reva service",
|
||||
EnvVars: []string{"REVA_USERS_ADDR"},
|
||||
Destination: &cfg.Reva.Users.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9144",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVars: []string{"REVA_USERS_URL"},
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service",
|
||||
Value: cli.NewStringSlice("userprovider"), // TODO preferences
|
||||
Usage: "--service userprovider [--service otherservice]",
|
||||
EnvVars: []string{"REVA_USERS_SERVICES"},
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "ldap",
|
||||
Usage: "user driver: 'demo', 'json', 'ldap', or 'rest'",
|
||||
EnvVars: []string{"REVA_USERS_DRIVER"},
|
||||
Destination: &cfg.Reva.Users.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "json-config",
|
||||
Value: "",
|
||||
Usage: "Token to grant metrics access",
|
||||
EnvVars: []string{"REVA_DEBUG_TOKEN"},
|
||||
Destination: &cfg.Debug.Token,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-pprof",
|
||||
Usage: "Enable pprof debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_PPROF"},
|
||||
Destination: &cfg.Debug.Pprof,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "debug-zpages",
|
||||
Usage: "Enable zpages debugging",
|
||||
EnvVars: []string{"REVA_DEBUG_ZPAGES"},
|
||||
Destination: &cfg.Debug.Zpages,
|
||||
Usage: "Path to users.json file",
|
||||
EnvVars: []string{"REVA_USERS_JSON"},
|
||||
Destination: &cfg.Reva.Users.JSON,
|
||||
},
|
||||
|
||||
// REVA
|
||||
// rest driver
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "jwt-secret",
|
||||
Value: "Pive-Fumkiu4",
|
||||
Usage: "Shared jwt secret for reva service communication",
|
||||
EnvVars: []string{"REVA_JWT_SECRET"},
|
||||
Destination: &cfg.Reva.JWTSecret,
|
||||
},
|
||||
|
||||
// LDAP
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-hostname",
|
||||
Value: "localhost",
|
||||
Usage: "LDAP hostname",
|
||||
EnvVars: []string{"REVA_LDAP_HOSTNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Hostname,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "ldap-port",
|
||||
Value: 9126,
|
||||
Usage: "LDAP port",
|
||||
EnvVars: []string{"REVA_LDAP_PORT"},
|
||||
Destination: &cfg.Reva.LDAP.Port,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-base-dn",
|
||||
Value: "dc=example,dc=org",
|
||||
Usage: "LDAP basedn",
|
||||
EnvVars: []string{"REVA_LDAP_BASE_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BaseDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-userfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(ownclouduuid={{.OpaqueId}})(cn={{.OpaqueId}})))",
|
||||
Usage: "LDAP filter used when getting a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.",
|
||||
EnvVars: []string{"REVA_LDAP_USERFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.UserFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-attributefilter",
|
||||
Value: "(&(objectclass=posixAccount)({{attr}}={{value}}))",
|
||||
Usage: "LDAP filter used when searching for a user by claim/attribute. {{attr}} will be replaced with the attribute, {{value}} with the value.",
|
||||
EnvVars: []string{"REVA_LDAP_ATTRIBUTEFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.AttributeFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-findfilter",
|
||||
Value: "(&(objectclass=posixAccount)(|(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)))",
|
||||
Usage: "LDAP filter used when searching for recipients. {{query}} will be replaced with the search query",
|
||||
EnvVars: []string{"REVA_LDAP_FINDFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.FindFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-groupfilter",
|
||||
// FIXME the reva implementation needs to use the memberof overlay to get the cn when it only has the uuid,
|
||||
// because the ldap schema either uses the dn or the member(of) attributes to establish membership
|
||||
Value: "(&(objectclass=posixGroup)(ownclouduuid={{.OpaqueId}}*))", // This filter will never work
|
||||
Usage: "LDAP filter used when getting the groups of a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.",
|
||||
EnvVars: []string{"REVA_LDAP_GROUPFILTER"},
|
||||
Destination: &cfg.Reva.LDAP.GroupFilter,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-dn",
|
||||
Value: "cn=reva,ou=sysusers,dc=example,dc=org",
|
||||
Usage: "LDAP bind dn",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_DN"},
|
||||
Destination: &cfg.Reva.LDAP.BindDN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-bind-password",
|
||||
Value: "reva",
|
||||
Usage: "LDAP bind password",
|
||||
EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"},
|
||||
Destination: &cfg.Reva.LDAP.BindPassword,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-idp",
|
||||
Value: "https://localhost:9200",
|
||||
Usage: "Identity provider to use for users",
|
||||
EnvVars: []string{"REVA_LDAP_IDP"},
|
||||
Destination: &cfg.Reva.LDAP.IDP,
|
||||
},
|
||||
// ldap dn is always the dn
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uid",
|
||||
Value: "ownclouduuid",
|
||||
Usage: "LDAP schema uid",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_UID"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.UID,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-mail",
|
||||
Value: "mail",
|
||||
Usage: "LDAP schema mail",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.Mail,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-displayName",
|
||||
Value: "displayname",
|
||||
Usage: "LDAP schema displayName",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.DisplayName,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-cn",
|
||||
Value: "cn",
|
||||
Usage: "LDAP schema cn",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_CN"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.CN,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-uidnumber",
|
||||
Value: "uidnumber",
|
||||
Usage: "LDAP schema uidnumber",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_UID_NUMBER"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.UIDNumber,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ldap-schema-gidnumber",
|
||||
Value: "gidnumber",
|
||||
Usage: "LDAP schema gidnumber",
|
||||
EnvVars: []string{"REVA_LDAP_SCHEMA_GIDNUMBER"},
|
||||
Destination: &cfg.Reva.LDAP.Schema.GIDNumber,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "rest-client-id",
|
||||
Value: "",
|
||||
@@ -269,59 +144,12 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"REVA_REST_TARGET_API"},
|
||||
Destination: &cfg.Reva.UserRest.TargetAPI,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// Users
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: "tcp",
|
||||
Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVars: []string{"REVA_USERS_NETWORK"},
|
||||
Destination: &cfg.Reva.Users.Network,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "protocol",
|
||||
Value: "grpc",
|
||||
Usage: "protocol for reva service, can be 'http' or 'grpc'",
|
||||
EnvVars: []string{"REVA_USERS_PROTOCOL"},
|
||||
Destination: &cfg.Reva.Users.Protocol,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "addr",
|
||||
Value: "0.0.0.0:9144",
|
||||
Usage: "Address to bind reva service",
|
||||
EnvVars: []string{"REVA_USERS_ADDR"},
|
||||
Destination: &cfg.Reva.Users.Addr,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "url",
|
||||
Value: "localhost:9144",
|
||||
Usage: "URL to use for the reva service",
|
||||
EnvVars: []string{"REVA_USERS_URL"},
|
||||
Destination: &cfg.Reva.Users.URL,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service",
|
||||
Value: cli.NewStringSlice("userprovider"), // TODO preferences
|
||||
Usage: "--service userprovider [--service otherservice]",
|
||||
EnvVars: []string{"REVA_USERS_SERVICES"},
|
||||
},
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "driver",
|
||||
Value: "ldap",
|
||||
Usage: "user driver: 'demo', 'json', 'ldap', or 'rest'",
|
||||
EnvVars: []string{"REVA_USERS_DRIVER"},
|
||||
Destination: &cfg.Reva.Users.Driver,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "json-config",
|
||||
Value: "",
|
||||
Usage: "Path to users.json file",
|
||||
EnvVars: []string{"REVA_USERS_JSON"},
|
||||
Destination: &cfg.Reva.Users.JSON,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
flags = append(flags, LDAPWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user