From 97c190e0aadc83205aba9c29a26fd1d8fedd81e7 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 10 Jun 2020 16:38:05 +0200 Subject: [PATCH 01/19] Make sure that the reva frontend url has an url scheme We have a lot of URLs in our flagset default values that don't have an url scheme. In order to be able to make those changes over time we introduced a helper function which appends "http://" as scheme. --- pkg/command/frontend.go | 13 ++++++++++++- pkg/command/gateway.go | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/command/frontend.go b/pkg/command/frontend.go index 1578928..e3e6b54 100644 --- a/pkg/command/frontend.go +++ b/pkg/command/frontend.go @@ -6,6 +6,7 @@ import ( "os" "os/signal" "path" + "strings" "time" "github.com/cs3org/reva/cmd/revad/runtime" @@ -132,7 +133,7 @@ func Frontend(cfg *config.Config) *cli.Command { "config": map[string]interface{}{ "version": "1.8", "website": "reva", - "host": "http://" + cfg.Reva.Frontend.URL, // TODO URLs should include the protocol + "host": urlWithScheme(cfg.Reva.Frontend.URL), "contact": "admin@localhost", "ssl": "false", }, @@ -290,3 +291,13 @@ func Frontend(cfg *config.Config) *cli.Command { }, } } + +// urlWithScheme checks if the given string is prefixed with "http". If it is not, "http://" will be added as prefix. +// As we can't tell if http or https should be the preferred scheme, the correct approach would be to fail on urls +// without scheme. As long as we have default urls in our flagsets which don't have a scheme, this is a feasible workaround. +func urlWithScheme(str string) string { + if !strings.HasPrefix(str, "http") { + str = "http://" + str + } + return str +} diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index d4802dd..e8f6498 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -108,7 +108,7 @@ func Gateway(cfg *config.Config) *cli.Command { "link_grants_file": cfg.Reva.Gateway.LinkGrants, // other "disable_home_creation_on_login": cfg.Reva.Gateway.DisableHomeCreationOnLogin, - "datagateway": cfg.Reva.Frontend.URL, + "datagateway": urlWithScheme(cfg.Reva.Frontend.URL), "transfer_shared_secret": cfg.Reva.TransferSecret, "transfer_expires": cfg.Reva.TransferExpires, }, From 775942387c1796453f7448b15651c14aed5cddaf Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 10 Jun 2020 16:47:43 +0200 Subject: [PATCH 02/19] Change default reva frontend url to point to ocis-proxy --- pkg/flagset/frontend.go | 2 +- pkg/flagset/gateway.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index e0484fb..b4117df 100644 --- a/pkg/flagset/frontend.go +++ b/pkg/flagset/frontend.go @@ -136,7 +136,7 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "url", - Value: "localhost:9140", + Value: "https://localhost:9200", Usage: "URL to use for the reva service", EnvVars: []string{"REVA_FRONTEND_URL"}, Destination: &cfg.Reva.Frontend.URL, diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 87101ff..7a5c23e 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -188,7 +188,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "frontend-url", - Value: "localhost:9140", + Value: "https://localhost:9200", Usage: "URL to use for the reva service", EnvVars: []string{"REVA_FRONTEND_URL"}, Destination: &cfg.Reva.Frontend.URL, From 62e260a6ab42eacc9e9fd2fc8ed59bb6f12c7c2a Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 10 Jun 2020 16:48:07 +0200 Subject: [PATCH 03/19] Change storages to not expose themselves by default. --- pkg/flagset/storageeos.go | 2 +- pkg/flagset/storagehome.go | 2 +- pkg/flagset/storageoc.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index 450765b..e302832 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -146,7 +146,7 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "expose-data-server", - Value: true, + Value: false, Usage: "exposes a dedicated data server", EnvVars: []string{"REVA_STORAGE_EOS_EXPOSE_DATA_SERVER"}, Destination: &cfg.Reva.StorageEOS.ExposeDataServer, diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index aa84c76..4c5cc8d 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -148,7 +148,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "expose-data-server", - Value: true, + Value: false, Usage: "exposes a dedicated data server", EnvVars: []string{"REVA_STORAGE_HOME_EXPOSE_DATA_SERVER"}, Destination: &cfg.Reva.StorageHome.ExposeDataServer, diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 5e45273..62d58bc 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -146,7 +146,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "expose-data-server", - Value: true, + Value: false, Usage: "exposes a dedicated data server", EnvVars: []string{"REVA_STORAGE_OC_EXPOSE_DATA_SERVER"}, Destination: &cfg.Reva.StorageOC.ExposeDataServer, From 5ecd9f4889d019a718f49e11ac41913479f78f4d Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 10 Jun 2020 16:49:08 +0200 Subject: [PATCH 04/19] Update versions --- go.sum | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go.sum b/go.sum index 42b5352..91f5036 100644 --- a/go.sum +++ b/go.sum @@ -83,6 +83,7 @@ github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.31.1 h1:5tv3VtTS/IM1yZ6lxMQQVmH28SkkR3b3w+6u+9rcLx4= github.com/aws/aws-sdk-go v1.31.1/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.31.7 h1:TCA+pXKvzDMA3vVqhK21cCy5GarC8pTQb/DrVOWI3iY= github.com/aws/aws-sdk-go v1.31.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= @@ -649,6 +650,7 @@ github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.0 h1:iDwIio/3gk2QtLLEsqU5lInaMzos0hDTz8a6lazSFVw= github.com/mitchellh/mapstructure v1.3.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.1 h1:cCBH2gTD2K0OtLlv/Y5H01VQCqmlDxz30kS5Y5bqfLA= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= @@ -711,6 +713,7 @@ github.com/ory/fosite v0.29.0/go.mod h1:0atSZmXO7CAcs6NPMI/Qtot8tmZYj04Nddoold4S github.com/ory/fosite v0.31.0/go.mod h1:lSSqjo8Kr/U1P3kJWxsNGHmq7TnH/7pS1ijvQRT7G+g= github.com/ory/fosite v0.31.3 h1:5WjLwfs+yUALZjzKUKGN/M+ddBJ5Ol6NawxuCO2TuAg= github.com/ory/fosite v0.31.3/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= +github.com/ory/fosite v0.32.0 h1:g89HkBt0dgm+HPrbsYZTmyks1NIw0BH/UlEaw84e1ss= github.com/ory/fosite v0.32.0/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= github.com/ory/fosite v0.32.1/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= github.com/ory/fosite v0.32.2/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= From bd85e0bb8de5a7cd04ac97cf446dd3ecccfbc0f0 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Jun 2020 15:50:36 +0200 Subject: [PATCH 05/19] Add new config var for the data gateway url --- pkg/command/gateway.go | 2 +- pkg/config/config.go | 3 ++- pkg/flagset/gateway.go | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index e8f6498..08d8201 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -108,7 +108,7 @@ func Gateway(cfg *config.Config) *cli.Command { "link_grants_file": cfg.Reva.Gateway.LinkGrants, // other "disable_home_creation_on_login": cfg.Reva.Gateway.DisableHomeCreationOnLogin, - "datagateway": urlWithScheme(cfg.Reva.Frontend.URL), + "datagateway": urlWithScheme(cfg.Reva.DataGateway.URL), "transfer_shared_secret": cfg.Reva.TransferSecret, "transfer_expires": cfg.Reva.TransferExpires, }, diff --git a/pkg/config/config.go b/pkg/config/config.go index 66ac115..942b48b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -229,8 +229,9 @@ type Reva struct { LDAP LDAP OCDav OCDav Storages StorageConfig - // Ports are used configure which services to start on which port + // Ports are used to configure which services to start on which port Frontend Port + DataGateway Port Gateway Gateway Users Users AuthBasic Port diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 7a5c23e..73b59be 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -193,6 +193,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_FRONTEND_URL"}, Destination: &cfg.Reva.Frontend.URL, }, + &cli.StringFlag{ + Name: "datagateway-url", + Value: "https://localhost:9200/data", + Usage: "URL to use for the reva datagateway", + EnvVars: []string{"REVA_DATAGATEWAY_URL"}, + Destination: &cfg.Reva.DataGateway.URL, + }, &cli.StringFlag{ Name: "users-url", Value: "localhost:9144", From c1f74450b6192227ae543c8d4f9ca070b14f6bfb Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Jun 2020 22:29:11 +0200 Subject: [PATCH 06/19] Update configuration docs (generated with flaex) --- docs/configuration.md | 1131 +++++++++++++++++++++-------------------- 1 file changed, 567 insertions(+), 564 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index cf2d29e..f2523ec 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,6 +1,6 @@ --- title: "Configuration" -date: "2020-06-05T14:07:06+0200" +date: "2020-06-24T22:26:40+0200" weight: 20 geekdocRepo: https://github.com/owncloud/ocis-reva geekdocEditPath: edit/master/docs @@ -57,11 +57,11 @@ Usage: `ocis-reva [global options] command [command options] [arguments...]` ## Sub Commands -### ocis-reva sharing +### ocis-reva users -Start reva sharing service +Start reva users service -Usage: `ocis-reva sharing [command options] [arguments...]` +Usage: `ocis-reva users [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -79,7 +79,7 @@ Usage: `ocis-reva sharing [command options] [arguments...]` : Service name for tracing. Default: `reva`. --debug-addr | $REVA_SHARING_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9151`. +: Address to bind debug server. Default: `0.0.0.0:9145`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -93,32 +93,62 @@ Usage: `ocis-reva sharing [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_SHARING_NETWORK +--ldap-hostname | $REVA_LDAP_HOSTNAME +: LDAP hostname. Default: `localhost`. + +--ldap-base-dn | $REVA_LDAP_BASE_DN +: LDAP basedn. Default: `dc=example,dc=org`. + +--ldap-userfilter | $REVA_LDAP_USERFILTER +: LDAP userfilter. Default: `(&(objectclass=posixAccount)(cn=%s*))`. + +--ldap-groupfilter | $REVA_LDAP_GROUPFILTER +: LDAP groupfilter. Default: `(&(objectclass=posixGroup)(cn=%s*))`. + +--ldap-bind-dn | $REVA_LDAP_BIND_DN +: LDAP bind dn. Default: `cn=reva,ou=sysusers,dc=example,dc=org`. + +--ldap-bind-password | $REVA_LDAP_BIND_PASSWORD +: LDAP bind password. Default: `reva`. + +--ldap-idp | $REVA_LDAP_IDP +: Identity provider to use for users. Default: `https://localhost:9200`. + +--ldap-schema-uid | $REVA_LDAP_SCHEMA_UID +: LDAP schema uid. Default: `uid`. + +--ldap-schema-mail | $REVA_LDAP_SCHEMA_MAIL +: LDAP schema mail. Default: `mail`. + +--ldap-schema-displayName | $REVA_LDAP_SCHEMA_DISPLAYNAME +: LDAP schema displayName. Default: `sn`. + +--ldap-schema-cn | $REVA_LDAP_SCHEMA_CN +: LDAP schema cn. Default: `cn`. + +--network | $REVA_USERS_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_SHARING_PROTOCOL +--protocol | $REVA_USERS_PROTOCOL : protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_SHARING_ADDR -: Address to bind reva service. Default: `0.0.0.0:9150`. - ---url | $REVA_SHARING_URL -: URL to use for the reva service. Default: `localhost:9150`. +--addr | $REVA_USERS_ADDR +: Address to bind reva service. Default: `0.0.0.0:9144`. ---user-driver | $REVA_SHARING_USER_DRIVER -: driver to use for the UserShareProvider. Default: `json`. +--url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---user-json-file | $REVA_SHARING_USER_JSON_FILE -: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. +--driver | $REVA_USERS_DRIVER +: user driver: 'demo', 'json' or 'ldap'. Default: `ldap`. ---public-driver | $REVA_SHARING_PUBLIC_DRIVER -: driver to use for the PublicShareProvider. Default: `json`. +--json-config | $REVA_USERS_JSON +: Path to users.json file. -### ocis-reva storage-oc +### ocis-reva auth-basic -Start reva storage-oc service +Start reva authprovider for basic auth -Usage: `ocis-reva storage-oc [command options] [arguments...]` +Usage: `ocis-reva auth-basic [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -135,8 +165,8 @@ Usage: `ocis-reva storage-oc [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_OC_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9163`. +--debug-addr | $REVA_AUTH_BASIC_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9147`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -150,104 +180,56 @@ Usage: `ocis-reva storage-oc [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_OC_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_STORAGE_OC_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. - ---addr | $REVA_STORAGE_OC_ADDR -: Address to bind reva service. Default: `0.0.0.0:9162`. - ---url | $REVA_STORAGE_OC_URL -: URL to use for the reva service. Default: `localhost:9162`. - ---driver | $REVA_STORAGE_OC_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. - ---mount-path | $REVA_STORAGE_OC_MOUNT_PATH -: mount path. Default: `/oc`. - ---mount-id | $REVA_STORAGE_OC_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. - ---expose-data-server | $REVA_STORAGE_OC_EXPOSE_DATA_SERVER -: exposes a dedicated data server. Default: `true`. - ---data-server-url | $REVA_STORAGE_OC_DATA_SERVER_URL -: data server url. Default: `http://localhost:9164/data`. - ---enable-home-creation | $REVA_STORAGE_OC_ENABLE_HOME_CREATION -: if enabled home dirs will be automatically created. Default: `false`. - ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. - ---storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE -: Shadow namespace where share references are stored. - ---storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. - ---storage-eos-binary | $REVA_STORAGE_EOS_BINARY -: Location of the eos binary. Default: `/usr/bin/eos`. - ---storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY -: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. - ---storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-example.org`. - ---storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-example.org`. +--users-driver | $REVA_USERS_DRIVER +: user driver: 'demo', 'json' or 'ldap'. Default: `ldap`. ---storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY -: Location on the local fs where to store reads. Default: `os.TempDir()`. +--users-json | $REVA_USERS_JSON +: Path to users.json file. ---storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING -: Enables logging of the commands executed. +--ldap-hostname | $REVA_LDAP_HOSTNAME +: LDAP hostname. Default: `localhost`. ---storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES -: show internal EOS files like .sys.v# and .sys.a# files.. +--ldap-base-dn | $REVA_LDAP_BASE_DN +: LDAP basedn. Default: `dc=example,dc=org`. ---storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE -: force connections to EOS to use SingleUsername. +--ldap-userfilter | $REVA_LDAP_USERFILTER +: LDAP userfilter. Default: `(&(objectclass=posixAccount)(cn=%s))`. ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. +--ldap-groupfilter | $REVA_LDAP_GROUPFILTER +: LDAP groupfilter. Default: `(&(objectclass=posixGroup)(cn=%s))`. ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. +--ldap-bind-dn | $REVA_LDAP_BIND_DN +: LDAP bind dn. Default: `cn=reva,ou=sysusers,dc=example,dc=org`. ---storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL -: the xrootd security protocol to use between the server and EOS. +--ldap-bind-password | $REVA_LDAP_BIND_PASSWORD +: LDAP bind password. Default: `reva`. ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +--ldap-idp | $REVA_LDAP_IDP +: Identity provider to use for users. Default: `https://localhost:9200`. ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +--ldap-schema-uid | $REVA_LDAP_SCHEMA_UID +: LDAP schema uid. Default: `uid`. ---storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT -: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. +--ldap-schema-mail | $REVA_LDAP_SCHEMA_MAIL +: LDAP schema mail. Default: `mail`. ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +--ldap-schema-displayName | $REVA_LDAP_SCHEMA_DISPLAYNAME +: LDAP schema displayName. Default: `sn`. ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. +--ldap-schema-cn | $REVA_LDAP_SCHEMA_CN +: LDAP schema cn. Default: `cn`. ---storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN -: scan files on startup to add fileids. Default: `true`. +--network | $REVA_AUTH_BASIC_NETWORK +: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR -: the address of the redis server. Default: `:6379`. +--protocol | $REVA_AUTH_BASIC_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `false`. +--addr | $REVA_AUTH_BASIC_ADDR +: Address to bind reva service. Default: `0.0.0.0:9146`. ---storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT -: `"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" `. Default: `{{.Username}}`. +--url | $REVA_AUTH_BASIC_URL +: URL to use for the reva service. Default: `localhost:9146`. ### ocis-reva storage-oc-data @@ -378,6 +360,72 @@ Usage: `ocis-reva storage-oc-data [command options] [arguments...]` --gateway-url | $REVA_GATEWAY_URL : URL to use for the reva gateway service. Default: `localhost:9142`. +### ocis-reva frontend + +Start reva frontend service + +Usage: `ocis-reva frontend [command options] [arguments...]` + +--tracing-enabled | $REVA_TRACING_ENABLED +: Enable sending traces. + +--tracing-type | $REVA_TRACING_TYPE +: Tracing backend type. Default: `jaeger`. + +--tracing-endpoint | $REVA_TRACING_ENDPOINT +: Endpoint for the agent. + +--tracing-collector | $REVA_TRACING_COLLECTOR +: Endpoint for the collector. + +--tracing-service | $REVA_TRACING_SERVICE +: Service name for tracing. Default: `reva`. + +--debug-addr | $REVA_FRONTEND_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9141`. + +--debug-token | $REVA_DEBUG_TOKEN +: Token to grant metrics access. + +--debug-pprof | $REVA_DEBUG_PPROF +: Enable pprof debugging. + +--debug-zpages | $REVA_DEBUG_ZPAGES +: Enable zpages debugging. + +--jwt-secret | $REVA_JWT_SECRET +: Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. + +--transfer-secret | $REVA_TRANSFER_SECRET +: Transfer secret for datagateway. Default: `replace-me-with-a-transfer-secret`. + +--webdav-namespace | $WEBDAV_NAMESPACE +: Namespace prefix for the /webdav endpoint. Default: `/home/`. + +--dav-files-namespace | $DAV_FILES_NAMESPACE +: Namespace prefix for the webdav /dav/files endpoint. Default: `/oc/`. + +--network | $REVA_FRONTEND_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_FRONTEND_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. + +--addr | $REVA_FRONTEND_ADDR +: Address to bind reva service. Default: `0.0.0.0:9140`. + +--url | $REVA_FRONTEND_URL +: URL to use for the reva service. Default: `https://localhost:9200`. + +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. + +--upload-disable-tus | $REVA_FRONTEND_UPLOAD_DISABLE_TUS +: Disables TUS upload mechanism. Default: `false`. + +--upload-http-method-override | $REVA_FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE +: Specify an HTTP method (ex: POST) that clients should to use when uploading instead of PATCH. + ### ocis-reva storage-root Start reva storage-root service @@ -507,20 +555,11 @@ Usage: `ocis-reva storage-root [command options] [arguments...]` --storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT : `"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" `. Default: `{{.Username}}`. -### ocis-reva health - -Check health status - -Usage: `ocis-reva health [command options] [arguments...]` - ---debug-addr | $REVA_DEBUG_ADDR -: Address to debug endpoint. Default: `0.0.0.0:9109`. - -### ocis-reva storage-eos +### ocis-reva reva-storage-public-link -Start reva storage-eos service +Start reva storage-public-link service -Usage: `ocis-reva storage-eos [command options] [arguments...]` +Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -537,8 +576,8 @@ Usage: `ocis-reva storage-eos [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_EOS_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9159`. +--debug-addr | $REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:10053`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -552,110 +591,116 @@ Usage: `ocis-reva storage-eos [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_EOS_NETWORK +--network | $REVA_STORAGE_PUBLIC_LINK_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_EOS_PROTOCOL +--protocol | $REVA_STORAGE_PUBLIC_LINK_PROTOCOL : protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_STORAGE_EOS_ADDR -: Address to bind reva service. Default: `0.0.0.0:9158`. +--addr | $REVA_STORAGE_PUBLIC_LINK_ADDR +: Address to bind reva service. Default: `localhost:10054`. ---url | $REVA_STORAGE_EOS_URL -: URL to use for the reva service. Default: `localhost:9158`. +--public_share_provider_addr | $REVA_STORAGE_PUBLICLINK_PUBLIC_SHARE_PROVIDER_ADDR +: public share provider service address. Default: `localhost:9150`. ---driver | $REVA_STORAGE_EOS_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. +--user_provider_addr | $REVA_STORAGE_PUBLICLINK_USER_PROVIDER_ADDR +: user provider service address. Default: `localhost:9144`. ---mount-path | $REVA_STORAGE_EOS_MOUNT_PATH -: mount path. Default: `/eos`. +--storage_provider_addr | $REVA_STORAGE_PUBLICLINK_STORAGE_PROVIDER_ADDR +: storage provider service address. Default: `localhost:9154`. ---mount-id | $REVA_STORAGE_EOS_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009158`. +--driver | $REVA_STORAGE_PUBLIC_LINK_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. ---expose-data-server | $REVA_STORAGE_EOS_EXPOSE_DATA_SERVER +--mount-id | $REVA_STORAGE_PUBLIC_LINK_MOUNT_ID +: mount id. Default: `e1a73ede-549b-4226-abdf-40e69ca8230d`. + +--expose-data-server | $REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER : exposes a dedicated data server. Default: `true`. ---data-server-url | $REVA_STORAGE_EOS_DATA_SERVER_URL -: data server url. Default: `http://localhost:9160/data`. +--data-server-url | $REVA_STORAGE_PUBLIC_LINK_DATA_SERVER_URL +: data server url. Default: `http://localhost:9156/data`. ---enable-home-creation | $REVA_STORAGE_EOS_ENABLE_HOME_CREATION -: if enabled home dirs will be automatically created. Default: `false`. +--enable-home-creation | $REVA_STORAGE_PUBLIC_LINK_ENABLE_HOME_CREATION +: if enabled home dirs will be automatically created. Default: `true`. ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva`. +--mount-path | $REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH +: mount path. Default: `/public/`. ---storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE -: Shadow namespace where share references are stored. +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. ---storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. Default: `/Shares`. +### ocis-reva health ---storage-eos-binary | $REVA_STORAGE_EOS_BINARY -: Location of the eos binary. Default: `/usr/bin/eos`. +Check health status ---storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY -: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. +Usage: `ocis-reva health [command options] [arguments...]` ---storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +--debug-addr | $REVA_DEBUG_ADDR +: Address to debug endpoint. Default: `0.0.0.0:9109`. ---storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +### ocis-reva auth-bearer ---storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY -: Location on the local fs where to store reads. Default: `os.TempDir()`. +Start reva authprovider for bearer auth ---storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING -: Enables logging of the commands executed. +Usage: `ocis-reva auth-bearer [command options] [arguments...]` ---storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES -: show internal EOS files like .sys.v# and .sys.a# files.. +--tracing-enabled | $REVA_TRACING_ENABLED +: Enable sending traces. ---storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE -: force connections to EOS to use SingleUsername. +--tracing-type | $REVA_TRACING_TYPE +: Tracing backend type. Default: `jaeger`. ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. +--tracing-endpoint | $REVA_TRACING_ENDPOINT +: Endpoint for the agent. ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. +--tracing-collector | $REVA_TRACING_COLLECTOR +: Endpoint for the collector. ---storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL -: the xrootd security protocol to use between the server and EOS. +--tracing-service | $REVA_TRACING_SERVICE +: Service name for tracing. Default: `reva`. ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +--debug-addr | $REVA_AUTH_BEARER_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9149`. ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +--debug-token | $REVA_DEBUG_TOKEN +: Token to grant metrics access. ---storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT -: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. +--debug-pprof | $REVA_DEBUG_PPROF +: Enable pprof debugging. ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +--debug-zpages | $REVA_DEBUG_ZPAGES +: Enable zpages debugging. ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. +--jwt-secret | $REVA_JWT_SECRET +: Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN -: scan files on startup to add fileids. Default: `true`. +--oidc-issuer | $REVA_OIDC_ISSUER +: OIDC issuer. Default: `https://localhost:9200`. ---storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR -: the address of the redis server. Default: `:6379`. +--oidc-insecure | $REVA_OIDC_INSECURE +: OIDC allow insecure communication. Default: `true`. ---storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `false`. +--oidc-id-claim | $REVA_OIDC_ID_CLAIM +: OIDC id claim. Default: `preferred_username`. ---storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT -: `"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" `. Default: `{{.Username}}`. +--network | $REVA_AUTH_BEARER_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. -### ocis-reva storage-eos-data +--protocol | $REVA_AUTH_BEARER_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. -Start reva storage-eos-data service +--addr | $REVA_AUTH_BEARER_ADDR +: Address to bind reva service. Default: `0.0.0.0:9148`. -Usage: `ocis-reva storage-eos-data [command options] [arguments...]` +--url | $REVA_AUTH_BEARER_URL +: URL to use for the reva service. Default: `localhost:9148`. + +### ocis-reva storage-home-data + +Start reva storage-home-data service + +Usage: `ocis-reva storage-home-data [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -672,8 +717,8 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_OC_DATA_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9161`. +--debug-addr | $REVA_STORAGE_HOME_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9157`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -687,29 +732,29 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_EOS_DATA_NETWORK +--network | $REVA_STORAGE_HOME_DATA_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_EOS_DATA_PROTOCOL +--protocol | $REVA_STORAGE_HOME_DATA_PROTOCOL : protocol for reva service, can be 'http' or 'grpc'. Default: `http`. ---addr | $REVA_STORAGE_EOS_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9160`. +--addr | $REVA_STORAGE_HOME_DATA_ADDR +: Address to bind reva service. Default: `0.0.0.0:9156`. ---url | $REVA_STORAGE_EOS_DATA_URL -: URL to use for the reva service. Default: `localhost:9160`. +--url | $REVA_STORAGE_HOME_DATA_URL +: URL to use for the reva service. Default: `localhost:9156`. ---driver | $REVA_STORAGE_EOS_DATA_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. +--driver | $REVA_STORAGE_HOME_DATA_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. ---prefix | $REVA_STORAGE_EOS_DATA_PREFIX +--prefix | $REVA_STORAGE_HOME_DATA_PREFIX : prefix for the http endpoint, without leading slash. Default: `data`. ---temp-folder | $REVA_STORAGE_EOS_DATA_TEMP_FOLDER +--temp-folder | $REVA_STORAGE_HOME_DATA_TEMP_FOLDER : temp folder. Default: `/var/tmp/`. --storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva`. +: Namespace for metadata operations. Default: `/eos/dockertest/reva/users`. --storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE : Shadow namespace where share references are stored. @@ -745,7 +790,7 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` : authenticate requests by using an EOS keytab. --storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. +: enable the creation of home directories. Default: `true`. --storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL : the xrootd security protocol to use between the server and EOS. @@ -757,7 +802,7 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` : the username to use when SingleUserMode is enabled. --storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT -: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. +: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. --storage-local-root | $REVA_STORAGE_LOCAL_ROOT : the path to the local storage root. Default: `/var/tmp/reva/root`. @@ -772,7 +817,7 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` : the address of the redis server. Default: `:6379`. --storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `false`. +: enable the creation of home storages. Default: `true`. --storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT : `"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" `. Default: `{{.Username}}`. @@ -780,11 +825,11 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` --gateway-url | $REVA_GATEWAY_URL : URL to use for the reva gateway service. Default: `localhost:9142`. -### ocis-reva storage-home +### ocis-reva gateway -Start reva storage-home service +Start reva gateway -Usage: `ocis-reva storage-home [command options] [arguments...]` +Usage: `ocis-reva gateway [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -801,8 +846,8 @@ Usage: `ocis-reva storage-home [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_HOME_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9155`. +--debug-addr | $REVA_GATEWAY_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9143`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -816,110 +861,98 @@ Usage: `ocis-reva storage-home [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_HOME_NETWORK +--transfer-secret | $REVA_TRANSFER_SECRET +: Transfer secret for datagateway. Default: `replace-me-with-a-transfer-secret`. + +--network | $REVA_GATEWAY_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_HOME_PROTOCOL +--protocol | $REVA_GATEWAY_PROTOCOL : protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_STORAGE_HOME_ADDR -: Address to bind reva service. Default: `0.0.0.0:9154`. +--addr | $REVA_GATEWAY_ADDR +: Address to bind reva service. Default: `0.0.0.0:9142`. ---url | $REVA_STORAGE_HOME_URL -: URL to use for the reva service. Default: `localhost:9154`. +--url | $REVA_GATEWAY_URL +: URL to use for the reva service. Default: `localhost:9142`. ---driver | $REVA_STORAGE_HOME_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. +--commit-share-to-storage-grant | $REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_GRANT +: Commit shares to the share manager. Default: `true`. ---mount-path | $REVA_STORAGE_HOME_MOUNT_PATH -: mount path. Default: `/home`. +--commit-share-to-storage-ref | $REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_REF +: Commit shares to the storage. Default: `true`. ---mount-id | $REVA_STORAGE_HOME_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. +--share-folder | $REVA_GATEWAY_SHARE_FOLDER +: mount shares in this folder of the home storage provider. Default: `Shares`. ---expose-data-server | $REVA_STORAGE_HOME_EXPOSE_DATA_SERVER -: exposes a dedicated data server. Default: `true`. +--link_grants_file | $REVA_GATEWAY_LINK_GRANTS_FILE +: when using a json manager, file to use as json serialized database. Default: `/var/tmp/reva/link_grants.json`. ---data-server-url | $REVA_STORAGE_HOME_DATA_SERVER_URL -: data server url. Default: `http://localhost:9156/data`. +--disable-home-creation-on-login | $REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN +: Disable creation of home folder on login. ---enable-home-creation | $REVA_STORAGE_HOME_ENABLE_HOME_CREATION -: if enabled home dirs will be automatically created. Default: `true`. +--storage-home-provider | $REVA_STORAGE_HOME_PROVIDER +: mount point of the storage provider for user homes in the global namespace. Default: `/home`. ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva/users`. +--frontend-url | $REVA_FRONTEND_URL +: URL to use for the reva service. Default: `https://localhost:9200`. ---storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE -: Shadow namespace where share references are stored. +--datagateway-url | $REVA_DATAGATEWAY_URL +: URL to use for the reva datagateway. Default: `https://localhost:9200/data`. ---storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. Default: `/Shares`. +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---storage-eos-binary | $REVA_STORAGE_EOS_BINARY -: Location of the eos binary. Default: `/usr/bin/eos`. +--auth-basic-url | $REVA_AUTH_BASIC_URL +: URL to use for the reva service. Default: `localhost:9146`. ---storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY -: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. +--auth-bearer-url | $REVA_AUTH_BEARER_URL +: URL to use for the reva service. Default: `localhost:9148`. ---storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. - ---storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. - ---storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY -: Location on the local fs where to store reads. Default: `os.TempDir()`. - ---storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING -: Enables logging of the commands executed. - ---storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES -: show internal EOS files like .sys.v# and .sys.a# files.. - ---storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE -: force connections to EOS to use SingleUsername. +--sharing-url | $REVA_SHARING_URL +: URL to use for the reva service. Default: `localhost:9150`. ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. +--storage-root-url | $REVA_STORAGE_ROOT_URL +: URL to use for the reva service. Default: `localhost:9152`. ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. Default: `true`. +--storage-root-mount-path | $REVA_STORAGE_ROOT_MOUNT_PATH +: mount path. Default: `/`. ---storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL -: the xrootd security protocol to use between the server and EOS. +--storage-root-mount-id | $REVA_STORAGE_ROOT_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009152`. ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +--storage-home-url | $REVA_STORAGE_HOME_URL +: URL to use for the reva service. Default: `localhost:9154`. ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +--storage-home-mount-path | $REVA_STORAGE_HOME_MOUNT_PATH +: mount path. Default: `/home`. ---storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT -: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. +--storage-eos-url | $REVA_STORAGE_EOS_URL +: URL to use for the reva service. Default: `localhost:9158`. ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +--storage-eos-mount-path | $REVA_STORAGE_EOS_MOUNT_PATH +: mount path. Default: `/eos`. ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. +--storage-eos-mount-id | $REVA_STORAGE_EOS_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009158`. ---storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN -: scan files on startup to add fileids. Default: `true`. +--storage-oc-url | $REVA_STORAGE_OC_URL +: URL to use for the reva service. Default: `localhost:9162`. ---storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR -: the address of the redis server. Default: `:6379`. +--storage-oc-mount-path | $REVA_STORAGE_OC_MOUNT_PATH +: mount path. Default: `/oc`. ---storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `true`. +--storage-oc-mount-id | $REVA_STORAGE_OC_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. ---storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT -: `"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" `. Default: `{{.Username}}`. +--public-links-url | $REVA_STORAGE_PUBLIC_LINK_URL +: URL to use for the public links service. Default: `localhost:10054`. -### ocis-reva reva-storage-public-link +### ocis-reva storage-home -Start reva storage-public-link service +Start reva storage-home service -Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` +Usage: `ocis-reva storage-home [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -936,8 +969,8 @@ Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:10053`. +--debug-addr | $REVA_STORAGE_HOME_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9155`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -951,137 +984,110 @@ Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_PUBLIC_LINK_NETWORK +--network | $REVA_STORAGE_HOME_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_PUBLIC_LINK_PROTOCOL +--protocol | $REVA_STORAGE_HOME_PROTOCOL : protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_STORAGE_PUBLIC_LINK_ADDR -: Address to bind reva service. Default: `localhost:10054`. - ---public_share_provider_addr | $REVA_STORAGE_PUBLICLINK_PUBLIC_SHARE_PROVIDER_ADDR -: public share provider service address. Default: `localhost:9150`. - ---user_provider_addr | $REVA_STORAGE_PUBLICLINK_USER_PROVIDER_ADDR -: user provider service address. Default: `localhost:9144`. +--addr | $REVA_STORAGE_HOME_ADDR +: Address to bind reva service. Default: `0.0.0.0:9154`. ---storage_provider_addr | $REVA_STORAGE_PUBLICLINK_STORAGE_PROVIDER_ADDR -: storage provider service address. Default: `localhost:9154`. +--url | $REVA_STORAGE_HOME_URL +: URL to use for the reva service. Default: `localhost:9154`. ---driver | $REVA_STORAGE_PUBLIC_LINK_DRIVER +--driver | $REVA_STORAGE_HOME_DRIVER : storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. ---mount-id | $REVA_STORAGE_PUBLIC_LINK_MOUNT_ID -: mount id. Default: `e1a73ede-549b-4226-abdf-40e69ca8230d`. +--mount-path | $REVA_STORAGE_HOME_MOUNT_PATH +: mount path. Default: `/home`. ---expose-data-server | $REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER -: exposes a dedicated data server. Default: `true`. +--mount-id | $REVA_STORAGE_HOME_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. ---data-server-url | $REVA_STORAGE_PUBLIC_LINK_DATA_SERVER_URL +--expose-data-server | $REVA_STORAGE_HOME_EXPOSE_DATA_SERVER +: exposes a dedicated data server. Default: `false`. + +--data-server-url | $REVA_STORAGE_HOME_DATA_SERVER_URL : data server url. Default: `http://localhost:9156/data`. ---enable-home-creation | $REVA_STORAGE_PUBLIC_LINK_ENABLE_HOME_CREATION +--enable-home-creation | $REVA_STORAGE_HOME_ENABLE_HOME_CREATION : if enabled home dirs will be automatically created. Default: `true`. ---mount-path | $REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH -: mount path. Default: `/public/`. - ---gateway-url | $REVA_GATEWAY_URL -: URL to use for the reva gateway service. Default: `localhost:9142`. - -### ocis-reva users - -Start reva users service - -Usage: `ocis-reva users [command options] [arguments...]` - ---tracing-enabled | $REVA_TRACING_ENABLED -: Enable sending traces. - ---tracing-type | $REVA_TRACING_TYPE -: Tracing backend type. Default: `jaeger`. - ---tracing-endpoint | $REVA_TRACING_ENDPOINT -: Endpoint for the agent. - ---tracing-collector | $REVA_TRACING_COLLECTOR -: Endpoint for the collector. - ---tracing-service | $REVA_TRACING_SERVICE -: Service name for tracing. Default: `reva`. +--storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE +: Namespace for metadata operations. Default: `/eos/dockertest/reva/users`. ---debug-addr | $REVA_SHARING_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9145`. +--storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE +: Shadow namespace where share references are stored. ---debug-token | $REVA_DEBUG_TOKEN -: Token to grant metrics access. +--storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER +: name of the share folder. Default: `/Shares`. ---debug-pprof | $REVA_DEBUG_PPROF -: Enable pprof debugging. +--storage-eos-binary | $REVA_STORAGE_EOS_BINARY +: Location of the eos binary. Default: `/usr/bin/eos`. ---debug-zpages | $REVA_DEBUG_ZPAGES -: Enable zpages debugging. +--storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY +: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. ---jwt-secret | $REVA_JWT_SECRET -: Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. +--storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL +: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---ldap-hostname | $REVA_LDAP_HOSTNAME -: LDAP hostname. Default: `localhost`. +--storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL +: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---ldap-base-dn | $REVA_LDAP_BASE_DN -: LDAP basedn. Default: `dc=example,dc=org`. +--storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY +: Location on the local fs where to store reads. Default: `os.TempDir()`. ---ldap-userfilter | $REVA_LDAP_USERFILTER -: LDAP userfilter. Default: `(&(objectclass=posixAccount)(cn=%s*))`. +--storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING +: Enables logging of the commands executed. ---ldap-groupfilter | $REVA_LDAP_GROUPFILTER -: LDAP groupfilter. Default: `(&(objectclass=posixGroup)(cn=%s*))`. +--storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES +: show internal EOS files like .sys.v# and .sys.a# files.. ---ldap-bind-dn | $REVA_LDAP_BIND_DN -: LDAP bind dn. Default: `cn=reva,ou=sysusers,dc=example,dc=org`. +--storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE +: force connections to EOS to use SingleUsername. ---ldap-bind-password | $REVA_LDAP_BIND_PASSWORD -: LDAP bind password. Default: `reva`. +--storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB +: authenticate requests by using an EOS keytab. ---ldap-idp | $REVA_LDAP_IDP -: Identity provider to use for users. Default: `https://localhost:9200`. +--storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME +: enable the creation of home directories. Default: `true`. ---ldap-schema-uid | $REVA_LDAP_SCHEMA_UID -: LDAP schema uid. Default: `uid`. +--storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL +: the xrootd security protocol to use between the server and EOS. ---ldap-schema-mail | $REVA_LDAP_SCHEMA_MAIL -: LDAP schema mail. Default: `mail`. +--storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB +: the location of the keytab to use to authenticate to EOS. ---ldap-schema-displayName | $REVA_LDAP_SCHEMA_DISPLAYNAME -: LDAP schema displayName. Default: `sn`. +--storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME +: the username to use when SingleUserMode is enabled. ---ldap-schema-cn | $REVA_LDAP_SCHEMA_CN -: LDAP schema cn. Default: `cn`. +--storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT +: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. ---network | $REVA_USERS_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. +--storage-local-root | $REVA_STORAGE_LOCAL_ROOT +: the path to the local storage root. Default: `/var/tmp/reva/root`. ---protocol | $REVA_USERS_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. +--storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR +: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. ---addr | $REVA_USERS_ADDR -: Address to bind reva service. Default: `0.0.0.0:9144`. +--storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN +: scan files on startup to add fileids. Default: `true`. ---url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. +--storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR +: the address of the redis server. Default: `:6379`. ---driver | $REVA_USERS_DRIVER -: user driver: 'demo', 'json' or 'ldap'. Default: `ldap`. +--storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME +: enable the creation of home storages. Default: `true`. ---json-config | $REVA_USERS_JSON -: Path to users.json file. +--storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT +: `"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" `. Default: `{{.Username}}`. -### ocis-reva gateway +### ocis-reva storage-eos-data -Start reva gateway +Start reva storage-eos-data service -Usage: `ocis-reva gateway [command options] [arguments...]` +Usage: `ocis-reva storage-eos-data [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -1098,8 +1104,8 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_GATEWAY_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9143`. +--debug-addr | $REVA_STORAGE_OC_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9161`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -1113,95 +1119,104 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---transfer-secret | $REVA_TRANSFER_SECRET -: Transfer secret for datagateway. Default: `replace-me-with-a-transfer-secret`. - ---network | $REVA_GATEWAY_NETWORK +--network | $REVA_STORAGE_EOS_DATA_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_GATEWAY_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. +--protocol | $REVA_STORAGE_EOS_DATA_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. ---addr | $REVA_GATEWAY_ADDR -: Address to bind reva service. Default: `0.0.0.0:9142`. +--addr | $REVA_STORAGE_EOS_DATA_ADDR +: Address to bind reva service. Default: `0.0.0.0:9160`. ---url | $REVA_GATEWAY_URL -: URL to use for the reva service. Default: `localhost:9142`. +--url | $REVA_STORAGE_EOS_DATA_URL +: URL to use for the reva service. Default: `localhost:9160`. ---commit-share-to-storage-grant | $REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_GRANT -: Commit shares to the share manager. Default: `true`. +--driver | $REVA_STORAGE_EOS_DATA_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. ---commit-share-to-storage-ref | $REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_REF -: Commit shares to the storage. Default: `true`. +--prefix | $REVA_STORAGE_EOS_DATA_PREFIX +: prefix for the http endpoint, without leading slash. Default: `data`. ---share-folder | $REVA_GATEWAY_SHARE_FOLDER -: mount shares in this folder of the home storage provider. Default: `Shares`. +--temp-folder | $REVA_STORAGE_EOS_DATA_TEMP_FOLDER +: temp folder. Default: `/var/tmp/`. ---link_grants_file | $REVA_GATEWAY_LINK_GRANTS_FILE -: when using a json manager, file to use as json serialized database. Default: `/var/tmp/reva/link_grants.json`. +--storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE +: Namespace for metadata operations. Default: `/eos/dockertest/reva`. ---disable-home-creation-on-login | $REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN -: Disable creation of home folder on login. +--storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE +: Shadow namespace where share references are stored. ---storage-home-provider | $REVA_STORAGE_HOME_PROVIDER -: mount point of the storage provider for user homes in the global namespace. Default: `/home`. +--storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER +: name of the share folder. Default: `/Shares`. ---frontend-url | $REVA_FRONTEND_URL -: URL to use for the reva service. Default: `localhost:9140`. +--storage-eos-binary | $REVA_STORAGE_EOS_BINARY +: Location of the eos binary. Default: `/usr/bin/eos`. ---users-url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. +--storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY +: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. ---auth-basic-url | $REVA_AUTH_BASIC_URL -: URL to use for the reva service. Default: `localhost:9146`. +--storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL +: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---auth-bearer-url | $REVA_AUTH_BEARER_URL -: URL to use for the reva service. Default: `localhost:9148`. +--storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL +: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---sharing-url | $REVA_SHARING_URL -: URL to use for the reva service. Default: `localhost:9150`. +--storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY +: Location on the local fs where to store reads. Default: `os.TempDir()`. ---storage-root-url | $REVA_STORAGE_ROOT_URL -: URL to use for the reva service. Default: `localhost:9152`. +--storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING +: Enables logging of the commands executed. ---storage-root-mount-path | $REVA_STORAGE_ROOT_MOUNT_PATH -: mount path. Default: `/`. +--storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES +: show internal EOS files like .sys.v# and .sys.a# files.. ---storage-root-mount-id | $REVA_STORAGE_ROOT_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009152`. +--storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE +: force connections to EOS to use SingleUsername. ---storage-home-url | $REVA_STORAGE_HOME_URL -: URL to use for the reva service. Default: `localhost:9154`. +--storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB +: authenticate requests by using an EOS keytab. ---storage-home-mount-path | $REVA_STORAGE_HOME_MOUNT_PATH -: mount path. Default: `/home`. +--storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME +: enable the creation of home directories. ---storage-eos-url | $REVA_STORAGE_EOS_URL -: URL to use for the reva service. Default: `localhost:9158`. +--storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL +: the xrootd security protocol to use between the server and EOS. ---storage-eos-mount-path | $REVA_STORAGE_EOS_MOUNT_PATH -: mount path. Default: `/eos`. +--storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB +: the location of the keytab to use to authenticate to EOS. ---storage-eos-mount-id | $REVA_STORAGE_EOS_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009158`. +--storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME +: the username to use when SingleUserMode is enabled. ---storage-oc-url | $REVA_STORAGE_OC_URL -: URL to use for the reva service. Default: `localhost:9162`. +--storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT +: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. ---storage-oc-mount-path | $REVA_STORAGE_OC_MOUNT_PATH -: mount path. Default: `/oc`. +--storage-local-root | $REVA_STORAGE_LOCAL_ROOT +: the path to the local storage root. Default: `/var/tmp/reva/root`. ---storage-oc-mount-id | $REVA_STORAGE_OC_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. +--storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR +: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. ---public-links-url | $REVA_STORAGE_PUBLIC_LINK_URL -: URL to use for the public links service. Default: `localhost:10054`. +--storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN +: scan files on startup to add fileids. Default: `true`. + +--storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR +: the address of the redis server. Default: `:6379`. + +--storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME +: enable the creation of home storages. Default: `false`. + +--storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT +: `"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" `. Default: `{{.Username}}`. -### ocis-reva frontend +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. -Start reva frontend service +### ocis-reva sharing -Usage: `ocis-reva frontend [command options] [arguments...]` +Start reva sharing service + +Usage: `ocis-reva sharing [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -1218,8 +1233,8 @@ Usage: `ocis-reva frontend [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_FRONTEND_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9141`. +--debug-addr | $REVA_SHARING_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9151`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -1233,41 +1248,32 @@ Usage: `ocis-reva frontend [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---transfer-secret | $REVA_TRANSFER_SECRET -: Transfer secret for datagateway. Default: `replace-me-with-a-transfer-secret`. - ---webdav-namespace | $WEBDAV_NAMESPACE -: Namespace prefix for the /webdav endpoint. Default: `/home/`. - ---dav-files-namespace | $DAV_FILES_NAMESPACE -: Namespace prefix for the webdav /dav/files endpoint. Default: `/oc/`. - ---network | $REVA_FRONTEND_NETWORK +--network | $REVA_SHARING_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_FRONTEND_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. +--protocol | $REVA_SHARING_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_FRONTEND_ADDR -: Address to bind reva service. Default: `0.0.0.0:9140`. +--addr | $REVA_SHARING_ADDR +: Address to bind reva service. Default: `0.0.0.0:9150`. ---url | $REVA_FRONTEND_URL -: URL to use for the reva service. Default: `localhost:9140`. +--url | $REVA_SHARING_URL +: URL to use for the reva service. Default: `localhost:9150`. ---gateway-url | $REVA_GATEWAY_URL -: URL to use for the reva gateway service. Default: `localhost:9142`. +--user-driver | $REVA_SHARING_USER_DRIVER +: driver to use for the UserShareProvider. Default: `json`. ---upload-disable-tus | $REVA_FRONTEND_UPLOAD_DISABLE_TUS -: Disables TUS upload mechanism. Default: `false`. +--user-json-file | $REVA_SHARING_USER_JSON_FILE +: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. ---upload-http-method-override | $REVA_FRONTEND_UPLOAD_HTTP_METHOD_OVERRIDE -: Specify an HTTP method (ex: POST) that clients should to use when uploading instead of PATCH. +--public-driver | $REVA_SHARING_PUBLIC_DRIVER +: driver to use for the PublicShareProvider. Default: `json`. -### ocis-reva auth-basic +### ocis-reva storage-eos -Start reva authprovider for basic auth +Start reva storage-eos service -Usage: `ocis-reva auth-basic [command options] [arguments...]` +Usage: `ocis-reva storage-eos [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -1284,8 +1290,8 @@ Usage: `ocis-reva auth-basic [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_AUTH_BASIC_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9147`. +--debug-addr | $REVA_STORAGE_EOS_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9159`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -1299,119 +1305,110 @@ Usage: `ocis-reva auth-basic [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---users-driver | $REVA_USERS_DRIVER -: user driver: 'demo', 'json' or 'ldap'. Default: `ldap`. - ---users-json | $REVA_USERS_JSON -: Path to users.json file. - ---ldap-hostname | $REVA_LDAP_HOSTNAME -: LDAP hostname. Default: `localhost`. - ---ldap-base-dn | $REVA_LDAP_BASE_DN -: LDAP basedn. Default: `dc=example,dc=org`. - ---ldap-userfilter | $REVA_LDAP_USERFILTER -: LDAP userfilter. Default: `(&(objectclass=posixAccount)(cn=%s))`. +--network | $REVA_STORAGE_EOS_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---ldap-groupfilter | $REVA_LDAP_GROUPFILTER -: LDAP groupfilter. Default: `(&(objectclass=posixGroup)(cn=%s))`. +--protocol | $REVA_STORAGE_EOS_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---ldap-bind-dn | $REVA_LDAP_BIND_DN -: LDAP bind dn. Default: `cn=reva,ou=sysusers,dc=example,dc=org`. +--addr | $REVA_STORAGE_EOS_ADDR +: Address to bind reva service. Default: `0.0.0.0:9158`. ---ldap-bind-password | $REVA_LDAP_BIND_PASSWORD -: LDAP bind password. Default: `reva`. +--url | $REVA_STORAGE_EOS_URL +: URL to use for the reva service. Default: `localhost:9158`. ---ldap-idp | $REVA_LDAP_IDP -: Identity provider to use for users. Default: `https://localhost:9200`. +--driver | $REVA_STORAGE_EOS_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. ---ldap-schema-uid | $REVA_LDAP_SCHEMA_UID -: LDAP schema uid. Default: `uid`. +--mount-path | $REVA_STORAGE_EOS_MOUNT_PATH +: mount path. Default: `/eos`. ---ldap-schema-mail | $REVA_LDAP_SCHEMA_MAIL -: LDAP schema mail. Default: `mail`. +--mount-id | $REVA_STORAGE_EOS_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009158`. ---ldap-schema-displayName | $REVA_LDAP_SCHEMA_DISPLAYNAME -: LDAP schema displayName. Default: `sn`. +--expose-data-server | $REVA_STORAGE_EOS_EXPOSE_DATA_SERVER +: exposes a dedicated data server. Default: `false`. ---ldap-schema-cn | $REVA_LDAP_SCHEMA_CN -: LDAP schema cn. Default: `cn`. +--data-server-url | $REVA_STORAGE_EOS_DATA_SERVER_URL +: data server url. Default: `http://localhost:9160/data`. ---network | $REVA_AUTH_BASIC_NETWORK -: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. +--enable-home-creation | $REVA_STORAGE_EOS_ENABLE_HOME_CREATION +: if enabled home dirs will be automatically created. Default: `false`. ---protocol | $REVA_AUTH_BASIC_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. +--storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE +: Namespace for metadata operations. Default: `/eos/dockertest/reva`. ---addr | $REVA_AUTH_BASIC_ADDR -: Address to bind reva service. Default: `0.0.0.0:9146`. +--storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE +: Shadow namespace where share references are stored. ---url | $REVA_AUTH_BASIC_URL -: URL to use for the reva service. Default: `localhost:9146`. +--storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER +: name of the share folder. Default: `/Shares`. -### ocis-reva auth-bearer +--storage-eos-binary | $REVA_STORAGE_EOS_BINARY +: Location of the eos binary. Default: `/usr/bin/eos`. -Start reva authprovider for bearer auth +--storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY +: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. -Usage: `ocis-reva auth-bearer [command options] [arguments...]` +--storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL +: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---tracing-enabled | $REVA_TRACING_ENABLED -: Enable sending traces. +--storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL +: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. ---tracing-type | $REVA_TRACING_TYPE -: Tracing backend type. Default: `jaeger`. +--storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY +: Location on the local fs where to store reads. Default: `os.TempDir()`. ---tracing-endpoint | $REVA_TRACING_ENDPOINT -: Endpoint for the agent. +--storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING +: Enables logging of the commands executed. ---tracing-collector | $REVA_TRACING_COLLECTOR -: Endpoint for the collector. +--storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES +: show internal EOS files like .sys.v# and .sys.a# files.. ---tracing-service | $REVA_TRACING_SERVICE -: Service name for tracing. Default: `reva`. +--storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE +: force connections to EOS to use SingleUsername. ---debug-addr | $REVA_AUTH_BEARER_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9149`. +--storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB +: authenticate requests by using an EOS keytab. ---debug-token | $REVA_DEBUG_TOKEN -: Token to grant metrics access. +--storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME +: enable the creation of home directories. ---debug-pprof | $REVA_DEBUG_PPROF -: Enable pprof debugging. +--storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL +: the xrootd security protocol to use between the server and EOS. ---debug-zpages | $REVA_DEBUG_ZPAGES -: Enable zpages debugging. +--storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB +: the location of the keytab to use to authenticate to EOS. ---jwt-secret | $REVA_JWT_SECRET -: Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. +--storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME +: the username to use when SingleUserMode is enabled. ---oidc-issuer | $REVA_OIDC_ISSUER -: OIDC issuer. Default: `https://localhost:9200`. +--storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT +: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. ---oidc-insecure | $REVA_OIDC_INSECURE -: OIDC allow insecure communication. Default: `true`. +--storage-local-root | $REVA_STORAGE_LOCAL_ROOT +: the path to the local storage root. Default: `/var/tmp/reva/root`. ---oidc-id-claim | $REVA_OIDC_ID_CLAIM -: OIDC id claim. Default: `preferred_username`. +--storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR +: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. ---network | $REVA_AUTH_BEARER_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. +--storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN +: scan files on startup to add fileids. Default: `true`. ---protocol | $REVA_AUTH_BEARER_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. +--storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR +: the address of the redis server. Default: `:6379`. ---addr | $REVA_AUTH_BEARER_ADDR -: Address to bind reva service. Default: `0.0.0.0:9148`. +--storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME +: enable the creation of home storages. Default: `false`. ---url | $REVA_AUTH_BEARER_URL -: URL to use for the reva service. Default: `localhost:9148`. +--storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT +: `"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" `. Default: `{{.Username}}`. -### ocis-reva storage-home-data +### ocis-reva storage-oc -Start reva storage-home-data service +Start reva storage-oc service -Usage: `ocis-reva storage-home-data [command options] [arguments...]` +Usage: `ocis-reva storage-oc [command options] [arguments...]` --tracing-enabled | $REVA_TRACING_ENABLED : Enable sending traces. @@ -1428,8 +1425,8 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` --tracing-service | $REVA_TRACING_SERVICE : Service name for tracing. Default: `reva`. ---debug-addr | $REVA_STORAGE_HOME_DATA_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9157`. +--debug-addr | $REVA_STORAGE_OC_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9163`. --debug-token | $REVA_DEBUG_TOKEN : Token to grant metrics access. @@ -1443,35 +1440,44 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` --jwt-secret | $REVA_JWT_SECRET : Shared jwt secret for reva service communication. Default: `Pive-Fumkiu4`. ---network | $REVA_STORAGE_HOME_DATA_NETWORK +--network | $REVA_STORAGE_OC_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_HOME_DATA_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. +--protocol | $REVA_STORAGE_OC_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_STORAGE_HOME_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9156`. +--addr | $REVA_STORAGE_OC_ADDR +: Address to bind reva service. Default: `0.0.0.0:9162`. ---url | $REVA_STORAGE_HOME_DATA_URL -: URL to use for the reva service. Default: `localhost:9156`. +--url | $REVA_STORAGE_OC_URL +: URL to use for the reva service. Default: `localhost:9162`. ---driver | $REVA_STORAGE_HOME_DATA_DRIVER +--driver | $REVA_STORAGE_OC_DRIVER : storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. ---prefix | $REVA_STORAGE_HOME_DATA_PREFIX -: prefix for the http endpoint, without leading slash. Default: `data`. +--mount-path | $REVA_STORAGE_OC_MOUNT_PATH +: mount path. Default: `/oc`. ---temp-folder | $REVA_STORAGE_HOME_DATA_TEMP_FOLDER -: temp folder. Default: `/var/tmp/`. +--mount-id | $REVA_STORAGE_OC_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. + +--expose-data-server | $REVA_STORAGE_OC_EXPOSE_DATA_SERVER +: exposes a dedicated data server. Default: `false`. + +--data-server-url | $REVA_STORAGE_OC_DATA_SERVER_URL +: data server url. Default: `http://localhost:9164/data`. + +--enable-home-creation | $REVA_STORAGE_OC_ENABLE_HOME_CREATION +: if enabled home dirs will be automatically created. Default: `false`. --storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva/users`. +: Namespace for metadata operations. --storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE : Shadow namespace where share references are stored. --storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. Default: `/Shares`. +: name of the share folder. --storage-eos-binary | $REVA_STORAGE_EOS_BINARY : Location of the eos binary. Default: `/usr/bin/eos`. @@ -1480,10 +1486,10 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` : Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. --storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +: URL of the Master EOS MGM. Default: `root://eos-example.org`. --storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +: URL of the Slave EOS MGM. Default: `root://eos-example.org`. --storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY : Location on the local fs where to store reads. Default: `os.TempDir()`. @@ -1501,7 +1507,7 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` : authenticate requests by using an EOS keytab. --storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. Default: `true`. +: enable the creation of home directories. --storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL : the xrootd security protocol to use between the server and EOS. @@ -1513,7 +1519,7 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` : the username to use when SingleUserMode is enabled. --storage-eos-layout | $REVA_STORAGE_EOS_LAYOUT -: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. +: `"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" `. Default: `{{substr 0 1 .Username}}/{{.Username}}`. --storage-local-root | $REVA_STORAGE_LOCAL_ROOT : the path to the local storage root. Default: `/var/tmp/reva/root`. @@ -1528,11 +1534,8 @@ Usage: `ocis-reva storage-home-data [command options] [arguments...]` : the address of the redis server. Default: `:6379`. --storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `true`. +: enable the creation of home storages. Default: `false`. --storage-owncloud-layout | $REVA_STORAGE_OWNCLOUD_LAYOUT : `"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" `. Default: `{{.Username}}`. ---gateway-url | $REVA_GATEWAY_URL -: URL to use for the reva gateway service. Default: `localhost:9142`. - From f8d5eb62fb13eafa6aa905cc61950ec869d4c892 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 25 Jun 2020 11:48:36 +0200 Subject: [PATCH 07/19] Disable exposing data server for public links storage by default --- pkg/flagset/storagepubliclink.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/flagset/storagepubliclink.go b/pkg/flagset/storagepubliclink.go index 27837cc..a665d95 100644 --- a/pkg/flagset/storagepubliclink.go +++ b/pkg/flagset/storagepubliclink.go @@ -140,7 +140,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "expose-data-server", - Value: true, + Value: false, Usage: "exposes a dedicated data server", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER"}, Destination: &cfg.Reva.StoragePublicLink.ExposeDataServer, From 4b8b431c8c9aa6d5b25bd81d1f45472d5030d190 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 25 Jun 2020 13:45:21 +0200 Subject: [PATCH 08/19] Update to reva v0.1.1-0.20200625112940-6a2822cb3f15 --- go.mod | 2 +- go.sum | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9007179..9668da5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/owncloud/ocis-reva go 1.13 require ( - github.com/cs3org/reva v0.1.1-0.20200624063447-db5e6635d5f0 + github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15 github.com/gofrs/uuid v3.3.0+incompatible github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 // indirect diff --git a/go.sum b/go.sum index 91f5036..782b1f6 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,7 @@ github.com/aws/aws-sdk-go v1.31.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.32.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.32.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= @@ -177,6 +178,8 @@ github.com/cs3org/reva v0.1.1-0.20200622084157-4925dc73ec86 h1:TSG6ZPczyWmyFl74v github.com/cs3org/reva v0.1.1-0.20200622084157-4925dc73ec86/go.mod h1:tFcYbIPMOKMITn2b7j4i4oNoiakNXkCD8Bx6pwf7N/U= github.com/cs3org/reva v0.1.1-0.20200624063447-db5e6635d5f0 h1:zzwEoAxYKhEbWzfaa43Va1pO4OSXWiS+1P/CsLn2als= github.com/cs3org/reva v0.1.1-0.20200624063447-db5e6635d5f0/go.mod h1:AwSrblO/VrqvX1M+y+p0+4rSUAO0/PGVA1FR0GKYANs= +github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15 h1:ND/a8QsIUhL12gZerFMv/YnoWhpt23xW3ExxfT2oHP0= +github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15/go.mod h1:7i7pnpPAO0eKy/9+az2YndOVFub0gZCDenpU6EyZqJI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From a4db2f2f2f9667bd80cb3e8295db51586480e36c Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 25 Jun 2020 13:53:13 +0200 Subject: [PATCH 09/19] Changelog for reva update to v0.1.1-0.20200625112940-6a2822cb3f15 --- .../unreleased/update-reva-to-20200625.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 changelog/unreleased/update-reva-to-20200625.md diff --git a/changelog/unreleased/update-reva-to-20200625.md b/changelog/unreleased/update-reva-to-20200625.md new file mode 100644 index 0000000..10f5bea --- /dev/null +++ b/changelog/unreleased/update-reva-to-20200625.md @@ -0,0 +1,18 @@ +Enhancement: update reva to v0.1.1-0.20200625112940-6a2822cb3f15 + +- Updated reva to v0.1.1-0.20200625112940-6a2822cb3f15 (#261) +- TUS upload support through datagateway (#261, reva/#878) +- Added support for differing metrics path for Prometheus to Mentix (reva/#875) +- More data exported by Mentix (reva/#881) +- Implementation of file operations in public folder shares (#49, #293, reva/#877) +- Make httpclient trust local certificates for now (reva/#880) + +https://github.com/owncloud/ocis-reva/pull/261 +https://github.com/owncloud/cs3org/reva/pull/875 +https://github.com/owncloud/ocis-reva/issues/49 +https://github.com/owncloud/ocis-reva/issues/293 +https://github.com/owncloud/cs3org/reva/pull/877 +https://github.com/owncloud/ocis-reva/issues/261 +https://github.com/owncloud/cs3org/reva/pull/878 +https://github.com/owncloud/cs3org/reva/pull/881 +https://github.com/owncloud/cs3org/reva/pull/880 From ba633251f2d930bfe3a8816601a0a43fe98367cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 25 Jun 2020 17:01:27 +0200 Subject: [PATCH 10/19] update to reva v0.1.1-0.20200625144447-03e6aba90379 --- go.mod | 2 +- go.sum | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9668da5..8552c55 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/owncloud/ocis-reva go 1.13 require ( - github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15 + github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379 github.com/gofrs/uuid v3.3.0+incompatible github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 // indirect diff --git a/go.sum b/go.sum index 782b1f6..feba1e3 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,7 @@ contrib.go.opencensus.io/exporter/jaeger v0.2.0/go.mod h1:ukdzwIYYHgZ7QYtwVFQUji contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/prometheus v0.1.0 h1:SByaIoWwNgMdPSgl5sMqM2KDE5H/ukPWBRo314xiDvg= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= +contrib.go.opencensus.io/exporter/prometheus v0.2.0 h1:9PUk0/8V0LGoPqVCrf8fQZJkFGBxudu8jOjQSMwoD6w= contrib.go.opencensus.io/exporter/prometheus v0.2.0/go.mod h1:TYmVAyE8Tn1lyPcltF5IYYfWp2KHu7lQGIZnj8iZMys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -63,8 +64,10 @@ github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbd github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= @@ -88,6 +91,7 @@ github.com/aws/aws-sdk-go v1.31.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.32.3/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.32.9 h1:ai+NZsCV+Z97+jqIKya49gbCObOay9FKww0/VCNuXug= github.com/aws/aws-sdk-go v1.32.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= @@ -159,6 +163,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20200423154403-462ce7762d4a/go.mod h1:UXha4T github.com/cs3org/go-cs3apis v0.0.0-20200515145316-7048e6a5a73d h1:toZvBLH1cbHT65kv6xYPd9QqwLUHwOAVHqe9j4obAq4= github.com/cs3org/go-cs3apis v0.0.0-20200515145316-7048e6a5a73d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/go-cs3apis v0.0.0-20200622121618-dc54dffb5e44/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/go-cs3apis v0.0.0-20200625121012-96e791152b14 h1:ORPIrxw/T33ALlpaon9IMRzf54ArJQWCYlcECZiRmEc= +github.com/cs3org/go-cs3apis v0.0.0-20200625121012-96e791152b14/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva v0.1.1-0.20200520150229-ce94fda7436f/go.mod h1:fVZ7IXTQaxNit5Q9yA+x6ciJmUpEHgBrxtwmiGGBY40= github.com/cs3org/reva v0.1.1-0.20200528123359-7d74bf8e9928 h1:6dIWlFuZNGz3tmK8IF/1JQ/TkmTj0/v3dSt0Zi1zrX0= github.com/cs3org/reva v0.1.1-0.20200528123359-7d74bf8e9928/go.mod h1:ig/TuMCG/l6vjOvFkj/4tU27PBvcig+Kfjc4mF++BwQ= @@ -180,6 +186,8 @@ github.com/cs3org/reva v0.1.1-0.20200624063447-db5e6635d5f0 h1:zzwEoAxYKhEbWzfaa github.com/cs3org/reva v0.1.1-0.20200624063447-db5e6635d5f0/go.mod h1:AwSrblO/VrqvX1M+y+p0+4rSUAO0/PGVA1FR0GKYANs= github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15 h1:ND/a8QsIUhL12gZerFMv/YnoWhpt23xW3ExxfT2oHP0= github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15/go.mod h1:7i7pnpPAO0eKy/9+az2YndOVFub0gZCDenpU6EyZqJI= +github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379 h1:IvAcfPZ7Ii9KAPBGLTIxXuN6qqJSZWRIlYiErThobzM= +github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379/go.mod h1:qmaOljVCmm3kcRS8RW5E34Voly4dDCFdlllj/j4KW/0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -655,6 +663,7 @@ github.com/mitchellh/mapstructure v1.3.0 h1:iDwIio/3gk2QtLLEsqU5lInaMzos0hDTz8a6 github.com/mitchellh/mapstructure v1.3.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.1 h1:cCBH2gTD2K0OtLlv/Y5H01VQCqmlDxz30kS5Y5bqfLA= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -719,6 +728,7 @@ github.com/ory/fosite v0.31.3/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20 github.com/ory/fosite v0.32.0 h1:g89HkBt0dgm+HPrbsYZTmyks1NIw0BH/UlEaw84e1ss= github.com/ory/fosite v0.32.0/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= github.com/ory/fosite v0.32.1/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= +github.com/ory/fosite v0.32.2 h1:iRV495P/9EyoYQ8qEHYxFQeeYCdDFawqjAML+qiMF9s= github.com/ory/fosite v0.32.2/go.mod h1:UeBhRgW6nAjTcd8S7kAo0IFsY/rTPyOXPq/t8N20Q8I= github.com/ory/go-acc v0.0.0-20181118080137-ddc355013f90/go.mod h1:sxnvPCxChFuSmTJGj8FdMupeq1BezCiEpDjTUXQ4hf4= github.com/ory/go-acc v0.2.1 h1:Pwcmwd/cSnwJsYN76+w3HU7oXeWFTkwj/KUj1qGDrVw= @@ -789,6 +799,7 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/statsd_exporter v0.15.0 h1:UiwC1L5HkxEPeapXdm2Ye0u1vUJfTj7uwT5yydYpa1E= github.com/prometheus/statsd_exporter v0.15.0/go.mod h1:Dv8HnkoLQkeEjkIE4/2ndAA7WL1zHKK7WMqFQqu72rw= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= @@ -807,6 +818,7 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.17.2/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= github.com/rs/zerolog v1.18.0 h1:CbAm3kP2Tptby1i9sYy2MGRg0uxIN9cyDb59Ys7W8z8= github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= +github.com/rs/zerolog v1.19.0 h1:hYz4ZVdUgjXTBUmrkrw55j1nHx68LfOKIQk5IYtyScg= github.com/rs/zerolog v1.19.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= @@ -934,6 +946,7 @@ go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1220,6 +1233,7 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 811672b6f6e1703e5c6f5878f9784e6fbd00e046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 25 Jun 2020 17:11:58 +0200 Subject: [PATCH 11/19] do not use proxy urls for testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.star b/.drone.star index e88d37c..cec3264 100644 --- a/.drone.star +++ b/.drone.star @@ -279,6 +279,8 @@ def testing(ctx): 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json', 'REVA_OIDC_ISSUER': 'https://konnectd:9130', + 'REVA_FRONTEND_URL': 'http://localhost:9140', + 'REVA_DATAGATEWAY_URL': 'http://localhost:9140/data', }, 'commands': [ 'mkdir -p /srv/app/tmp/reva', From 331790796b80e2df589bac6bc6f5092248c9808d Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 25 Jun 2020 17:25:49 +0200 Subject: [PATCH 12/19] Add frontend and datagateway urls to CI --- .drone.star | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.drone.star b/.drone.star index cec3264..ec95dd9 100644 --- a/.drone.star +++ b/.drone.star @@ -65,7 +65,9 @@ def apiTests(ctx, coreBranch = 'master', coreCommit = ''): 'REVA_STORAGE_OC_DATA_SERVER_URL': 'http://reva-server:9164/data', 'REVA_STORAGE_OC_DATA_URL': 'reva-server:9164', 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', - 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json' + 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json', + 'REVA_FRONTEND_URL': 'http://reva-server:9140', + 'REVA_DATAGATEWAY_URL': 'http://reva-server:9140/data', }, 'commands': [ 'apk add mailcap', @@ -279,8 +281,8 @@ def testing(ctx): 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json', 'REVA_OIDC_ISSUER': 'https://konnectd:9130', - 'REVA_FRONTEND_URL': 'http://localhost:9140', - 'REVA_DATAGATEWAY_URL': 'http://localhost:9140/data', + 'REVA_FRONTEND_URL': 'http://reva-server:9140', + 'REVA_DATAGATEWAY_URL': 'http://reva-server:9140/data', }, 'commands': [ 'mkdir -p /srv/app/tmp/reva', From 181cdef6bfbd525cffd08817c94bacfb91395be8 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Jun 2020 10:13:36 +0200 Subject: [PATCH 13/19] TEMP enable public link tests --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index ec95dd9..d30b4a8 100644 --- a/.drone.star +++ b/.drone.star @@ -1,7 +1,7 @@ def main(ctx): before = [ testing(ctx), - apiTests(ctx, 'master', '31dbb9ce87de35165edf85ce9eda8f004c73f9f8'), + apiTests(ctx, 'tests-adjust-public-share-test-issues', '9d143b41bda3d5c2bb265a220d0c5dfe8eb584f9'), ] stages = [ From 35aea683016142ffc0743ec197883a6317e5f65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 26 Jun 2020 10:17:02 +0200 Subject: [PATCH 14/19] update config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/command/gateway.go | 24 +-- pkg/command/storageeos.go | 8 +- pkg/command/storageeosdata.go | 5 +- pkg/command/storagehome.go | 15 +- pkg/command/storagehomedata.go | 14 +- pkg/command/storageoc.go | 17 +- pkg/command/storageocdata.go | 14 +- pkg/command/storagepubliclink.go | 7 +- pkg/command/storageroot.go | 23 +-- pkg/config/config.go | 25 ++- pkg/flagset/common.go | 93 +++++++++++ pkg/flagset/gateway.go | 49 ++++-- pkg/flagset/storagedrivers.go | 178 ++++++++++++++++++++ pkg/flagset/storageeos.go | 264 ++---------------------------- pkg/flagset/storageeosdata.go | 267 ++---------------------------- pkg/flagset/storagehome.go | 262 ++---------------------------- pkg/flagset/storagehomedata.go | 265 ++---------------------------- pkg/flagset/storageoc.go | 265 ++---------------------------- pkg/flagset/storageocdata.go | 268 ++----------------------------- pkg/flagset/storagepubliclink.go | 145 ++++------------- pkg/flagset/storageroot.go | 249 ++-------------------------- 21 files changed, 524 insertions(+), 1933 deletions(-) create mode 100644 pkg/flagset/common.go create mode 100644 pkg/flagset/storagedrivers.go diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index 08d8201..ed86211 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -134,18 +134,18 @@ func Gateway(cfg *config.Config) *cli.Command { cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, cfg.Reva.StorageHome.MountPath: cfg.Reva.StorageHome.URL, // the home storage has no mount id. In responses it returns the mount id of the actual storage - cfg.Reva.StorageEOS.MountPath: cfg.Reva.StorageEOS.URL, - cfg.Reva.StorageEOS.MountID: cfg.Reva.StorageEOS.URL, - cfg.Reva.StorageOC.MountPath: cfg.Reva.StorageOC.URL, - cfg.Reva.StorageOC.MountID: cfg.Reva.StorageOC.URL, - cfg.Reva.StorageS3.MountPath: cfg.Reva.StorageS3.URL, - cfg.Reva.StorageS3.MountID: cfg.Reva.StorageS3.URL, - cfg.Reva.StorageWND.MountPath: cfg.Reva.StorageWND.URL, - cfg.Reva.StorageWND.MountID: cfg.Reva.StorageWND.URL, - cfg.Reva.StorageCustom.MountPath: cfg.Reva.StorageCustom.URL, - cfg.Reva.StorageCustom.MountID: cfg.Reva.StorageCustom.URL, - "/public/": "localhost:10054", - "e1a73ede-549b-4226-abdf-40e69ca8230d": "localhost:10054", + cfg.Reva.StorageEOS.MountPath: cfg.Reva.StorageEOS.URL, + cfg.Reva.StorageEOS.MountID: cfg.Reva.StorageEOS.URL, + cfg.Reva.StorageOC.MountPath: cfg.Reva.StorageOC.URL, + cfg.Reva.StorageOC.MountID: cfg.Reva.StorageOC.URL, + cfg.Reva.StorageS3.MountPath: cfg.Reva.StorageS3.URL, + cfg.Reva.StorageS3.MountID: cfg.Reva.StorageS3.URL, + cfg.Reva.StorageWND.MountPath: cfg.Reva.StorageWND.URL, + cfg.Reva.StorageWND.MountID: cfg.Reva.StorageWND.URL, + cfg.Reva.StorageCustom.MountPath: cfg.Reva.StorageCustom.URL, + cfg.Reva.StorageCustom.MountID: cfg.Reva.StorageCustom.URL, + cfg.Reva.StoragePublicLink.MountPath: cfg.Reva.StoragePublicLink.URL, + cfg.Reva.StoragePublicLink.MountID: cfg.Reva.StoragePublicLink.URL, }, }, }, diff --git a/pkg/command/storageeos.go b/pkg/command/storageeos.go index 04ef998..38057f9 100644 --- a/pkg/command/storageeos.go +++ b/pkg/command/storageeos.go @@ -89,7 +89,7 @@ func StorageEOS(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageEOS.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -105,16 +105,14 @@ func StorageEOS(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, }, "mount_path": cfg.Reva.StorageEOS.MountPath, "mount_id": cfg.Reva.StorageEOS.MountID, "expose_data_server": cfg.Reva.StorageEOS.ExposeDataServer, // TODO use cfg.Reva.SStorageEOSData.URL, ? - "data_server_url": cfg.Reva.StorageEOS.DataServerURL, - "enable_home_creation": cfg.Reva.StorageEOS.EnableHomeCreation, + "data_server_url": cfg.Reva.StorageEOS.DataServerURL, }, }, }, diff --git a/pkg/command/storageeosdata.go b/pkg/command/storageeosdata.go index eee78a9..0522977 100644 --- a/pkg/command/storageeosdata.go +++ b/pkg/command/storageeosdata.go @@ -91,7 +91,7 @@ func StorageEOSData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageEOSData.Prefix, "driver": cfg.Reva.StorageEOSData.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -107,8 +107,7 @@ func StorageEOSData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, }, "temp_folder": cfg.Reva.StorageEOSData.TempFolder, diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index 7e0f583..ced6fd5 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -89,7 +89,7 @@ func StorageHome(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageHome.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -106,10 +106,16 @@ func StorageHome(cfg *config.Config) *cli.Command { "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, "enable_home": true, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + "user_layout": cfg.Reva.Storages.Local.UserLayout, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, @@ -131,8 +137,7 @@ func StorageHome(cfg *config.Config) *cli.Command { "mount_id": cfg.Reva.StorageHome.MountID, "expose_data_server": cfg.Reva.StorageHome.ExposeDataServer, // TODO use cfg.Reva.StorageHomeData.URL, ? - "data_server_url": cfg.Reva.StorageHome.DataServerURL, - "enable_home_creation": cfg.Reva.StorageHome.EnableHomeCreation, + "data_server_url": cfg.Reva.StorageHome.DataServerURL, }, }, }, diff --git a/pkg/command/storagehomedata.go b/pkg/command/storagehomedata.go index a00657b..62ef2c3 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -91,7 +91,7 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageHomeData.Prefix, "driver": cfg.Reva.StorageHomeData.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, @@ -107,17 +107,21 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + "user_layout": cfg.Reva.Storages.Local.UserLayout, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storageoc.go b/pkg/command/storageoc.go index 34b24e4..8b3f536 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -89,7 +89,7 @@ func StorageOC(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageOC.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -105,17 +105,21 @@ func StorageOC(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + "user_layout": cfg.Reva.Storages.Local.UserLayout, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ @@ -131,8 +135,7 @@ func StorageOC(cfg *config.Config) *cli.Command { "mount_id": cfg.Reva.StorageOC.MountID, "expose_data_server": cfg.Reva.StorageOC.ExposeDataServer, // TODO use cfg.Reva.SStorageOCData.URL, ? - "data_server_url": cfg.Reva.StorageOC.DataServerURL, - "enable_home_creation": cfg.Reva.StorageOC.EnableHomeCreation, + "data_server_url": cfg.Reva.StorageOC.DataServerURL, }, }, }, diff --git a/pkg/command/storageocdata.go b/pkg/command/storageocdata.go index dd3a2be..0418f06 100644 --- a/pkg/command/storageocdata.go +++ b/pkg/command/storageocdata.go @@ -91,7 +91,7 @@ func StorageOCData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageOCData.Prefix, "driver": cfg.Reva.StorageOCData.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -107,17 +107,21 @@ func StorageOCData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + "user_layout": cfg.Reva.Storages.Local.UserLayout, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storagepubliclink.go b/pkg/command/storagepubliclink.go index d403131..5642897 100644 --- a/pkg/command/storagepubliclink.go +++ b/pkg/command/storagepubliclink.go @@ -68,8 +68,11 @@ func StoragePublicLink(cfg *config.Config) *cli.Command { rcfg := map[string]interface{}{ "core": map[string]interface{}{ - "max_cpus": cfg.Reva.StoragePublicLink.MaxCPUs, - "tracing_enabled": true, + "max_cpus": cfg.Reva.StoragePublicLink.MaxCPUs, + "tracing_enabled": cfg.Tracing.Enabled, + "tracing_endpoint": cfg.Tracing.Endpoint, + "tracing_collector": cfg.Tracing.Collector, + "tracing_service_name": "storage-public-links", }, "shared": map[string]interface{}{ "jwt_secret": cfg.Reva.JWTSecret, diff --git a/pkg/command/storageroot.go b/pkg/command/storageroot.go index a2fa370..346fcb9 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -89,7 +89,7 @@ func StorageRoot(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageRoot.Driver, "drivers": map[string]interface{}{ - "eos": map[string]interface{}{ + "eoshome": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, @@ -103,17 +103,21 @@ func StorageRoot(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "enable_home": cfg.Reva.Storages.EOS.EnableHome, - "user_layout": cfg.Reva.Storages.EOS.Layout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, + "user_layout": cfg.Reva.Storages.Local.UserLayout, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ @@ -125,11 +129,10 @@ func StorageRoot(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "mount_path": cfg.Reva.StorageRoot.MountPath, - "mount_id": cfg.Reva.StorageRoot.MountID, - "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, - "data_server_url": cfg.Reva.StorageRoot.DataServerURL, - "enable_home_creation": cfg.Reva.StorageRoot.EnableHomeCreation, + "mount_path": cfg.Reva.StorageRoot.MountPath, + "mount_id": cfg.Reva.StorageRoot.MountID, + "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, + "data_server_url": cfg.Reva.StorageRoot.DataServerURL, }, }, }, diff --git a/pkg/config/config.go b/pkg/config/config.go index 942b48b..804a5b9 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -68,12 +68,11 @@ type Users struct { // StoragePort defines the available storage configuration. type StoragePort struct { Port - Driver string - MountPath string - MountID string - ExposeDataServer bool - DataServerURL string - EnableHomeCreation bool + Driver string + MountPath string + MountID string + ExposeDataServer bool + DataServerURL string // for HTTP ports with only one http service Prefix string @@ -85,9 +84,7 @@ type PublicStorage struct { StoragePort PublicShareProviderAddr string - StorageProviderAddr string UserProviderAddr string - MountID string } // StorageConfig combines all available storage driver configuration parts. @@ -145,9 +142,6 @@ type DriverEOS struct { // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. UseKeytab bool - // EnableHome enables the creation of home directories. - EnableHome bool - // SecProtocol specifies the xrootd security protocol to use between the server and EOS. SecProtocol string @@ -157,13 +151,15 @@ type DriverEOS struct { // SingleUsername is the username to use when SingleUserMode is enabled SingleUsername string - // Layout of the users home dir path - Layout string + // UserLayout of the users home dir path + UserLayout string } // DriverLocal defines the available local storage driver configuration. type DriverLocal struct { - Root string + Root string + ShareFolder string + UserLayout string } // DriverOwnCloud defines the available ownCloud storage driver configuration. @@ -172,7 +168,6 @@ type DriverOwnCloud struct { Layout string Redis string Scan bool - EnableHome bool } // DriverS3 defines the available S3 storage driver configuration. diff --git a/pkg/flagset/common.go b/pkg/flagset/common.go new file mode 100644 index 0000000..ad3c1e8 --- /dev/null +++ b/pkg/flagset/common.go @@ -0,0 +1,93 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +func commonTracingWithConfig(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, + }, + } +} + +func commonDebugWithConfig(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, + }, + } +} + +func commonSecretWithConfig(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, + }, + } +} + +func commonGatewayWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "gateway-url", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_GATEWAY_URL"}, + Destination: &cfg.Reva.Gateway.URL, + }, + } +} diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 73b59be..1d80b5f 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -189,7 +189,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "frontend-url", Value: "https://localhost:9200", - Usage: "URL to use for the reva service", + Usage: "URL to use for the frontend service", EnvVars: []string{"REVA_FRONTEND_URL"}, Destination: &cfg.Reva.Frontend.URL, }, @@ -203,28 +203,28 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "users-url", Value: "localhost:9144", - Usage: "URL to use for the reva service", + Usage: "URL to use for the users service", EnvVars: []string{"REVA_USERS_URL"}, Destination: &cfg.Reva.Users.URL, }, &cli.StringFlag{ Name: "auth-basic-url", Value: "localhost:9146", - Usage: "URL to use for the reva service", + Usage: "URL to use for the auth basic service", EnvVars: []string{"REVA_AUTH_BASIC_URL"}, Destination: &cfg.Reva.AuthBasic.URL, }, &cli.StringFlag{ Name: "auth-bearer-url", Value: "localhost:9148", - Usage: "URL to use for the reva service", + Usage: "URL to use for the auth bearer service", EnvVars: []string{"REVA_AUTH_BEARER_URL"}, Destination: &cfg.Reva.AuthBearer.URL, }, &cli.StringFlag{ Name: "sharing-url", Value: "localhost:9150", - Usage: "URL to use for the reva service", + Usage: "URL to use for the sharing service", EnvVars: []string{"REVA_SHARING_URL"}, Destination: &cfg.Reva.Sharing.URL, }, @@ -232,21 +232,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-root-url", Value: "localhost:9152", - Usage: "URL to use for the reva service", + Usage: "URL to use for the root storage service", EnvVars: []string{"REVA_STORAGE_ROOT_URL"}, Destination: &cfg.Reva.StorageRoot.URL, }, &cli.StringFlag{ Name: "storage-root-mount-path", Value: "/", - Usage: "mount path", + Usage: "root storage mount path", EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_PATH"}, Destination: &cfg.Reva.StorageRoot.MountPath, }, &cli.StringFlag{ Name: "storage-root-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009152", - Usage: "mount id", + Usage: "root storage mount id", EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_ID"}, Destination: &cfg.Reva.StorageRoot.MountID, }, @@ -254,14 +254,14 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-home-url", Value: "localhost:9154", - Usage: "URL to use for the reva service", + Usage: "URL to use for the home storage service", EnvVars: []string{"REVA_STORAGE_HOME_URL"}, Destination: &cfg.Reva.StorageHome.URL, }, &cli.StringFlag{ Name: "storage-home-mount-path", Value: "/home", - Usage: "mount path", + Usage: "home storage mount path", EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_PATH"}, Destination: &cfg.Reva.StorageHome.MountPath, }, @@ -270,21 +270,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-eos-url", Value: "localhost:9158", - Usage: "URL to use for the reva service", + Usage: "URL to use for the eos storage service", EnvVars: []string{"REVA_STORAGE_EOS_URL"}, Destination: &cfg.Reva.StorageEOS.URL, }, &cli.StringFlag{ Name: "storage-eos-mount-path", Value: "/eos", - Usage: "mount path", + Usage: "eos storage mount path", EnvVars: []string{"REVA_STORAGE_EOS_MOUNT_PATH"}, Destination: &cfg.Reva.StorageEOS.MountPath, }, &cli.StringFlag{ Name: "storage-eos-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009158", - Usage: "mount id", + Usage: "eos storage mount id", EnvVars: []string{"REVA_STORAGE_EOS_MOUNT_ID"}, Destination: &cfg.Reva.StorageEOS.MountID, }, @@ -292,30 +292,45 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-oc-url", Value: "localhost:9162", - Usage: "URL to use for the reva service", + Usage: "URL to use for the oc storage service", EnvVars: []string{"REVA_STORAGE_OC_URL"}, Destination: &cfg.Reva.StorageOC.URL, }, &cli.StringFlag{ Name: "storage-oc-mount-path", Value: "/oc", - Usage: "mount path", + Usage: "oc storage mount path", EnvVars: []string{"REVA_STORAGE_OC_MOUNT_PATH"}, Destination: &cfg.Reva.StorageOC.MountPath, }, &cli.StringFlag{ Name: "storage-oc-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009162", - Usage: "mount id", + Usage: "oc storage mount id", EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"}, Destination: &cfg.Reva.StorageOC.MountID, }, + &cli.StringFlag{ Name: "public-links-url", - Value: "localhost:10054", + Value: "localhost:9170", Usage: "URL to use for the public links service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, Destination: &cfg.Reva.StoragePublicLink.URL, }, + &cli.StringFlag{ + Name: "public-links-mount-path", + Value: "/public/", + Usage: "public links storage mount path", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, + Destination: &cfg.Reva.StoragePublicLink.MountPath, + }, + &cli.StringFlag{ + Name: "public-links-mount-id", + Value: "e1a73ede-549b-4226-abdf-40e69ca8230d", + Usage: "public links storage mount id", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_ID"}, + Destination: &cfg.Reva.StoragePublicLink.MountID, + }, } } diff --git a/pkg/flagset/storagedrivers.go b/pkg/flagset/storagedrivers.go new file mode 100644 index 0000000..f8dc127 --- /dev/null +++ b/pkg/flagset/storagedrivers.go @@ -0,0 +1,178 @@ +package flagset + +import ( + "os" + + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// StorageDriversWithConfig applies cfg to the root flagset +func storageDriversWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + + // 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", + Value: true, + 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.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-user-layout", + Value: "{{substr 0 1 .Username}}/{{.Username}}", + Usage: `"layout of the users internal home dir path, in addition to {{.Username}}, and {{.Mail}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, + EnvVars: []string{"REVA_STORAGE_EOS_USER_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.UserLayout, + }, + + // 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, + }, + &cli.StringFlag{ + Name: "storage-local-share-folder", + Value: "/MyShares", + Usage: "name of the share folder", + EnvVars: []string{"REVA_STORAGE_LOCAL_SHARE_FOLDER"}, + Destination: &cfg.Reva.Storages.Local.UserLayout, + }, + &cli.StringFlag{ + Name: "storage-local-user-layout", + Value: "{{substr 0 1 .Username}}/{{.Username}}", + Usage: `"layout of the users internal home dir path, in addition to {{.Username}}, and {{.Mail}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, + EnvVars: []string{"REVA_STORAGE_LOCAL_USER_LAYOUT"}, + Destination: &cfg.Reva.Storages.Local.UserLayout, + }, + + // 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.StringFlag{ + Name: "storage-owncloud-layout", + Value: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + } +} diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index e302832..8247b17 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -1,92 +1,21 @@ 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, - }, - - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9159", - Usage: "Address to bind debug server", - 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, - }, + flags := commonTracingWithConfig(cfg) - // REVA + flags = append(flags, commonSecretWithConfig(cfg)...) - &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, - }, + flags = append(flags, commonDebugWithConfig(cfg)...) - // Services + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage oc + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +38,13 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_ADDR"}, Destination: &cfg.Reva.StorageEOS.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9159", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_EOS_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageEOS.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9158", @@ -122,10 +58,9 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service storageprovider [--service otherservice]", EnvVars: []string{"REVA_STORAGE_EOS_SERVICES"}, }, - &cli.StringFlag{ Name: "driver", - Value: "eos", + Value: "eoshome", Usage: "storage driver, eg. local, eos, owncloud or s3", EnvVars: []string{"REVA_STORAGE_EOS_DRIVER"}, Destination: &cfg.Reva.StorageEOS.Driver, @@ -158,176 +93,7 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageEOS.DataServerURL, }, - &cli.BoolFlag{ - Name: "enable-home-creation", - Value: false, - Usage: "if enabled home dirs will be automatically created", - 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - } + return flags } diff --git a/pkg/flagset/storageeosdata.go b/pkg/flagset/storageeosdata.go index 10d651c..583f577 100644 --- a/pkg/flagset/storageeosdata.go +++ b/pkg/flagset/storageeosdata.go @@ -1,92 +1,23 @@ 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{ + flags := commonTracingWithConfig(cfg) - &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 = append(flags, commonGatewayWithConfig(cfg)...) - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9161", - Usage: "Address to bind debug server", - 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, - }, + flags = append(flags, commonSecretWithConfig(cfg)...) - // REVA + flags = append(flags, commonDebugWithConfig(cfg)...) - &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 + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage eos data + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +40,13 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_ADDR"}, Destination: &cfg.Reva.StorageEOSData.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9161", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageEOSData.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9160", @@ -124,7 +62,7 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "driver", - Value: "eos", + Value: "eoshome", Usage: "storage driver, eg. local, eos, owncloud or s3", EnvVars: []string{"REVA_STORAGE_EOS_DATA_DRIVER"}, Destination: &cfg.Reva.StorageEOSData.Driver, @@ -143,179 +81,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_TEMP_FOLDER"}, 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - - // Gateway - - &cli.StringFlag{ - Name: "gateway-url", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_GATEWAY_URL"}, - Destination: &cfg.Reva.Gateway.URL, - }, - } + ) + return flags } diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 4c5cc8d..6737f34 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -1,92 +1,21 @@ 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{ + flags := commonTracingWithConfig(cfg) - &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 = append(flags, commonSecretWithConfig(cfg)...) - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9155", - Usage: "Address to bind debug server", - 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, - }, + flags = append(flags, commonDebugWithConfig(cfg)...) - // Services + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage home + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +38,13 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_ADDR"}, Destination: &cfg.Reva.StorageHome.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9155", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_HOME_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageHome.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9154", @@ -160,177 +96,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageHome.DataServerURL, }, - &cli.BoolFlag{ - Name: "enable-home-creation", - Value: true, - Usage: "if enabled home dirs will be automatically created", - EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"}, - 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - } + return flags } diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 8b8393a..026b166 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -1,92 +1,23 @@ 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 := commonTracingWithConfig(cfg) - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9157", - Usage: "Address to bind debug server", - 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, - }, + flags = append(flags, commonGatewayWithConfig(cfg)...) - // REVA + flags = append(flags, commonSecretWithConfig(cfg)...) - &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, - }, + flags = append(flags, commonDebugWithConfig(cfg)...) - // Services + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage home data + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +40,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_ADDR"}, Destination: &cfg.Reva.StorageHomeData.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9157", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_HOME_DATA_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageHomeData.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9156", @@ -143,180 +81,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_TEMP_FOLDER"}, 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - - // Gateway - - &cli.StringFlag{ - Name: "gateway-url", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_GATEWAY_URL"}, - Destination: &cfg.Reva.Gateway.URL, - }, - } + return flags } diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 62d58bc..c8322db 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -1,92 +1,21 @@ 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, - }, - - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9163", - Usage: "Address to bind debug server", - 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, - }, + flags := commonTracingWithConfig(cfg) - // REVA + flags = append(flags, commonSecretWithConfig(cfg)...) - &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, - }, + flags = append(flags, commonDebugWithConfig(cfg)...) - // Services + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage oc + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +38,13 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_ADDR"}, Destination: &cfg.Reva.StorageOC.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9163", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_OC_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageOC.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9162", @@ -122,7 +58,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service storageprovider [--service otherservice]", EnvVars: []string{"REVA_STORAGE_OC_SERVICES"}, }, - &cli.StringFlag{ Name: "driver", Value: "owncloud", @@ -158,179 +93,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageOC.DataServerURL, }, - &cli.BoolFlag{ - Name: "enable-home-creation", - Value: false, - Usage: "if enabled home dirs will be automatically created", - EnvVars: []string{"REVA_STORAGE_OC_ENABLE_HOME_CREATION"}, - 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - } + return flags } diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index bb2a645..a228d71 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -1,93 +1,23 @@ 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{ + flags := commonTracingWithConfig(cfg) - &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 = append(flags, commonGatewayWithConfig(cfg)...) - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9165", - Usage: "Address to bind debug server", - 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, - }, + flags = append(flags, commonSecretWithConfig(cfg)...) - // REVA + flags = append(flags, commonDebugWithConfig(cfg)...) - &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 data + flags = append(flags, storageDriversWithConfig(cfg)...) + flags = append(flags, &cli.StringFlag{ Name: "network", Value: "tcp", @@ -109,6 +39,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_ADDR"}, Destination: &cfg.Reva.StorageOCData.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9165", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageOCData.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9164", @@ -143,182 +80,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_TEMP_FOLDER"}, Destination: &cfg.Reva.StorageOCData.TempFolder, }, + ) - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "", - Usage: "Namespace for metadata operations", - 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - - // Gateway - - &cli.StringFlag{ - Name: "gateway-url", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_GATEWAY_URL"}, - Destination: &cfg.Reva.Gateway.URL, - }, - } + return flags } diff --git a/pkg/flagset/storagepubliclink.go b/pkg/flagset/storagepubliclink.go index a665d95..3d0d57f 100644 --- a/pkg/flagset/storagepubliclink.go +++ b/pkg/flagset/storagepubliclink.go @@ -7,74 +7,17 @@ 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, - }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:10053", - 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, - }, + flags := commonTracingWithConfig(cfg) + + flags = append(flags, commonGatewayWithConfig(cfg)...) + + flags = append(flags, commonSecretWithConfig(cfg)...) + + flags = append(flags, commonDebugWithConfig(cfg)...) + + flags = append(flags, storageDriversWithConfig(cfg)...) + + flags = append(flags, &cli.StringFlag{ Name: "network", Value: "tcp", @@ -91,11 +34,25 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: "localhost:10054", + Value: "0.0.0.0:9170", Usage: "Address to bind reva service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9171", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR"}, + Destination: &cfg.Reva.StoragePublicLink.DebugAddr, + }, + &cli.StringFlag{ + Name: "url", + Value: "localhost:9170", + Usage: "URL to use for the reva service", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, + Destination: &cfg.Reva.StoragePublicLink.URL, + }, &cli.StringSliceFlag{ Name: "service", Value: cli.NewStringSlice("storageprovider"), @@ -118,18 +75,11 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { 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, + Name: "mount-path", + Value: "/public/", + Usage: "mount path", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, + Destination: &cfg.Reva.StoragePublicLink.MountPath, }, &cli.StringFlag{ Name: "mount-id", @@ -145,33 +95,8 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { 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/", - Usage: "mount path", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, - Destination: &cfg.Reva.StoragePublicLink.MountPath, - }, - &cli.StringFlag{ - Name: "gateway-url", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_GATEWAY_URL"}, - Destination: &cfg.Reva.Gateway.URL, - }, - } + // has no data provider, only redirects to the actual storage + ) + + return flags } diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 31b136d..03a6cc7 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -1,92 +1,21 @@ 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, - }, - - // debug ports are the odd ports - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9153", - Usage: "Address to bind debug server", - 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, - }, + flags := commonTracingWithConfig(cfg) - // REVA + flags = append(flags, commonSecretWithConfig(cfg)...) - &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, - }, + flags = append(flags, commonDebugWithConfig(cfg)...) - // Services + flags = append(flags, storageDriversWithConfig(cfg)...) - // Storage root + flags = append(flags, &cli.StringFlag{ Name: "network", @@ -109,6 +38,13 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_ADDR"}, Destination: &cfg.Reva.StorageRoot.Addr, }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9153", + Usage: "Address to bind debug server", + EnvVars: []string{"REVA_STORAGE_ROOT_DEBUG_ADDR"}, + Destination: &cfg.Reva.StorageRoot.DebugAddr, + }, &cli.StringFlag{ Name: "url", Value: "localhost:9152", @@ -157,164 +93,7 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageRoot.DataServerURL, }, - &cli.BoolFlag{ - Name: "enable-home-creation", - Usage: "if enabled home dirs will be automatically created", - 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, - }, - - // 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: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - } + return flags } From 38493d126a44d04cca325bf0e9cbbf6de038e1b2 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 26 Jun 2020 10:33:44 +0200 Subject: [PATCH 15/19] Update cs3org/reva --- changelog/unreleased/update-reva-to-20200625.md | 13 +++++++------ go.mod | 2 +- go.sum | 5 +++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/changelog/unreleased/update-reva-to-20200625.md b/changelog/unreleased/update-reva-to-20200625.md index 10f5bea..0f38d7c 100644 --- a/changelog/unreleased/update-reva-to-20200625.md +++ b/changelog/unreleased/update-reva-to-20200625.md @@ -1,18 +1,19 @@ Enhancement: update reva to v0.1.1-0.20200625112940-6a2822cb3f15 - Updated reva to v0.1.1-0.20200625112940-6a2822cb3f15 (#261) -- TUS upload support through datagateway (#261, reva/#878) +- TUS upload support through datagateway (#261, reva/#878, reva/#888) - Added support for differing metrics path for Prometheus to Mentix (reva/#875) - More data exported by Mentix (reva/#881) - Implementation of file operations in public folder shares (#49, #293, reva/#877) - Make httpclient trust local certificates for now (reva/#880) https://github.com/owncloud/ocis-reva/pull/261 -https://github.com/owncloud/cs3org/reva/pull/875 +https://github.com/cs3org/reva/pull/875 https://github.com/owncloud/ocis-reva/issues/49 https://github.com/owncloud/ocis-reva/issues/293 -https://github.com/owncloud/cs3org/reva/pull/877 +https://github.com/cs3org/reva/pull/877 https://github.com/owncloud/ocis-reva/issues/261 -https://github.com/owncloud/cs3org/reva/pull/878 -https://github.com/owncloud/cs3org/reva/pull/881 -https://github.com/owncloud/cs3org/reva/pull/880 +https://github.com/cs3org/reva/pull/878 +https://github.com/cs3org/reva/pull/881 +https://github.com/cs3org/reva/pull/880 +https://github.com/cs3org/reva/pull/888 diff --git a/go.mod b/go.mod index 8552c55..39472ce 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/owncloud/ocis-reva go 1.13 require ( - github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379 + github.com/cs3org/reva v0.1.1-0.20200626083045-8d345749ae0d github.com/gofrs/uuid v3.3.0+incompatible github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 // indirect diff --git a/go.sum b/go.sum index feba1e3..e790e10 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,7 @@ github.com/aws/aws-sdk-go v1.32.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.32.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.9 h1:ai+NZsCV+Z97+jqIKya49gbCObOay9FKww0/VCNuXug= github.com/aws/aws-sdk-go v1.32.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.32.10/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= @@ -188,6 +189,8 @@ github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15 h1:ND/a8QsIUhL12gZer github.com/cs3org/reva v0.1.1-0.20200625112940-6a2822cb3f15/go.mod h1:7i7pnpPAO0eKy/9+az2YndOVFub0gZCDenpU6EyZqJI= github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379 h1:IvAcfPZ7Ii9KAPBGLTIxXuN6qqJSZWRIlYiErThobzM= github.com/cs3org/reva v0.1.1-0.20200625144447-03e6aba90379/go.mod h1:qmaOljVCmm3kcRS8RW5E34Voly4dDCFdlllj/j4KW/0= +github.com/cs3org/reva v0.1.1-0.20200626083045-8d345749ae0d h1:SCUMOhkYTEjFA7IsMlj49bF+cCgTEbfnBme0VFqOhuc= +github.com/cs3org/reva v0.1.1-0.20200626083045-8d345749ae0d/go.mod h1:wunIwvRI7Pd+QFB0YCK+jdAtq0udQzjt8iG7WQ+LLrs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -513,6 +516,7 @@ github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FK github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -1244,6 +1248,7 @@ google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyz google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/Acconut/lockfile.v1 v1.1.0/go.mod h1:6UCz3wJ8tSFUsPR6uP/j8uegEtDuEEqFxlpi0JI4Umw= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= From 771670b68525f7f222fce1692dd46c357177a126 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Jun 2020 10:54:45 +0200 Subject: [PATCH 16/19] Revert "update config" This reverts commit 35aea683016142ffc0743ec197883a6317e5f65e. --- pkg/command/gateway.go | 24 +-- pkg/command/storageeos.go | 8 +- pkg/command/storageeosdata.go | 5 +- pkg/command/storagehome.go | 15 +- pkg/command/storagehomedata.go | 14 +- pkg/command/storageoc.go | 17 +- pkg/command/storageocdata.go | 14 +- pkg/command/storagepubliclink.go | 7 +- pkg/command/storageroot.go | 23 ++- pkg/config/config.go | 25 +-- pkg/flagset/common.go | 93 ----------- pkg/flagset/gateway.go | 49 ++---- pkg/flagset/storagedrivers.go | 178 -------------------- pkg/flagset/storageeos.go | 264 ++++++++++++++++++++++++++++-- pkg/flagset/storageeosdata.go | 267 ++++++++++++++++++++++++++++-- pkg/flagset/storagehome.go | 262 ++++++++++++++++++++++++++++-- pkg/flagset/storagehomedata.go | 265 ++++++++++++++++++++++++++++-- pkg/flagset/storageoc.go | 265 ++++++++++++++++++++++++++++-- pkg/flagset/storageocdata.go | 268 +++++++++++++++++++++++++++++-- pkg/flagset/storagepubliclink.go | 145 +++++++++++++---- pkg/flagset/storageroot.go | 249 ++++++++++++++++++++++++++-- 21 files changed, 1933 insertions(+), 524 deletions(-) delete mode 100644 pkg/flagset/common.go delete mode 100644 pkg/flagset/storagedrivers.go diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index ed86211..08d8201 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -134,18 +134,18 @@ func Gateway(cfg *config.Config) *cli.Command { cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, cfg.Reva.StorageHome.MountPath: cfg.Reva.StorageHome.URL, // the home storage has no mount id. In responses it returns the mount id of the actual storage - cfg.Reva.StorageEOS.MountPath: cfg.Reva.StorageEOS.URL, - cfg.Reva.StorageEOS.MountID: cfg.Reva.StorageEOS.URL, - cfg.Reva.StorageOC.MountPath: cfg.Reva.StorageOC.URL, - cfg.Reva.StorageOC.MountID: cfg.Reva.StorageOC.URL, - cfg.Reva.StorageS3.MountPath: cfg.Reva.StorageS3.URL, - cfg.Reva.StorageS3.MountID: cfg.Reva.StorageS3.URL, - cfg.Reva.StorageWND.MountPath: cfg.Reva.StorageWND.URL, - cfg.Reva.StorageWND.MountID: cfg.Reva.StorageWND.URL, - cfg.Reva.StorageCustom.MountPath: cfg.Reva.StorageCustom.URL, - cfg.Reva.StorageCustom.MountID: cfg.Reva.StorageCustom.URL, - cfg.Reva.StoragePublicLink.MountPath: cfg.Reva.StoragePublicLink.URL, - cfg.Reva.StoragePublicLink.MountID: cfg.Reva.StoragePublicLink.URL, + cfg.Reva.StorageEOS.MountPath: cfg.Reva.StorageEOS.URL, + cfg.Reva.StorageEOS.MountID: cfg.Reva.StorageEOS.URL, + cfg.Reva.StorageOC.MountPath: cfg.Reva.StorageOC.URL, + cfg.Reva.StorageOC.MountID: cfg.Reva.StorageOC.URL, + cfg.Reva.StorageS3.MountPath: cfg.Reva.StorageS3.URL, + cfg.Reva.StorageS3.MountID: cfg.Reva.StorageS3.URL, + cfg.Reva.StorageWND.MountPath: cfg.Reva.StorageWND.URL, + cfg.Reva.StorageWND.MountID: cfg.Reva.StorageWND.URL, + cfg.Reva.StorageCustom.MountPath: cfg.Reva.StorageCustom.URL, + cfg.Reva.StorageCustom.MountID: cfg.Reva.StorageCustom.URL, + "/public/": "localhost:10054", + "e1a73ede-549b-4226-abdf-40e69ca8230d": "localhost:10054", }, }, }, diff --git a/pkg/command/storageeos.go b/pkg/command/storageeos.go index 38057f9..04ef998 100644 --- a/pkg/command/storageeos.go +++ b/pkg/command/storageeos.go @@ -89,7 +89,7 @@ func StorageEOS(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageEOS.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -105,14 +105,16 @@ func StorageEOS(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, }, "mount_path": cfg.Reva.StorageEOS.MountPath, "mount_id": cfg.Reva.StorageEOS.MountID, "expose_data_server": cfg.Reva.StorageEOS.ExposeDataServer, // TODO use cfg.Reva.SStorageEOSData.URL, ? - "data_server_url": cfg.Reva.StorageEOS.DataServerURL, + "data_server_url": cfg.Reva.StorageEOS.DataServerURL, + "enable_home_creation": cfg.Reva.StorageEOS.EnableHomeCreation, }, }, }, diff --git a/pkg/command/storageeosdata.go b/pkg/command/storageeosdata.go index 0522977..eee78a9 100644 --- a/pkg/command/storageeosdata.go +++ b/pkg/command/storageeosdata.go @@ -91,7 +91,7 @@ func StorageEOSData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageEOSData.Prefix, "driver": cfg.Reva.StorageEOSData.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -107,7 +107,8 @@ func StorageEOSData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, }, "temp_folder": cfg.Reva.StorageEOSData.TempFolder, diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index ced6fd5..7e0f583 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -89,7 +89,7 @@ func StorageHome(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageHome.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -106,16 +106,10 @@ func StorageHome(cfg *config.Config) *cli.Command { "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, "enable_home": true, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - }, - "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - "user_layout": cfg.Reva.Storages.Local.UserLayout, + "root": cfg.Reva.Storages.Local.Root, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, @@ -137,7 +131,8 @@ func StorageHome(cfg *config.Config) *cli.Command { "mount_id": cfg.Reva.StorageHome.MountID, "expose_data_server": cfg.Reva.StorageHome.ExposeDataServer, // TODO use cfg.Reva.StorageHomeData.URL, ? - "data_server_url": cfg.Reva.StorageHome.DataServerURL, + "data_server_url": cfg.Reva.StorageHome.DataServerURL, + "enable_home_creation": cfg.Reva.StorageHome.EnableHomeCreation, }, }, }, diff --git a/pkg/command/storagehomedata.go b/pkg/command/storagehomedata.go index 62ef2c3..a00657b 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -91,7 +91,7 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageHomeData.Prefix, "driver": cfg.Reva.StorageHomeData.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, @@ -107,21 +107,17 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - }, - "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - "user_layout": cfg.Reva.Storages.Local.UserLayout, + "root": cfg.Reva.Storages.Local.Root, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storageoc.go b/pkg/command/storageoc.go index 8b3f536..34b24e4 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -89,7 +89,7 @@ func StorageOC(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageOC.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -105,21 +105,17 @@ func StorageOC(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - }, - "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - "user_layout": cfg.Reva.Storages.Local.UserLayout, + "root": cfg.Reva.Storages.Local.Root, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ @@ -135,7 +131,8 @@ func StorageOC(cfg *config.Config) *cli.Command { "mount_id": cfg.Reva.StorageOC.MountID, "expose_data_server": cfg.Reva.StorageOC.ExposeDataServer, // TODO use cfg.Reva.SStorageOCData.URL, ? - "data_server_url": cfg.Reva.StorageOC.DataServerURL, + "data_server_url": cfg.Reva.StorageOC.DataServerURL, + "enable_home_creation": cfg.Reva.StorageOC.EnableHomeCreation, }, }, }, diff --git a/pkg/command/storageocdata.go b/pkg/command/storageocdata.go index 0418f06..dd3a2be 100644 --- a/pkg/command/storageocdata.go +++ b/pkg/command/storageocdata.go @@ -91,7 +91,7 @@ func StorageOCData(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.StorageOCData.Prefix, "driver": cfg.Reva.StorageOCData.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "share_folder": cfg.Reva.Storages.EOS.ShareFolder, @@ -107,21 +107,17 @@ func StorageOCData(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - }, - "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - "user_layout": cfg.Reva.Storages.Local.UserLayout, + "root": cfg.Reva.Storages.Local.Root, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storagepubliclink.go b/pkg/command/storagepubliclink.go index 5642897..d403131 100644 --- a/pkg/command/storagepubliclink.go +++ b/pkg/command/storagepubliclink.go @@ -68,11 +68,8 @@ func StoragePublicLink(cfg *config.Config) *cli.Command { rcfg := map[string]interface{}{ "core": map[string]interface{}{ - "max_cpus": cfg.Reva.StoragePublicLink.MaxCPUs, - "tracing_enabled": cfg.Tracing.Enabled, - "tracing_endpoint": cfg.Tracing.Endpoint, - "tracing_collector": cfg.Tracing.Collector, - "tracing_service_name": "storage-public-links", + "max_cpus": cfg.Reva.StoragePublicLink.MaxCPUs, + "tracing_enabled": true, }, "shared": map[string]interface{}{ "jwt_secret": cfg.Reva.JWTSecret, diff --git a/pkg/command/storageroot.go b/pkg/command/storageroot.go index 346fcb9..a2fa370 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -89,7 +89,7 @@ func StorageRoot(cfg *config.Config) *cli.Command { "storageprovider": map[string]interface{}{ "driver": cfg.Reva.StorageRoot.Driver, "drivers": map[string]interface{}{ - "eoshome": map[string]interface{}{ + "eos": map[string]interface{}{ "namespace": cfg.Reva.Storages.EOS.Namespace, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, @@ -103,21 +103,17 @@ func StorageRoot(cfg *config.Config) *cli.Command { "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, "keytab": cfg.Reva.Storages.EOS.Keytab, "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "user_layout": cfg.Reva.Storages.EOS.UserLayout, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, + "user_layout": cfg.Reva.Storages.EOS.Layout, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - }, - "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Local.Root, - "share_folder": cfg.Reva.Storages.Local.ShareFolder, - "user_layout": cfg.Reva.Storages.Local.UserLayout, + "root": cfg.Reva.Storages.Local.Root, }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ @@ -129,10 +125,11 @@ func StorageRoot(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "mount_path": cfg.Reva.StorageRoot.MountPath, - "mount_id": cfg.Reva.StorageRoot.MountID, - "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, - "data_server_url": cfg.Reva.StorageRoot.DataServerURL, + "mount_path": cfg.Reva.StorageRoot.MountPath, + "mount_id": cfg.Reva.StorageRoot.MountID, + "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, + "data_server_url": cfg.Reva.StorageRoot.DataServerURL, + "enable_home_creation": cfg.Reva.StorageRoot.EnableHomeCreation, }, }, }, diff --git a/pkg/config/config.go b/pkg/config/config.go index 804a5b9..942b48b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -68,11 +68,12 @@ type Users struct { // StoragePort defines the available storage configuration. type StoragePort struct { Port - Driver string - MountPath string - MountID string - ExposeDataServer bool - DataServerURL string + Driver string + MountPath string + MountID string + ExposeDataServer bool + DataServerURL string + EnableHomeCreation bool // for HTTP ports with only one http service Prefix string @@ -84,7 +85,9 @@ type PublicStorage struct { StoragePort PublicShareProviderAddr string + StorageProviderAddr string UserProviderAddr string + MountID string } // StorageConfig combines all available storage driver configuration parts. @@ -142,6 +145,9 @@ type DriverEOS struct { // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. UseKeytab bool + // EnableHome enables the creation of home directories. + EnableHome bool + // SecProtocol specifies the xrootd security protocol to use between the server and EOS. SecProtocol string @@ -151,15 +157,13 @@ type DriverEOS struct { // SingleUsername is the username to use when SingleUserMode is enabled SingleUsername string - // UserLayout of the users home dir path - UserLayout string + // Layout of the users home dir path + Layout string } // DriverLocal defines the available local storage driver configuration. type DriverLocal struct { - Root string - ShareFolder string - UserLayout string + Root string } // DriverOwnCloud defines the available ownCloud storage driver configuration. @@ -168,6 +172,7 @@ type DriverOwnCloud struct { Layout string Redis string Scan bool + EnableHome bool } // DriverS3 defines the available S3 storage driver configuration. diff --git a/pkg/flagset/common.go b/pkg/flagset/common.go deleted file mode 100644 index ad3c1e8..0000000 --- a/pkg/flagset/common.go +++ /dev/null @@ -1,93 +0,0 @@ -package flagset - -import ( - "github.com/micro/cli/v2" - "github.com/owncloud/ocis-reva/pkg/config" -) - -func commonTracingWithConfig(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, - }, - } -} - -func commonDebugWithConfig(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, - }, - } -} - -func commonSecretWithConfig(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, - }, - } -} - -func commonGatewayWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - &cli.StringFlag{ - Name: "gateway-url", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_GATEWAY_URL"}, - Destination: &cfg.Reva.Gateway.URL, - }, - } -} diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 1d80b5f..73b59be 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -189,7 +189,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "frontend-url", Value: "https://localhost:9200", - Usage: "URL to use for the frontend service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_FRONTEND_URL"}, Destination: &cfg.Reva.Frontend.URL, }, @@ -203,28 +203,28 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "users-url", Value: "localhost:9144", - Usage: "URL to use for the users service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_USERS_URL"}, Destination: &cfg.Reva.Users.URL, }, &cli.StringFlag{ Name: "auth-basic-url", Value: "localhost:9146", - Usage: "URL to use for the auth basic service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_AUTH_BASIC_URL"}, Destination: &cfg.Reva.AuthBasic.URL, }, &cli.StringFlag{ Name: "auth-bearer-url", Value: "localhost:9148", - Usage: "URL to use for the auth bearer service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_AUTH_BEARER_URL"}, Destination: &cfg.Reva.AuthBearer.URL, }, &cli.StringFlag{ Name: "sharing-url", Value: "localhost:9150", - Usage: "URL to use for the sharing service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_SHARING_URL"}, Destination: &cfg.Reva.Sharing.URL, }, @@ -232,21 +232,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-root-url", Value: "localhost:9152", - Usage: "URL to use for the root storage service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_STORAGE_ROOT_URL"}, Destination: &cfg.Reva.StorageRoot.URL, }, &cli.StringFlag{ Name: "storage-root-mount-path", Value: "/", - Usage: "root storage mount path", + Usage: "mount path", EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_PATH"}, Destination: &cfg.Reva.StorageRoot.MountPath, }, &cli.StringFlag{ Name: "storage-root-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009152", - Usage: "root storage mount id", + Usage: "mount id", EnvVars: []string{"REVA_STORAGE_ROOT_MOUNT_ID"}, Destination: &cfg.Reva.StorageRoot.MountID, }, @@ -254,14 +254,14 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-home-url", Value: "localhost:9154", - Usage: "URL to use for the home storage service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_STORAGE_HOME_URL"}, Destination: &cfg.Reva.StorageHome.URL, }, &cli.StringFlag{ Name: "storage-home-mount-path", Value: "/home", - Usage: "home storage mount path", + Usage: "mount path", EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_PATH"}, Destination: &cfg.Reva.StorageHome.MountPath, }, @@ -270,21 +270,21 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-eos-url", Value: "localhost:9158", - Usage: "URL to use for the eos storage service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_STORAGE_EOS_URL"}, Destination: &cfg.Reva.StorageEOS.URL, }, &cli.StringFlag{ Name: "storage-eos-mount-path", Value: "/eos", - Usage: "eos storage mount path", + Usage: "mount path", EnvVars: []string{"REVA_STORAGE_EOS_MOUNT_PATH"}, Destination: &cfg.Reva.StorageEOS.MountPath, }, &cli.StringFlag{ Name: "storage-eos-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009158", - Usage: "eos storage mount id", + Usage: "mount id", EnvVars: []string{"REVA_STORAGE_EOS_MOUNT_ID"}, Destination: &cfg.Reva.StorageEOS.MountID, }, @@ -292,45 +292,30 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "storage-oc-url", Value: "localhost:9162", - Usage: "URL to use for the oc storage service", + Usage: "URL to use for the reva service", EnvVars: []string{"REVA_STORAGE_OC_URL"}, Destination: &cfg.Reva.StorageOC.URL, }, &cli.StringFlag{ Name: "storage-oc-mount-path", Value: "/oc", - Usage: "oc storage mount path", + Usage: "mount path", EnvVars: []string{"REVA_STORAGE_OC_MOUNT_PATH"}, Destination: &cfg.Reva.StorageOC.MountPath, }, &cli.StringFlag{ Name: "storage-oc-mount-id", Value: "1284d238-aa92-42ce-bdc4-0b0000009162", - Usage: "oc storage mount id", + Usage: "mount id", EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"}, Destination: &cfg.Reva.StorageOC.MountID, }, - &cli.StringFlag{ Name: "public-links-url", - Value: "localhost:9170", + 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: "public-links-mount-path", - Value: "/public/", - Usage: "public links storage mount path", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, - Destination: &cfg.Reva.StoragePublicLink.MountPath, - }, - &cli.StringFlag{ - Name: "public-links-mount-id", - Value: "e1a73ede-549b-4226-abdf-40e69ca8230d", - Usage: "public links storage mount id", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_ID"}, - Destination: &cfg.Reva.StoragePublicLink.MountID, - }, } } diff --git a/pkg/flagset/storagedrivers.go b/pkg/flagset/storagedrivers.go deleted file mode 100644 index f8dc127..0000000 --- a/pkg/flagset/storagedrivers.go +++ /dev/null @@ -1,178 +0,0 @@ -package flagset - -import ( - "os" - - "github.com/micro/cli/v2" - "github.com/owncloud/ocis-reva/pkg/config" -) - -// StorageDriversWithConfig applies cfg to the root flagset -func storageDriversWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - // 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", - Value: true, - 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.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-user-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users internal home dir path, in addition to {{.Username}}, and {{.Mail}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_USER_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.UserLayout, - }, - - // 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, - }, - &cli.StringFlag{ - Name: "storage-local-share-folder", - Value: "/MyShares", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_LOCAL_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.Local.UserLayout, - }, - &cli.StringFlag{ - Name: "storage-local-user-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users internal home dir path, in addition to {{.Username}}, and {{.Mail}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, - EnvVars: []string{"REVA_STORAGE_LOCAL_USER_LAYOUT"}, - Destination: &cfg.Reva.Storages.Local.UserLayout, - }, - - // 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.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.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_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - } -} diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index 8247b17..e302832 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -1,21 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + 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, + }, + + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9159", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonSecretWithConfig(cfg)...) + // REVA - flags = append(flags, commonDebugWithConfig(cfg)...) + &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, + }, - flags = append(flags, storageDriversWithConfig(cfg)...) + // Services - flags = append(flags, + // Storage oc &cli.StringFlag{ Name: "network", @@ -38,13 +109,6 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_ADDR"}, Destination: &cfg.Reva.StorageEOS.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9159", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_EOS_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageEOS.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9158", @@ -58,9 +122,10 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service storageprovider [--service otherservice]", EnvVars: []string{"REVA_STORAGE_EOS_SERVICES"}, }, + &cli.StringFlag{ Name: "driver", - Value: "eoshome", + Value: "eos", Usage: "storage driver, eg. local, eos, owncloud or s3", EnvVars: []string{"REVA_STORAGE_EOS_DRIVER"}, Destination: &cfg.Reva.StorageEOS.Driver, @@ -93,7 +158,176 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageEOS.DataServerURL, }, - ) + &cli.BoolFlag{ + Name: "enable-home-creation", + Value: false, + Usage: "if enabled home dirs will be automatically created", + 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, + }, + + // 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 - return flags + &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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + } } diff --git a/pkg/flagset/storageeosdata.go b/pkg/flagset/storageeosdata.go index 583f577..10d651c 100644 --- a/pkg/flagset/storageeosdata.go +++ b/pkg/flagset/storageeosdata.go @@ -1,23 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + return []cli.Flag{ - flags = append(flags, commonGatewayWithConfig(cfg)...) + &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 = append(flags, commonSecretWithConfig(cfg)...) + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9161", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonDebugWithConfig(cfg)...) + // REVA - flags = append(flags, storageDriversWithConfig(cfg)...) + &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 - flags = append(flags, + // Storage eos data &cli.StringFlag{ Name: "network", @@ -40,13 +109,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_ADDR"}, Destination: &cfg.Reva.StorageEOSData.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9161", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageEOSData.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9160", @@ -62,7 +124,7 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "driver", - Value: "eoshome", + Value: "eos", Usage: "storage driver, eg. local, eos, owncloud or s3", EnvVars: []string{"REVA_STORAGE_EOS_DATA_DRIVER"}, Destination: &cfg.Reva.StorageEOSData.Driver, @@ -81,6 +143,179 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DATA_TEMP_FOLDER"}, Destination: &cfg.Reva.StorageEOSData.TempFolder, }, - ) - return flags + + // 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, + }, + + // 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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + + // Gateway + + &cli.StringFlag{ + Name: "gateway-url", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_GATEWAY_URL"}, + Destination: &cfg.Reva.Gateway.URL, + }, + } } diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 6737f34..4c5cc8d 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -1,21 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + return []cli.Flag{ - flags = append(flags, commonSecretWithConfig(cfg)...) + &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 = append(flags, commonDebugWithConfig(cfg)...) + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9155", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, storageDriversWithConfig(cfg)...) + // Services - flags = append(flags, + // Storage home &cli.StringFlag{ Name: "network", @@ -38,13 +109,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_ADDR"}, Destination: &cfg.Reva.StorageHome.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9155", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_HOME_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageHome.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9154", @@ -96,7 +160,177 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageHome.DataServerURL, }, - ) + &cli.BoolFlag{ + Name: "enable-home-creation", + Value: true, + Usage: "if enabled home dirs will be automatically created", + EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"}, + Destination: &cfg.Reva.StorageHome.EnableHomeCreation, + }, - return flags + // 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, + }, + + // 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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + } } diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 026b166..8b8393a 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -1,23 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + 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 = append(flags, commonGatewayWithConfig(cfg)...) + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9157", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonSecretWithConfig(cfg)...) + // REVA - flags = append(flags, commonDebugWithConfig(cfg)...) + &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, + }, - flags = append(flags, storageDriversWithConfig(cfg)...) + // Services - flags = append(flags, + // Storage home data &cli.StringFlag{ Name: "network", @@ -40,13 +109,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_ADDR"}, Destination: &cfg.Reva.StorageHomeData.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9157", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_HOME_DATA_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageHomeData.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9156", @@ -81,7 +143,180 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_TEMP_FOLDER"}, Destination: &cfg.Reva.StorageHomeData.TempFolder, }, - ) - return flags + // 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, + }, + + // 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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + + // Gateway + + &cli.StringFlag{ + Name: "gateway-url", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_GATEWAY_URL"}, + Destination: &cfg.Reva.Gateway.URL, + }, + } } diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index c8322db..62d58bc 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -1,21 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + 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, + }, + + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9163", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonSecretWithConfig(cfg)...) + // REVA - flags = append(flags, commonDebugWithConfig(cfg)...) + &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, + }, - flags = append(flags, storageDriversWithConfig(cfg)...) + // Services - flags = append(flags, + // Storage oc &cli.StringFlag{ Name: "network", @@ -38,13 +109,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_ADDR"}, Destination: &cfg.Reva.StorageOC.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9163", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_OC_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageOC.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9162", @@ -58,6 +122,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service storageprovider [--service otherservice]", EnvVars: []string{"REVA_STORAGE_OC_SERVICES"}, }, + &cli.StringFlag{ Name: "driver", Value: "owncloud", @@ -93,7 +158,179 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageOC.DataServerURL, }, - ) + &cli.BoolFlag{ + Name: "enable-home-creation", + Value: false, + Usage: "if enabled home dirs will be automatically created", + EnvVars: []string{"REVA_STORAGE_OC_ENABLE_HOME_CREATION"}, + 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, + }, + + // 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 - return flags + &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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + } } diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index a228d71..bb2a645 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -1,23 +1,93 @@ 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 { - flags := commonTracingWithConfig(cfg) + return []cli.Flag{ - flags = append(flags, commonGatewayWithConfig(cfg)...) + &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 = append(flags, commonSecretWithConfig(cfg)...) + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9165", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonDebugWithConfig(cfg)...) + // REVA - flags = append(flags, storageDriversWithConfig(cfg)...) + &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 data - flags = append(flags, &cli.StringFlag{ Name: "network", Value: "tcp", @@ -39,13 +109,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_ADDR"}, Destination: &cfg.Reva.StorageOCData.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9165", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageOCData.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9164", @@ -80,7 +143,182 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_TEMP_FOLDER"}, Destination: &cfg.Reva.StorageOCData.TempFolder, }, - ) - return flags + // 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, + }, + + // 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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + + // Gateway + + &cli.StringFlag{ + Name: "gateway-url", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_GATEWAY_URL"}, + Destination: &cfg.Reva.Gateway.URL, + }, + } } diff --git a/pkg/flagset/storagepubliclink.go b/pkg/flagset/storagepubliclink.go index 3d0d57f..a665d95 100644 --- a/pkg/flagset/storagepubliclink.go +++ b/pkg/flagset/storagepubliclink.go @@ -7,17 +7,74 @@ import ( // StoragePublicLink applies cfg to the root flagset func StoragePublicLink(cfg *config.Config) []cli.Flag { - flags := commonTracingWithConfig(cfg) - - flags = append(flags, commonGatewayWithConfig(cfg)...) - - flags = append(flags, commonSecretWithConfig(cfg)...) - - flags = append(flags, commonDebugWithConfig(cfg)...) - - flags = append(flags, storageDriversWithConfig(cfg)...) - - flags = append(flags, + 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, + }, + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:10053", + 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", @@ -34,25 +91,11 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: "0.0.0.0:9170", + Value: "localhost:10054", Usage: "Address to bind reva service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9171", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR"}, - Destination: &cfg.Reva.StoragePublicLink.DebugAddr, - }, - &cli.StringFlag{ - Name: "url", - Value: "localhost:9170", - Usage: "URL to use for the reva service", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, - Destination: &cfg.Reva.StoragePublicLink.URL, - }, &cli.StringSliceFlag{ Name: "service", Value: cli.NewStringSlice("storageprovider"), @@ -75,11 +118,18 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StoragePublicLink.UserProviderAddr, }, &cli.StringFlag{ - Name: "mount-path", - Value: "/public/", - Usage: "mount path", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, - Destination: &cfg.Reva.StoragePublicLink.MountPath, + 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", @@ -95,8 +145,33 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER"}, Destination: &cfg.Reva.StoragePublicLink.ExposeDataServer, }, - // has no data provider, only redirects to the actual storage - ) - - return flags + &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/", + Usage: "mount path", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, + Destination: &cfg.Reva.StoragePublicLink.MountPath, + }, + &cli.StringFlag{ + Name: "gateway-url", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_GATEWAY_URL"}, + Destination: &cfg.Reva.Gateway.URL, + }, + } } diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 03a6cc7..31b136d 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -1,21 +1,92 @@ 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 { - flags := commonTracingWithConfig(cfg) + 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, + }, + + // debug ports are the odd ports + &cli.StringFlag{ + Name: "debug-addr", + Value: "0.0.0.0:9153", + Usage: "Address to bind debug server", + 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, + }, - flags = append(flags, commonSecretWithConfig(cfg)...) + // REVA - flags = append(flags, commonDebugWithConfig(cfg)...) + &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, + }, - flags = append(flags, storageDriversWithConfig(cfg)...) + // Services - flags = append(flags, + // Storage root &cli.StringFlag{ Name: "network", @@ -38,13 +109,6 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_ADDR"}, Destination: &cfg.Reva.StorageRoot.Addr, }, - &cli.StringFlag{ - Name: "debug-addr", - Value: "0.0.0.0:9153", - Usage: "Address to bind debug server", - EnvVars: []string{"REVA_STORAGE_ROOT_DEBUG_ADDR"}, - Destination: &cfg.Reva.StorageRoot.DebugAddr, - }, &cli.StringFlag{ Name: "url", Value: "localhost:9152", @@ -93,7 +157,164 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_DATA_SERVER_URL"}, Destination: &cfg.Reva.StorageRoot.DataServerURL, }, - ) + &cli.BoolFlag{ + Name: "enable-home-creation", + Usage: "if enabled home dirs will be automatically created", + 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, + }, + + // 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, + }, - return flags + // 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: "{{.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_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.OwnCloud.Layout, + }, + } } From 24b547178292a205bfc2808a3e94eeb2f5858174 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Jun 2020 11:38:38 +0200 Subject: [PATCH 17/19] Prettify reva-server log output --- .drone.star | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.drone.star b/.drone.star index d30b4a8..74a8cdf 100644 --- a/.drone.star +++ b/.drone.star @@ -286,16 +286,16 @@ def testing(ctx): }, 'commands': [ 'mkdir -p /srv/app/tmp/reva', - 'bin/ocis-reva gateway &', - 'bin/ocis-reva users &', - 'bin/ocis-reva auth-basic &', - 'bin/ocis-reva auth-bearer &', - 'bin/ocis-reva sharing &', - 'bin/ocis-reva storage-home &', - 'bin/ocis-reva storage-home-data &', - 'bin/ocis-reva storage-oc &', - 'bin/ocis-reva storage-oc-data &', - 'bin/ocis-reva frontend' + 'bin/ocis-reva --log-level debug --log-pretty gateway &', + 'bin/ocis-reva --log-level debug --log-pretty users &', + 'bin/ocis-reva --log-level debug --log-pretty auth-basic &', + 'bin/ocis-reva --log-level debug --log-pretty auth-bearer &', + 'bin/ocis-reva --log-level debug --log-pretty sharing &', + 'bin/ocis-reva --log-level debug --log-pretty storage-home &', + 'bin/ocis-reva --log-level debug --log-pretty storage-home-data &', + 'bin/ocis-reva --log-level debug --log-pretty storage-oc &', + 'bin/ocis-reva --log-level debug --log-pretty storage-oc-data &', + 'bin/ocis-reva --log-level debug --log-pretty frontend' ], 'volumes': [ { From 78d4063d116d139e5360be9c84f12b17691aa9b5 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Jun 2020 11:45:58 +0200 Subject: [PATCH 18/19] Add public link service to Drone --- .drone.star | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.drone.star b/.drone.star index 74a8cdf..8fe2fb0 100644 --- a/.drone.star +++ b/.drone.star @@ -72,16 +72,17 @@ def apiTests(ctx, coreBranch = 'master', coreCommit = ''): 'commands': [ 'apk add mailcap', 'mkdir -p /srv/app/tmp/reva', - 'bin/ocis-reva gateway &', - 'bin/ocis-reva users &', - 'bin/ocis-reva auth-basic &', - 'bin/ocis-reva auth-bearer &', - 'bin/ocis-reva sharing &', - 'bin/ocis-reva storage-home &', - 'bin/ocis-reva storage-home-data &', - 'bin/ocis-reva storage-oc &', - 'bin/ocis-reva storage-oc-data &', - 'bin/ocis-reva frontend' + 'bin/ocis-reva --log-level debug --log-pretty gateway &', + 'bin/ocis-reva --log-level debug --log-pretty users &', + 'bin/ocis-reva --log-level debug --log-pretty auth-basic &', + 'bin/ocis-reva --log-level debug --log-pretty auth-bearer &', + 'bin/ocis-reva --log-level debug --log-pretty sharing &', + 'bin/ocis-reva --log-level debug --log-pretty storage-home &', + 'bin/ocis-reva --log-level debug --log-pretty storage-home-data &', + 'bin/ocis-reva --log-level debug --log-pretty storage-oc &', + 'bin/ocis-reva --log-level debug --log-pretty storage-oc-data &', + 'bin/ocis-reva --log-level debug --log-pretty frontend &', + 'bin/ocis-reva --log-level debug --log-pretty reva-storage-public-link' ], 'volumes': [ { @@ -295,7 +296,8 @@ def testing(ctx): 'bin/ocis-reva --log-level debug --log-pretty storage-home-data &', 'bin/ocis-reva --log-level debug --log-pretty storage-oc &', 'bin/ocis-reva --log-level debug --log-pretty storage-oc-data &', - 'bin/ocis-reva --log-level debug --log-pretty frontend' + 'bin/ocis-reva --log-level debug --log-pretty frontend &', + 'bin/ocis-reva --log-level debug --log-pretty reva-storage-public-link' ], 'volumes': [ { From b53f4a93641c3584ecac2a60ff9aece9e92e26af Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 26 Jun 2020 12:00:01 +0200 Subject: [PATCH 19/19] Update Drone API tests commit for public links --- .drone.star | 2 +- go.sum | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 8fe2fb0..6c03e65 100644 --- a/.drone.star +++ b/.drone.star @@ -1,7 +1,7 @@ def main(ctx): before = [ testing(ctx), - apiTests(ctx, 'tests-adjust-public-share-test-issues', '9d143b41bda3d5c2bb265a220d0c5dfe8eb584f9'), + apiTests(ctx, 'master', 'ad274cb7f2a20ffba7fb9c65726ae9ef9270e4c0'), ] stages = [ diff --git a/go.sum b/go.sum index e790e10..1f87603 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,7 @@ github.com/aws/aws-sdk-go v1.32.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.32.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.32.9 h1:ai+NZsCV+Z97+jqIKya49gbCObOay9FKww0/VCNuXug= github.com/aws/aws-sdk-go v1.32.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.32.10 h1:cEJTxGcBGlsM2tN36MZQKhlK93O9HrnaRs+lq2f0zN8= github.com/aws/aws-sdk-go v1.32.10/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=