From 1e0ba1fe7420e536aaf4526043b15c1c719b08e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 12 Feb 2020 20:46:45 +0100 Subject: [PATCH] update reva MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 3 +- go.sum | 16 ++ pkg/command/authbasic.go | 14 +- pkg/command/authbearer.go | 14 +- pkg/command/frontend.go | 58 +--- pkg/command/gateway.go | 31 +- pkg/command/sharing.go | 14 +- pkg/command/storagehome.go | 30 +- pkg/command/storagehomedata.go | 18 +- pkg/command/storageoc.go | 31 +- pkg/command/storageocdata.go | 18 +- pkg/command/storageroot.go | 30 +- pkg/command/users.go | 14 +- pkg/config/config.go | 15 +- pkg/flagset/gateway.go | 27 +- pkg/flagset/server.go | 507 --------------------------------- pkg/flagset/storagehome.go | 34 ++- pkg/flagset/storagehomedata.go | 27 +- pkg/flagset/storageoc.go | 34 ++- pkg/flagset/storageocdata.go | 27 +- pkg/flagset/storageroot.go | 33 ++- 21 files changed, 238 insertions(+), 757 deletions(-) delete mode 100644 pkg/flagset/server.go diff --git a/go.mod b/go.mod index c03d8ce..7b17d21 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,7 @@ go 1.13 require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cs3org/go-cs3apis v0.0.0-20191218073906-e3405ff6775e // indirect - github.com/cs3org/reva v0.0.2-0.20200115110931-4c7513415ec5 + github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b github.com/gofrs/uuid v3.2.0+incompatible github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/micro/cli/v2 v2.1.1 diff --git a/go.sum b/go.sum index c65fd61..783d3a3 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,8 @@ github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee/go.mod h1:u7Wtt github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.28.2 h1:j5IXG9CdyLfcVfICqo1PXVv+rua+QQHbkXuvuU/JF+8= github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.28.13 h1:JyCQQ86yil3hg7MtWdNH8Pbcgx92qlUV2v22Km63Mf4= +github.com/aws/aws-sdk-go v1.28.13/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= 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= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -109,12 +111,15 @@ github.com/coreos/etcd v3.3.17+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-oidc v2.1.0+incompatible h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= +github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= @@ -125,8 +130,12 @@ github.com/cs3org/go-cs3apis v0.0.0-20191128165347-19746c015c83 h1:9bcp1jc6+36XU github.com/cs3org/go-cs3apis v0.0.0-20191128165347-19746c015c83/go.mod h1:IsVGyZrOLUQD48JIhlM/xb3Vz6He5o2+W0ZTfUGY+IU= github.com/cs3org/go-cs3apis v0.0.0-20191218073906-e3405ff6775e h1:cPcpOoPLdsIV2Bw1xMJCIw4ZAejtQqA6J0U56YHOJeQ= github.com/cs3org/go-cs3apis v0.0.0-20191218073906-e3405ff6775e/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/go-cs3apis v0.0.0-20200115100126-824a5f718250 h1:N/WWs9OegcgFlsUo7/iahxq+e3luhZKu0B8wLrWBsTQ= +github.com/cs3org/go-cs3apis v0.0.0-20200115100126-824a5f718250/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva v0.0.2-0.20200115110931-4c7513415ec5 h1:PkGon9KVtcApu462KRAmFV3iKHOk0S0CRoEzoar4eyE= github.com/cs3org/reva v0.0.2-0.20200115110931-4c7513415ec5/go.mod h1:Hk3eCcdhtv4eIhKvRK736fQuOyS1HuHnUcz0Dq6NK1A= +github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b h1:8kfSFbzmolP/ZAm455PsAjD5qSqpESryEjpK0ceAWS0= +github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b/go.mod h1:/Sg6MOumvaYkxRJJNZ0c8AvDJe+sn7MJnnxJfwY2MhE= 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= @@ -185,6 +194,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -208,6 +218,8 @@ github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -571,6 +583,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= 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.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= go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= @@ -785,6 +799,8 @@ google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= diff --git a/pkg/command/authbasic.go b/pkg/command/authbasic.go index f68478d..04d8dff 100644 --- a/pkg/command/authbasic.go +++ b/pkg/command/authbasic.go @@ -75,20 +75,12 @@ func AuthBasic(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.AuthBasic.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.AuthBasic.Network, "address": cfg.Reva.AuthBasic.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "authprovider": map[string]interface{}{ diff --git a/pkg/command/authbearer.go b/pkg/command/authbearer.go index 299afb4..06c8f4a 100644 --- a/pkg/command/authbearer.go +++ b/pkg/command/authbearer.go @@ -75,20 +75,12 @@ func AuthBearer(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.AuthBearer.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.AuthBearer.Network, "address": cfg.Reva.AuthBearer.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "authprovider": map[string]interface{}{ diff --git a/pkg/command/frontend.go b/pkg/command/frontend.go index ed08952..499c4ec 100644 --- a/pkg/command/frontend.go +++ b/pkg/command/frontend.go @@ -82,60 +82,21 @@ func Frontend(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.Frontend.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + "gatewaysvc": cfg.Reva.Gateway.URL, // Todo or address? + }, "http": map[string]interface{}{ "network": cfg.Reva.Frontend.Network, "address": cfg.Reva.Frontend.Addr, "middlewares": map[string]interface{}{ - "auth": map[string]interface{}{ - "gateway": cfg.Reva.Gateway.URL, - "credential_chain": []string{"basic", "bearer"}, - "token_strategy": "header", - "token_writer": "header", - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, "cors": map[string]interface{}{ - "allowed_origins": []string{"*"}, - "allowed_methods": []string{ - "OPTIONS", - "GET", - "PUT", - "POST", - "DELETE", - "MKCOL", - "PROPFIND", - "PROPPATCH", - "MOVE", - "COPY", - "REPORT", - "SEARCH", - }, - "allowed_headers": []string{ - "Origin", - "Accept", - "Depth", - "Content-Type", - "X-Requested-With", - "Authorization", - "Ocs-Apirequest", - "If-Match", - "If-None-Match", - "Destination", - "Overwrite", - }, - "allow_credentials": true, - "options_passthrough": false, + "allow_credentials": true, }, }, // TODO build services dynamically "services": map[string]interface{}{ "datagateway": map[string]interface{}{ - "prefix": "data", - "gateway": "", // TODO not needed? "transfer_shared_secret": cfg.Reva.TransferSecret, }, "wellknown": map[string]interface{}{ @@ -147,9 +108,8 @@ func Frontend(cfg *config.Config) *cli.Command { "userinfo_endpoint": cfg.Reva.OIDC.Issuer + "/oauth2/userinfo", }, "oidcprovider": map[string]interface{}{ - "prefix": "oauth2", - "gateway": cfg.Reva.Gateway.URL, - "issuer": cfg.Reva.OIDC.Issuer, + "prefix": "oauth2", + "issuer": cfg.Reva.OIDC.Issuer, "clients": map[string]interface{}{ // TODO make these configurable // note: always use authorization code flow, see https://developer.okta.com/blog/2019/05/01/is-the-oauth-implicit-flow-dead for details @@ -185,13 +145,11 @@ func Frontend(cfg *config.Config) *cli.Command { }, "ocdav": map[string]interface{}{ "prefix": "", - "chunk_folder": "/var/tmp/revad/chunks", - "gateway": cfg.Reva.Gateway.URL, + "chunk_folder": "/var/tmp/reva/chunks", "files_namespace": cfg.Reva.OCDav.DavFilesNamespace, "webdav_namespace": cfg.Reva.OCDav.WebdavNamespace, }, "ocs": map[string]interface{}{ - "gateway": cfg.Reva.Gateway.URL, "config": map[string]interface{}{ "version": "1.8", "website": "reva", diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index 9019597..4425e32 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -75,20 +75,13 @@ func Gateway(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.Gateway.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + "gatewaysvc": cfg.Reva.Gateway.URL, // Todo or address? + }, "grpc": map[string]interface{}{ "network": cfg.Reva.Gateway.Network, "address": cfg.Reva.Gateway.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "gateway": map[string]interface{}{ @@ -104,16 +97,13 @@ func Gateway(cfg *config.Config) *cli.Command { "publicshareprovidersvc": cfg.Reva.Sharing.URL, "ocmshareprovidersvc": cfg.Reva.Sharing.URL, "commit_share_to_storage_grant": cfg.Reva.Gateway.CommitShareToStorageGrant, + "commit_share_to_storage_ref": cfg.Reva.Gateway.CommitShareToStorageRef, + "share_folder": cfg.Reva.Gateway.ShareFolder, // ShareFolder is the location where to create shares in the recipient's storage provider. // other - "datagateway": cfg.Reva.Frontend.URL, - "transfer_shared_secret": cfg.Reva.TransferSecret, - "transfer_expires": cfg.Reva.TransferExpires, - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, + "disable_home_creation_on_login": cfg.Reva.Gateway.DisableHomeCreationOnLogin, + "datagateway": cfg.Reva.Frontend.URL, + "transfer_shared_secret": cfg.Reva.TransferSecret, + "transfer_expires": cfg.Reva.TransferExpires, }, "authregistry": map[string]interface{}{ "driver": "static", @@ -130,6 +120,7 @@ func Gateway(cfg *config.Config) *cli.Command { "driver": "static", "drivers": map[string]interface{}{ "static": map[string]interface{}{ + "home_provider": cfg.Reva.StorageHome.MountPath, "rules": map[string]interface{}{ cfg.Reva.StorageRoot.MountPath: cfg.Reva.StorageRoot.URL, cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, diff --git a/pkg/command/sharing.go b/pkg/command/sharing.go index 123f830..c40e494 100644 --- a/pkg/command/sharing.go +++ b/pkg/command/sharing.go @@ -75,20 +75,12 @@ func Sharing(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.Sharing.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.Sharing.Network, "address": cfg.Reva.Sharing.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "usershareprovider": map[string]interface{}{ diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index 0cc879f..3a09488 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -74,20 +74,12 @@ func StorageHome(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.StorageHome.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.StorageHome.Network, "address": cfg.Reva.StorageHome.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ @@ -114,7 +106,6 @@ func StorageHome(cfg *config.Config) *cli.Command { "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, - "autocreate": cfg.Reva.Storages.OwnCloud.Autocreate, "redis": cfg.Reva.Storages.OwnCloud.Redis, }, "s3": map[string]interface{}{ @@ -126,21 +117,18 @@ func StorageHome(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "path_wrapper": cfg.Reva.StorageHome.PathWrapper, + "mount_path": cfg.Reva.StorageHome.MountPath, + "mount_id": cfg.Reva.StorageHome.MountID, + "expose_data_server": cfg.Reva.StorageHome.ExposeDataServer, + "path_wrapper": cfg.Reva.StorageHome.PathWrapper, "path_wrappers": map[string]interface{}{ "context": map[string]interface{}{ "prefix": cfg.Reva.StorageHome.PathWrapperContext.Prefix, }, }, - "mount_path": cfg.Reva.StorageHome.MountPath, - "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, - "available_checksums": map[string]interface{}{ - "md5": 100, - "unset": 1000, - }, + "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 d4166e0..68f2772 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -74,23 +74,12 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.StorageHomeData.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "http": map[string]interface{}{ "network": cfg.Reva.StorageHomeData.Network, "address": cfg.Reva.StorageHomeData.Addr, - "middlewares": map[string]interface{}{ - "auth": map[string]interface{}{ - "gateway": cfg.Reva.Gateway.URL, - "credential_chain": []string{"basic", "bearer"}, - "token_strategy": "header", - "token_writer": "header", - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "dataprovider": map[string]interface{}{ @@ -118,7 +107,6 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, - "autocreate": cfg.Reva.Storages.OwnCloud.Autocreate, "redis": cfg.Reva.Storages.OwnCloud.Redis, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storageoc.go b/pkg/command/storageoc.go index ceccc52..266a68c 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -74,20 +74,12 @@ func StorageOC(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.StorageOC.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.StorageOC.Network, "address": cfg.Reva.StorageOC.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ @@ -114,8 +106,8 @@ func StorageOC(cfg *config.Config) *cli.Command { "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, - "autocreate": cfg.Reva.Storages.OwnCloud.Autocreate, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, @@ -126,21 +118,18 @@ func StorageOC(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "path_wrapper": cfg.Reva.StorageOC.PathWrapper, + "mount_path": cfg.Reva.StorageOC.MountPath, + "mount_id": cfg.Reva.StorageOC.MountID, + "expose_data_server": cfg.Reva.StorageOC.ExposeDataServer, + "path_wrapper": cfg.Reva.StorageOC.PathWrapper, "path_wrappers": map[string]interface{}{ "context": map[string]interface{}{ "prefix": cfg.Reva.StorageOC.PathWrapperContext.Prefix, }, }, - "mount_path": cfg.Reva.StorageOC.MountPath, - "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, - "available_checksums": map[string]interface{}{ - "md5": 100, - "unset": 1000, - }, + "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 15e06fe..994d51d 100644 --- a/pkg/command/storageocdata.go +++ b/pkg/command/storageocdata.go @@ -74,23 +74,12 @@ func StorageOCData(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.StorageOCData.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "http": map[string]interface{}{ "network": cfg.Reva.StorageOCData.Network, "address": cfg.Reva.StorageOCData.Addr, - "middlewares": map[string]interface{}{ - "auth": map[string]interface{}{ - "gateway": cfg.Reva.Gateway.URL, - "credential_chain": []string{"basic", "bearer"}, - "token_strategy": "header", - "token_writer": "header", - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "dataprovider": map[string]interface{}{ @@ -118,7 +107,6 @@ func StorageOCData(cfg *config.Config) *cli.Command { "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, - "autocreate": cfg.Reva.Storages.OwnCloud.Autocreate, "redis": cfg.Reva.Storages.OwnCloud.Redis, }, "s3": map[string]interface{}{ diff --git a/pkg/command/storageroot.go b/pkg/command/storageroot.go index 707c90d..8b20019 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -74,20 +74,12 @@ func StorageRoot(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.StorageRoot.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.StorageRoot.Network, "address": cfg.Reva.StorageRoot.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ @@ -114,7 +106,6 @@ func StorageRoot(cfg *config.Config) *cli.Command { "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, - "autocreate": cfg.Reva.Storages.OwnCloud.Autocreate, "redis": cfg.Reva.Storages.OwnCloud.Redis, }, "s3": map[string]interface{}{ @@ -126,20 +117,17 @@ func StorageRoot(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "path_wrapper": cfg.Reva.StorageRoot.PathWrapper, + "mount_path": cfg.Reva.StorageRoot.MountPath, + "mount_id": cfg.Reva.StorageRoot.MountID, + "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, + "path_wrapper": cfg.Reva.StorageRoot.PathWrapper, "path_wrappers": map[string]interface{}{ "context": map[string]interface{}{ "prefix": cfg.Reva.StorageRoot.PathWrapperContext.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, - "available_checksums": map[string]interface{}{ - "md5": 100, - "unset": 1000, - }, + "data_server_url": cfg.Reva.StorageRoot.DataServerURL, + "enable_home_creation": cfg.Reva.StorageRoot.EnableHomeCreation, }, }, }, diff --git a/pkg/command/users.go b/pkg/command/users.go index 1868225..cfc2bc2 100644 --- a/pkg/command/users.go +++ b/pkg/command/users.go @@ -74,20 +74,12 @@ func Users(cfg *config.Config) *cli.Command { "core": map[string]interface{}{ "max_cpus": cfg.Reva.Users.MaxCPUs, }, + "shared": map[string]interface{}{ + "jwt_secret": cfg.Reva.JWTSecret, + }, "grpc": map[string]interface{}{ "network": cfg.Reva.Users.Network, "address": cfg.Reva.Users.Addr, - // TODO extract interceptor config, which is the same for all grpc services - "interceptors": map[string]interface{}{ - "auth": map[string]interface{}{ - "token_manager": "jwt", - "token_managers": map[string]interface{}{ - "jwt": map[string]interface{}{ - "secret": cfg.Reva.JWTSecret, - }, - }, - }, - }, // TODO build services dynamically "services": map[string]interface{}{ "userprovider": map[string]interface{}{ diff --git a/pkg/config/config.go b/pkg/config/config.go index 1bdd621..d65d55c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -18,7 +18,10 @@ type Debug struct { // Gateway defines the available gateway configuration. type Gateway struct { Port - CommitShareToStorageGrant bool + CommitShareToStorageGrant bool + CommitShareToStorageRef bool + ShareFolder string + DisableHomeCreationOnLogin bool } // Port defines the available port configuration. @@ -65,7 +68,7 @@ type StoragePort struct { MountID string ExposeDataServer bool DataServerURL string - // TODO checksums ... figure out what that is supposed to do + EnableHomeCreation bool // for HTTP ports with only one http service Prefix string @@ -120,6 +123,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 @@ -128,6 +134,9 @@ type DriverEOS struct { // SingleUsername is the username to use when SingleUserMode is enabled SingleUsername string + + // Layout of the users home dir path + Layout string } // DriverLocal defines the available local storage driver configuration. @@ -139,8 +148,8 @@ type DriverLocal struct { type DriverOwnCloud struct { Datadirectory string Scan bool - Autocreate bool Redis string + Layout string } // DriverS3 defines the available S3 storage driver configuration. diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 38bc3e0..0640c2e 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -136,13 +136,34 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service gateway [--service authregistry]", EnvVars: []string{"REVA_GATEWAY_SERVICES"}, }, - // TODO should defaults to true. reverse logic to 'disable-share-commit'? &cli.BoolFlag{ Name: "commit-share-to-storage-grant", - Usage: "Commit shares to the share manager as well as as a grant to the storage", - EnvVars: []string{"REVA_GATEWAY_COMMIT_SHARE_TO_STRORAGE_GRANT"}, + Value: true, + Usage: "Commit shares to the share manager", + EnvVars: []string{"REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_GRANT"}, Destination: &cfg.Reva.Gateway.CommitShareToStorageGrant, }, + &cli.BoolFlag{ + Name: "commit-share-to-storage-ref", + Value: true, + // TODO clarify + Usage: "Commit shares to the storage", + EnvVars: []string{"REVA_GATEWAY_COMMIT_SHARE_TO_STORAGE_REF"}, + Destination: &cfg.Reva.Gateway.CommitShareToStorageRef, + }, + &cli.StringFlag{ + Name: "share-folder", + Value: "/", + Usage: "mount shares in this folder of the home storage provider", + EnvVars: []string{"REVA_GATEWAY_SHARE_FOLDER"}, + Destination: &cfg.Reva.Gateway.ShareFolder, + }, + &cli.BoolFlag{ + Name: "disable-home-creation-on-login", + Usage: "Disable creation of home folder on login", + EnvVars: []string{"REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN"}, + Destination: &cfg.Reva.Gateway.DisableHomeCreationOnLogin, + }, // other services diff --git a/pkg/flagset/server.go b/pkg/flagset/server.go deleted file mode 100644 index db476b5..0000000 --- a/pkg/flagset/server.go +++ /dev/null @@ -1,507 +0,0 @@ -package flagset - -/* TODO move this into dedicated flagsets, along with storage commands - -import ( - "github.com/micro/cli" - "github.com/owncloud/ocis-reva/pkg/config" -) - -// ServerWithConfig applies cfg to the root flagset -func ServerWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - // debug ports are the odd ports - &cli.StringFlag{ - Name: "storage-eos-debug-addr", - Value: "0.0.0.0:9159", - Usage: "Address to bind storage eos debug server", - EnvVar: "REVA_STORAGE_EOS_DEBUG_ADDR", - Destination: &cfg.Reva.StorageEOS.DebugAddr, - }, - &cli.StringFlag{ - Name: "storage-eos-data-debug-addr", - Value: "0.0.0.0:9161", - Usage: "Address to bind storage eos data debug server", - EnvVar: "REVA_STORAGE_HOME_DATA_DEBUG_ADDR", - Destination: &cfg.Reva.StorageEOSData.DebugAddr, - }, - &cli.StringFlag{ - Name: "storage-s3-debug-addr", - Value: "0.0.0.0:9167", - Usage: "Address to bind storage s3 debug server", - EnvVar: "REVA_STORAGE_S3_DEBUG_ADDR", - Destination: &cfg.Reva.StorageS3.DebugAddr, - }, - &cli.StringFlag{ - Name: "storage-s3-data-debug-addr", - Value: "0.0.0.0:9169", - Usage: "Address to bind storage s3 data debug server", - EnvVar: "REVA_STORAGE_S3_DATA_DEBUG_ADDR", - Destination: &cfg.Reva.StorageS3Data.DebugAddr, - }, - &cli.StringFlag{ - Name: "storage-custom-debug-addr", - Value: "0.0.0.0:9171", - Usage: "Address to bind storage custom debug server", - EnvVar: "REVA_STORAGE_CUSTOM_DEBUG_ADDR", - Destination: &cfg.Reva.StorageCustom.DebugAddr, - }, - &cli.StringFlag{ - Name: "storage-custom-data-debug-addr", - Value: "0.0.0.0:9173", - Usage: "Address to bind storage custom data debug server", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_DEBUG_ADDR", - Destination: &cfg.Reva.StorageCustomData.DebugAddr, - }, - - // Services - - // Storage eos - - &cli.StringFlag{ - Name: "storage-eos-network", - Value: "tcp", - Usage: "Network to use for the reva storage-eos service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_EOS_NETWORK", - Destination: &cfg.Reva.StorageEOS.Network, - }, - &cli.StringFlag{ - Name: "storage-eos-protocol", - Value: "grpc", - Usage: "protocol for reva storage-eos service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_EOS_PROTOCOL", - Destination: &cfg.Reva.StorageEOS.Protocol, - }, - &cli.StringFlag{ - Name: "storage-eos-addr", - Value: "0.0.0.0:9158", - Usage: "Address to bind reva storage-eos service", - EnvVar: "REVA_STORAGE_EOS_ADDR", - Destination: &cfg.Reva.StorageEOS.Addr, - }, - &cli.StringFlag{ - Name: "storage-eos-url", - Value: "localhost:9158", - Usage: "URL to use for the reva storage-eos service", - EnvVar: "REVA_STORAGE_EOS_URL", - Destination: &cfg.Reva.StorageEOS.URL, - }, - &cli.StringFlag{ - Name: "storage-eos-services", - Value: "storageprovider", - Usage: "comma separated list of services to include in the storage-eos service", - EnvVar: "REVA_STORAGE_EOS_SERVICES", - Destination: &cfg.Reva.StorageEOS.Services, - }, - - &cli.StringFlag{ - Name: "storage-eos-driver", - Value: "local", - Usage: "eos storage driver", - EnvVar: "REVA_STORAGE_EOS_DRIVER", - Destination: &cfg.Reva.StorageEOS.Driver, - }, - &cli.StringFlag{ - Name: "storage-eos-path-wrapper", - Value: "", - Usage: "eos storage path wrapper", - EnvVar: "REVA_STORAGE_EOS_PATH_WRAPPER", - Destination: &cfg.Reva.StorageEOS.PathWrapper, - }, - &cli.StringFlag{ - Name: "storage-eos-path-wrapper-context-prefix", - Value: "", - Usage: "eos storage path wrapper context prefix", - EnvVar: "REVA_STORAGE_EOS_PATH_WRAPPER_CONTEXT_PREFIX", - Destination: &cfg.Reva.StorageEOS.PathWrapperContext.Prefix, - }, - &cli.StringFlag{ - Name: "storage-eos-mount-path", - Value: "/eos", - Usage: "eos storage mount path", - EnvVar: "REVA_STORAGE_EOS_MOUNT_PATH", - Destination: &cfg.Reva.StorageEOS.MountPath, - }, - &cli.StringFlag{ - Name: "storage-eos-mount-id", - Value: "", - Usage: "eos storage mount id", - EnvVar: "REVA_STORAGE_EOS_MOUNT_ID", - Destination: &cfg.Reva.StorageEOS.MountID, - }, - &cli.BoolFlag{ - Name: "storage-eos-expose-data-server", - Usage: "eos storage exposes a dedicated data server", - EnvVar: "REVA_STORAGE_EOS_EXPOSE_DATA_SERVER", - Destination: &cfg.Reva.StorageEOS.ExposeDataServer, - }, - &cli.StringFlag{ - Name: "storage-eos-data-server-url", - Value: "", - Usage: "eos storage data server url", - EnvVar: "REVA_STORAGE_EOS_DATA_SERVER_URL", - Destination: &cfg.Reva.StorageEOS.DataServerURL, - }, - - // Storage eos data - - &cli.StringFlag{ - Name: "storage-eos-data-network", - Value: "tcp", - Usage: "Network to use for the reva storage-eos data service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_EOS_DATA_NETWORK", - Destination: &cfg.Reva.StorageEOSData.Network, - }, - &cli.StringFlag{ - Name: "storage-eos-data-protocol", - Value: "http", - Usage: "protocol for reva storage-eos data service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_EOS_DATA_PROTOCOL", - Destination: &cfg.Reva.StorageEOSData.Protocol, - }, - &cli.StringFlag{ - Name: "storage-eos-data-addr", - Value: "0.0.0.0:9160", - Usage: "Address to bind reva storage-eos data service", - EnvVar: "REVA_STORAGE_EOS_DATA_ADDR", - Destination: &cfg.Reva.StorageEOSData.Addr, - }, - &cli.StringFlag{ - Name: "storage-eos-data-url", - Value: "localhost:9160", - Usage: "URL to use for the reva storage-eos data service", - EnvVar: "REVA_STORAGE_EOS_DATA_URL", - Destination: &cfg.Reva.StorageEOSData.URL, - }, - &cli.StringFlag{ - Name: "storage-eos-data-services", - Value: "dataprovider", - Usage: "comma separated list of services to include in the storage-eos data service", - EnvVar: "REVA_STORAGE_EOS_DATA_SERVICES", - Destination: &cfg.Reva.StorageEOSData.Services, - }, - &cli.StringFlag{ - Name: "storage-eos-data-driver", - Value: "eos", - Usage: "eos data storage driver", - EnvVar: "REVA_STORAGE_EOS_DATA_DRIVER", - Destination: &cfg.Reva.StorageEOSData.Driver, - }, - &cli.StringFlag{ - Name: "storage-eos-data-prefix", - Value: "data", - Usage: "prefix for the http endpoint, without leading slash", - EnvVar: "REVA_STORAGE_EOS_DATA_PREFIX", - Destination: &cfg.Reva.StorageEOSData.Prefix, - }, - &cli.StringFlag{ - Name: "storage-eos-data-temp-folder", - Value: "/var/tmp/", - Usage: "storage eos data temp folder", - EnvVar: "REVA_STORAGE_HOME_DATA_TEMP_FOLDER", - Destination: &cfg.Reva.StorageEOSData.TempFolder, - }, - - // Storage s3 - - &cli.StringFlag{ - Name: "storage-s3-network", - Value: "tcp", - Usage: "Network to use for the reva storage-oc service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_S3_NETWORK", - Destination: &cfg.Reva.StorageS3.Network, - }, - &cli.StringFlag{ - Name: "storage-s3-protocol", - Value: "grpc", - Usage: "protocol for reva storage-s3 service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_S3_PROTOCOL", - Destination: &cfg.Reva.StorageS3.Protocol, - }, - &cli.StringFlag{ - Name: "storage-s3-addr", - Value: "0.0.0.0:9166", - Usage: "Address to bind reva storage-s3 service", - EnvVar: "REVA_STORAGE_S3_ADDR", - Destination: &cfg.Reva.StorageS3.Addr, - }, - &cli.StringFlag{ - Name: "storage-s3-url", - Value: "localhost:9166", - Usage: "URL to use for the reva storage-s3 service", - EnvVar: "REVA_STORAGE_S3_URL", - Destination: &cfg.Reva.StorageS3.URL, - }, - &cli.StringFlag{ - Name: "storage-s3-services", - Value: "storageprovider", - Usage: "comma separated list of services to include in the storage-s3 service", - EnvVar: "REVA_STORAGE_S3_SERVICES", - Destination: &cfg.Reva.StorageS3.Services, - }, - - &cli.StringFlag{ - Name: "storage-s3-driver", - Value: "local", - Usage: "s3 storage driver", - EnvVar: "REVA_STORAGE_S3_DRIVER", - Destination: &cfg.Reva.StorageS3.Driver, - }, - &cli.StringFlag{ - Name: "storage-s3-path-wrapper", - Value: "", - Usage: "s3 storage path wrapper", - EnvVar: "REVA_STORAGE_S3_PATH_WRAPPER", - Destination: &cfg.Reva.StorageS3.PathWrapper, - }, - &cli.StringFlag{ - Name: "storage-s3-path-wrapper-context-prefix", - Value: "", - Usage: "s3 storage path wrapper context prefix", - EnvVar: "REVA_STORAGE_S3_PATH_WRAPPER_CONTEXT_PREFIX", - Destination: &cfg.Reva.StorageS3.PathWrapperContext.Prefix, - }, - &cli.StringFlag{ - Name: "storage-s3-mount-path", - Value: "", - Usage: "s3 storage mount path", - EnvVar: "REVA_STORAGE_S3_MOUNT_PATH", - Destination: &cfg.Reva.StorageS3.MountPath, - }, - &cli.StringFlag{ - Name: "storage-s3-mount-id", - Value: "", - Usage: "s3 storage mount id", - EnvVar: "REVA_STORAGE_S3_MOUNT_ID", - Destination: &cfg.Reva.StorageS3.MountID, - }, - &cli.BoolFlag{ - Name: "storage-s3-expose-data-server", - Usage: "s3 storage exposes a dedicated data server", - EnvVar: "REVA_STORAGE_S3_EXPOSE_DATA_SERVER", - Destination: &cfg.Reva.StorageS3.ExposeDataServer, - }, - &cli.StringFlag{ - Name: "storage-s3-data-server-url", - Value: "", - Usage: "s3 storage data server url", - EnvVar: "REVA_STORAGE_S3_DATA_SERVER_URL", - Destination: &cfg.Reva.StorageS3.DataServerURL, - }, - - // Storage s3 data - - &cli.StringFlag{ - Name: "storage-s3-data-network", - Value: "tcp", - Usage: "Network to use for the reva storage-s3 data service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_S3_DATA_NETWORK", - Destination: &cfg.Reva.StorageS3Data.Network, - }, - &cli.StringFlag{ - Name: "storage-s3-data-protocol", - Value: "http", - Usage: "protocol for reva storage-s3 data service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_S3_DATA_PROTOCOL", - Destination: &cfg.Reva.StorageS3Data.Protocol, - }, - &cli.StringFlag{ - Name: "storage-s3-data-addr", - Value: "0.0.0.0:9168", - Usage: "Address to bind reva storage-s3 data service", - EnvVar: "REVA_STORAGE_S3_DATA_ADDR", - Destination: &cfg.Reva.StorageS3Data.Addr, - }, - &cli.StringFlag{ - Name: "storage-s3-data-url", - Value: "localhost:9168", - Usage: "URL to use for the reva storage-s3 data service", - EnvVar: "REVA_STORAGE_S3_DATA_URL", - Destination: &cfg.Reva.StorageS3Data.URL, - }, - &cli.StringFlag{ - Name: "storage-s3-data-services", - Value: "dataprovider", - Usage: "comma separated list of services to include in the storage-s3 data service", - EnvVar: "REVA_STORAGE_S3_DATA_SERVICES", - Destination: &cfg.Reva.StorageS3Data.Services, - }, - &cli.StringFlag{ - Name: "storage-s3-data-driver", - Value: "s3", - Usage: "s3 data storage driver", - EnvVar: "REVA_STORAGE_S3_DATA_DRIVER", - Destination: &cfg.Reva.StorageS3Data.Driver, - }, - &cli.StringFlag{ - Name: "storage-s3-data-prefix", - Value: "data", - Usage: "prefix for the http endpoint, without leading slash", - EnvVar: "REVA_STORAGE_S3_DATA_PREFIX", - Destination: &cfg.Reva.StorageS3Data.Prefix, - }, - &cli.StringFlag{ - Name: "storage-s3-data-temp-folder", - Value: "/var/tmp/", - Usage: "storage s3 data temp folder", - EnvVar: "REVA_STORAGE_S3_DATA_TEMP_FOLDER", - Destination: &cfg.Reva.StorageS3Data.TempFolder, - }, - - // Storage custom - - &cli.StringFlag{ - Name: "storage-custom-network", - Value: "tcp", - Usage: "Network to use for the reva storage-custom service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_CUSTOM_NETWORK", - Destination: &cfg.Reva.StorageCustom.Network, - }, - &cli.StringFlag{ - Name: "storage-custom-protocol", - Value: "grpc", - Usage: "protocol for reva storage-custom service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_CUSTOM_PROTOCOL", - Destination: &cfg.Reva.StorageCustom.Protocol, - }, - &cli.StringFlag{ - Name: "storage-custom-addr", - Value: "0.0.0.0:9170", - Usage: "Address to bind reva storage-custom service", - EnvVar: "REVA_STORAGE_CUSTOM_ADDR", - Destination: &cfg.Reva.StorageCustom.Addr, - }, - &cli.StringFlag{ - Name: "storage-custom-url", - Value: "localhost:9170", - Usage: "URL to use for the reva storage-custom service", - EnvVar: "REVA_STORAGE_CUSTOM_URL", - Destination: &cfg.Reva.StorageCustom.URL, - }, - &cli.StringFlag{ - Name: "storage-custom-services", - Value: "storageprovider", - Usage: "comma separated list of services to include in the storage-custom service", - EnvVar: "REVA_STORAGE_CUSTOM_SERVICES", - Destination: &cfg.Reva.StorageCustom.Services, - }, - - &cli.StringFlag{ - Name: "storage-custom-driver", - Value: "local", - Usage: "custom storage driver", - EnvVar: "REVA_STORAGE_CUSTOM_DRIVER", - Destination: &cfg.Reva.StorageCustom.Driver, - }, - &cli.StringFlag{ - Name: "storage-custom-path-wrapper", - Value: "", - Usage: "custom storage path wrapper", - EnvVar: "REVA_STORAGE_CUSTOM_PATH_WRAPPER", - Destination: &cfg.Reva.StorageCustom.PathWrapper, - }, - &cli.StringFlag{ - Name: "storage-custom-path-wrapper-context-prefix", - Value: "", - Usage: "custom storage path wrapper context prefix", - EnvVar: "REVA_STORAGE_CUSTOM_PATH_WRAPPER_CONTEXT_PREFIX", - Destination: &cfg.Reva.StorageCustom.PathWrapperContext.Prefix, - }, - &cli.StringFlag{ - Name: "storage-custom-mount-path", - Value: "", - Usage: "custom storage mount path", - EnvVar: "REVA_STORAGE_CUSTOM_MOUNT_PATH", - Destination: &cfg.Reva.StorageCustom.MountPath, - }, - &cli.StringFlag{ - Name: "storage-custom-mount-id", - Value: "", - Usage: "custom storage mount id", - EnvVar: "REVA_STORAGE_CUSTOM_MOUNT_ID", - Destination: &cfg.Reva.StorageCustom.MountID, - }, - &cli.BoolFlag{ - Name: "storage-custom-expose-data-server", - Usage: "custom storage exposes a dedicated data server", - EnvVar: "REVA_STORAGE_CUSTOM_EXPOSE_DATA_SERVER", - Destination: &cfg.Reva.StorageCustom.ExposeDataServer, - }, - &cli.StringFlag{ - Name: "storage-custom-data-server-url", - Value: "", - Usage: "custom storage data server url", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_SERVER_URL", - Destination: &cfg.Reva.StorageCustom.DataServerURL, - }, - - // Storage custom data - - &cli.StringFlag{ - Name: "storage-custom-data-network", - Value: "tcp", - Usage: "Network to use for the reva storage-custom data service, can be 'tcp', 'udp' or 'unix'", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_NETWORK", - Destination: &cfg.Reva.StorageCustomData.Network, - }, - &cli.StringFlag{ - Name: "storage-custom-data-protocol", - Value: "http", - Usage: "protocol for reva storage-custom data service, can be 'http' or 'grpc'", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_PROTOCOL", - Destination: &cfg.Reva.StorageCustomData.Protocol, - }, - &cli.StringFlag{ - Name: "storage-custom-data-addr", - Value: "0.0.0.0:9172", - Usage: "Address to bind reva storage-custom data service", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_ADDR", - Destination: &cfg.Reva.StorageCustomData.Addr, - }, - &cli.StringFlag{ - Name: "storage-custom-data-url", - Value: "localhost:9172", - Usage: "URL to use for the reva storage-custom data service", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_URL", - Destination: &cfg.Reva.StorageCustomData.URL, - }, - &cli.StringFlag{ - Name: "storage-custom-data-services", - Value: "dataprovider", - Usage: "comma separated list of services to include in the storage-custom data service", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_SERVICES", - Destination: &cfg.Reva.StorageCustomData.Services, - }, - &cli.StringFlag{ - Name: "storage-custom-data-driver", - Value: "", - Usage: "custom data storage driver", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_DRIVER", - Destination: &cfg.Reva.StorageCustomData.Driver, - }, - &cli.StringFlag{ - Name: "storage-custom-data-prefix", - Value: "data", - Usage: "prefix for the http endpoint, without leading slash", - EnvVar: "REVA_STORAGE_S3_DATA_PREFIX", - Destination: &cfg.Reva.StorageCustomData.Prefix, - }, - &cli.StringFlag{ - Name: "storage-custom-data-temp-folder", - Value: "/var/tmp/", - Usage: "storage custom data temp folder", - EnvVar: "REVA_STORAGE_CUSTOM_DATA_TEMP_FOLDER", - Destination: &cfg.Reva.StorageCustomData.TempFolder, - }, - - &cli.StringFlag{ - Name: "asset-path", - Value: "", - Usage: "Path to custom assets", - EnvVar: "REVA_ASSET_PATH", - Destination: &cfg.Asset.Path, - }, - } -} -*/ diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index f0d9e7e..ac28327 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -171,6 +171,13 @@ 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 @@ -242,6 +249,12 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { 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: "", @@ -263,6 +276,13 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, Destination: &cfg.Reva.Storages.EOS.SingleUsername, }, + &cli.StringFlag{ + Name: "storage-eos-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_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.Layout, + }, // local @@ -290,13 +310,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, Destination: &cfg.Reva.Storages.OwnCloud.Scan, }, - &cli.BoolFlag{ - Name: "storage-owncloud-autocreate", - Value: true, - Usage: "autocreate home path for new users", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_AUTOCREATE"}, - Destination: &cfg.Reva.Storages.OwnCloud.Autocreate, - }, &cli.StringFlag{ Name: "storage-owncloud-redis", Value: ":6379", @@ -304,5 +317,12 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { 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/storagehomedata.go b/pkg/flagset/storagehomedata.go index 12ed50a..6a7ed70 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -214,6 +214,12 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { 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: "", @@ -235,6 +241,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, Destination: &cfg.Reva.Storages.EOS.SingleUsername, }, + &cli.StringFlag{ + Name: "storage-eos-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_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.Layout, + }, // local @@ -262,13 +275,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, Destination: &cfg.Reva.Storages.OwnCloud.Scan, }, - &cli.BoolFlag{ - Name: "storage-owncloud-autocreate", - Value: true, - Usage: "autocreate home path for new users", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_AUTOCREATE"}, - Destination: &cfg.Reva.Storages.OwnCloud.Autocreate, - }, &cli.StringFlag{ Name: "storage-owncloud-redis", Value: ":6379", @@ -276,6 +282,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { 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, + }, // Gateway diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 8d324a1..9af7bfa 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -171,6 +171,13 @@ 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: true, // TODO jfd we may need to default to true here so the new webdav endpoint will autocreate user homes as well + Usage: "if enabled home dirs will be automatically created", + EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"}, + Destination: &cfg.Reva.StorageHome.EnableHomeCreation, + }, // Storage drivers @@ -242,6 +249,12 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { 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: "", @@ -263,6 +276,13 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, Destination: &cfg.Reva.Storages.EOS.SingleUsername, }, + &cli.StringFlag{ + Name: "storage-eos-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_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.Layout, + }, // local @@ -290,13 +310,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, Destination: &cfg.Reva.Storages.OwnCloud.Scan, }, - &cli.BoolFlag{ - Name: "storage-owncloud-autocreate", - Value: true, - Usage: "autocreate home path for new users", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_AUTOCREATE"}, - Destination: &cfg.Reva.Storages.OwnCloud.Autocreate, - }, &cli.StringFlag{ Name: "storage-owncloud-redis", Value: ":6379", @@ -304,5 +317,12 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { 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/storageocdata.go b/pkg/flagset/storageocdata.go index e329551..57bea0a 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -214,6 +214,12 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { 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: "", @@ -235,6 +241,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, Destination: &cfg.Reva.Storages.EOS.SingleUsername, }, + &cli.StringFlag{ + Name: "storage-eos-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_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.Layout, + }, // local @@ -262,13 +275,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, Destination: &cfg.Reva.Storages.OwnCloud.Scan, }, - &cli.BoolFlag{ - Name: "storage-owncloud-autocreate", - Value: true, - Usage: "autocreate home path for new users", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_AUTOCREATE"}, - Destination: &cfg.Reva.Storages.OwnCloud.Autocreate, - }, &cli.StringFlag{ Name: "storage-owncloud-redis", Value: ":6379", @@ -276,6 +282,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { 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, + }, // Gateway diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 197586a..27bd19a 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -171,6 +171,12 @@ 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 @@ -242,6 +248,12 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { 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: "", @@ -263,6 +275,13 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, Destination: &cfg.Reva.Storages.EOS.SingleUsername, }, + &cli.StringFlag{ + Name: "storage-eos-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_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.EOS.Layout, + }, // local @@ -290,13 +309,6 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, Destination: &cfg.Reva.Storages.OwnCloud.Scan, }, - &cli.BoolFlag{ - Name: "storage-owncloud-autocreate", - Value: true, - Usage: "autocreate home path for new users", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_AUTOCREATE"}, - Destination: &cfg.Reva.Storages.OwnCloud.Autocreate, - }, &cli.StringFlag{ Name: "storage-owncloud-redis", Value: ":6379", @@ -304,5 +316,12 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { 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, + }, } }