From c99861130f2a2bc66bfb953097ec73006caaa3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 1 Sep 2020 12:12:52 +0200 Subject: [PATCH 01/13] config cleanup --- docs/_index.md | 35 ++++ pkg/command/drivers.go | 95 ++++++++++ pkg/command/gateway.go | 22 +++ pkg/command/storageeos.go | 42 +---- pkg/command/storageeosdata.go | 44 +---- pkg/command/storagehome.go | 61 +------ pkg/command/storagehomedata.go | 63 +------ pkg/command/storageoc.go | 61 +------ pkg/command/storageocdata.go | 63 +------ pkg/command/storagepubliclink.go | 9 +- pkg/command/storageroot.go | 60 +------ pkg/config/config.go | 42 +++-- pkg/flagset/authbasic.go | 154 +--------------- pkg/flagset/authbearer.go | 72 +------- pkg/flagset/debug.go | 31 ++++ pkg/flagset/drivereos.go | 133 ++++++++++++++ pkg/flagset/driverlocal.go | 19 ++ pkg/flagset/driverowncloud.go | 47 +++++ pkg/flagset/frontend.go | 69 +------- pkg/flagset/gateway.go | 94 +++------- pkg/flagset/ldap.go | 134 ++++++++++++++ pkg/flagset/secret.go | 19 ++ pkg/flagset/sharing.go | 72 +------- pkg/flagset/storageeos.go | 252 ++------------------------ pkg/flagset/storageeosdata.go | 258 +++------------------------ pkg/flagset/storagehome.go | 249 ++------------------------ pkg/flagset/storagehomedata.go | 249 ++------------------------ pkg/flagset/storageoc.go | 251 ++------------------------ pkg/flagset/storageocdata.go | 251 ++------------------------ pkg/flagset/storagepubliclink.go | 142 ++------------- pkg/flagset/storageroot.go | 237 ++----------------------- pkg/flagset/tracing.go | 47 +++++ pkg/flagset/users.go | 292 +++++++------------------------ 33 files changed, 841 insertions(+), 2828 deletions(-) create mode 100644 pkg/command/drivers.go create mode 100644 pkg/flagset/debug.go create mode 100644 pkg/flagset/drivereos.go create mode 100644 pkg/flagset/driverlocal.go create mode 100644 pkg/flagset/driverowncloud.go create mode 100644 pkg/flagset/ldap.go create mode 100644 pkg/flagset/secret.go create mode 100644 pkg/flagset/tracing.go diff --git a/docs/_index.md b/docs/_index.md index 757f7f6f5..ab942240c 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -8,3 +8,38 @@ geekdocFilePath: _index.md --- This service provides an ocis extension that wraps [reva](https://github.com/cs3org/reva/) and adds an opinionated configuration to it. + +It uses the port range 9140-9179 to preconfigure several services. + +| port | service | ++------+---------+ +| 9109 | health? | +| 9140 | frontend | +| 9141 | frontend debug | +| 9142 | gateway | +| 9143 | gateway debug | +| 9144 | users | +| 9145 | users debug | +| 9146 | authbasic | +| 9147 | authbasic debug | +| 9148 | authbearer | +| 9149 | authbearer debug | +| 9150 | sharing | +| 9151 | sharing debug | +| 9152 | storage root | +| 9153 | storage root debug | +| 9154 | storage home | +| 9155 | storage home debug | +| 9156 | storage home data | +| 9157 | storage home data debug | +| 9158 | storage eos | +| 9159 | storage eos debug | +| 9160 | storage eos data | +| 9161 | storage eos data debug | +| 9162 | storage oc | +| 9163 | storage oc debug | +| 9164 | storage oc data | +| 9165 | storage oc data debug | +| 9166-9177 | reserved for s3, wnd, custom + data providers | +| 9178 | storage public link | +| 9179 | storage public link data | diff --git a/pkg/command/drivers.go b/pkg/command/drivers.go new file mode 100644 index 000000000..7140409b3 --- /dev/null +++ b/pkg/command/drivers.go @@ -0,0 +1,95 @@ +package command + +import ( + "github.com/owncloud/ocis-reva/pkg/config" +) + +func drivers(cfg *config.Config) map[string]interface{} { + return map[string]interface{}{ + "eos": map[string]interface{}{ + "namespace": cfg.Reva.Storages.Common.Root, + "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, + "uploads_namespace": cfg.Reva.Storages.EOS.UploadsNamespace, + "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "eos_binary": cfg.Reva.Storages.EOS.EosBinary, + "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, + "master_url": cfg.Reva.Storages.EOS.MasterURL, + "slave_url": cfg.Reva.Storages.EOS.SlaveURL, + "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, + "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, + "keytab": cfg.Reva.Storages.EOS.Keytab, + "single_username": cfg.Reva.Storages.EOS.SingleUsername, + "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, + "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, + "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, + "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, + "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, + }, + "eoshome": map[string]interface{}{ + "namespace": cfg.Reva.Storages.Common.Root, + "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, + "uploads_namespace": cfg.Reva.Storages.EOS.UploadsNamespace, + "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "eos_binary": cfg.Reva.Storages.EOS.EosBinary, + "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, + "master_url": cfg.Reva.Storages.EOS.MasterURL, + "slave_url": cfg.Reva.Storages.EOS.SlaveURL, + "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, + "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.Common.UserLayout, + "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, + "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, + "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, + "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, + "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, + }, + "eosgrpc": map[string]interface{}{ + "namespace": cfg.Reva.Storages.Common.Root, + "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, + "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "eos_binary": cfg.Reva.Storages.EOS.EosBinary, + "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, + "master_url": cfg.Reva.Storages.EOS.MasterURL, + "master_grpc_uri": cfg.Reva.Storages.EOS.GrpcURI, + "slave_url": cfg.Reva.Storages.EOS.SlaveURL, + "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, + "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.Common.UserLayout, + "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, + "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, + "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, + "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, + "enable_home": cfg.Reva.Storages.Common.EnableHome, + "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, + }, + "local": map[string]interface{}{ + "root": cfg.Reva.Storages.Common.Root, + "share_folder": cfg.Reva.Storages.Common.ShareFolder, + }, + "localhome": map[string]interface{}{ + "root": cfg.Reva.Storages.Common.Root, + "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "user_layout": cfg.Reva.Storages.Common.UserLayout, + }, + "owncloud": map[string]interface{}{ + "datadirectory": cfg.Reva.Storages.Common.Root, + "scan": cfg.Reva.Storages.OwnCloud.Scan, + "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.Common.EnableHome, + "user_layout": cfg.Reva.Storages.Common.UserLayout, + "userprovidersvc": cfg.Reva.Users.URL, + }, + "s3": map[string]interface{}{ + "region": cfg.Reva.Storages.S3.Region, + "access_key": cfg.Reva.Storages.S3.AccessKey, + "secret_key": cfg.Reva.Storages.S3.SecretKey, + "endpoint": cfg.Reva.Storages.S3.Endpoint, + "bucket": cfg.Reva.Storages.S3.Bucket, + "prefix": cfg.Reva.Storages.Common.Root, + }, + } +} diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index 842063bcd..f2f7644e9 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -241,3 +241,25 @@ func Gateway(cfg *config.Config) *cli.Command { }, } } + +func rules(cfg *config.Config) map[string]interface{} { + + return map[string]interface{}{ + cfg.Reva.StorageRoot.MountPath: cfg.Reva.StorageRoot.URL, + cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, + cfg.Reva.StorageHome.MountPath: cfg.Reva.StorageHome.URL, + cfg.Reva.StorageHome.MountID: cfg.Reva.StorageHome.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, + 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 643fdbbaf..6fab0e763 100644 --- a/pkg/command/storageeos.go +++ b/pkg/command/storageeos.go @@ -87,46 +87,8 @@ func StorageEOS(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ - "driver": cfg.Reva.StorageEOS.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - }, + "driver": cfg.Reva.StorageEOS.Driver, + "drivers": drivers(cfg), "mount_path": cfg.Reva.StorageEOS.MountPath, "mount_id": cfg.Reva.StorageEOS.MountID, "expose_data_server": cfg.Reva.StorageEOS.ExposeDataServer, diff --git a/pkg/command/storageeosdata.go b/pkg/command/storageeosdata.go index 3f208d0a5..e939e0127 100644 --- a/pkg/command/storageeosdata.go +++ b/pkg/command/storageeosdata.go @@ -88,47 +88,9 @@ func StorageEOSData(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "dataprovider": map[string]interface{}{ - "prefix": cfg.Reva.StorageEOSData.Prefix, - "driver": cfg.Reva.StorageEOSData.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - }, + "prefix": cfg.Reva.StorageEOSData.Prefix, + "driver": cfg.Reva.StorageEOSData.Driver, + "drivers": drivers(cfg), "timeout": 86400, "insecure": true, "disable_tus": false, diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index 4a6767974..c528ff8a8 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -87,65 +87,8 @@ func StorageHome(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ - "driver": cfg.Reva.StorageHome.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "local": map[string]interface{}{ - "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": true, - "user_layout": cfg.Reva.Storages.OwnCloud.Layout, - "userprovidersvc": cfg.Reva.Users.URL, - }, - "s3": map[string]interface{}{ - "region": cfg.Reva.Storages.S3.Region, - "access_key": cfg.Reva.Storages.S3.AccessKey, - "secret_key": cfg.Reva.Storages.S3.SecretKey, - "endpoint": cfg.Reva.Storages.S3.Endpoint, - "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.S3.Prefix, - }, - }, + "driver": cfg.Reva.StorageHome.Driver, + "drivers": drivers(cfg), "mount_path": cfg.Reva.StorageHome.MountPath, "mount_id": cfg.Reva.StorageHome.MountID, "expose_data_server": cfg.Reva.StorageHome.ExposeDataServer, diff --git a/pkg/command/storagehomedata.go b/pkg/command/storagehomedata.go index 8c622e76a..6f909bd2d 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -88,66 +88,9 @@ func StorageHomeData(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "dataprovider": map[string]interface{}{ - "prefix": cfg.Reva.StorageHomeData.Prefix, - "driver": cfg.Reva.StorageHomeData.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "local": map[string]interface{}{ - "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, - "userprovidersvc": cfg.Reva.Users.URL, - }, - "s3": map[string]interface{}{ - "region": cfg.Reva.Storages.S3.Region, - "access_key": cfg.Reva.Storages.S3.AccessKey, - "secret_key": cfg.Reva.Storages.S3.SecretKey, - "endpoint": cfg.Reva.Storages.S3.Endpoint, - "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.S3.Prefix, - }, - }, + "prefix": cfg.Reva.StorageHomeData.Prefix, + "driver": cfg.Reva.StorageHomeData.Driver, + "drivers": drivers(cfg), "timeout": 86400, "insecure": true, "disable_tus": false, diff --git a/pkg/command/storageoc.go b/pkg/command/storageoc.go index 01bc7a9fd..dfe39702b 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -87,65 +87,8 @@ func StorageOC(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ - "driver": cfg.Reva.StorageOC.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "local": map[string]interface{}{ - "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, - "userprovidersvc": cfg.Reva.Users.URL, - }, - "s3": map[string]interface{}{ - "region": cfg.Reva.Storages.S3.Region, - "access_key": cfg.Reva.Storages.S3.AccessKey, - "secret_key": cfg.Reva.Storages.S3.SecretKey, - "endpoint": cfg.Reva.Storages.S3.Endpoint, - "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.S3.Prefix, - }, - }, + "driver": cfg.Reva.StorageOC.Driver, + "drivers": drivers(cfg), "mount_path": cfg.Reva.StorageOC.MountPath, "mount_id": cfg.Reva.StorageOC.MountID, "expose_data_server": cfg.Reva.StorageOC.ExposeDataServer, diff --git a/pkg/command/storageocdata.go b/pkg/command/storageocdata.go index 35cac2d1d..414069d15 100644 --- a/pkg/command/storageocdata.go +++ b/pkg/command/storageocdata.go @@ -88,66 +88,9 @@ func StorageOCData(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "dataprovider": map[string]interface{}{ - "prefix": cfg.Reva.StorageOCData.Prefix, - "driver": cfg.Reva.StorageOCData.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "local": map[string]interface{}{ - "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, - "userprovidersvc": cfg.Reva.Users.URL, - }, - "s3": map[string]interface{}{ - "region": cfg.Reva.Storages.S3.Region, - "access_key": cfg.Reva.Storages.S3.AccessKey, - "secret_key": cfg.Reva.Storages.S3.SecretKey, - "endpoint": cfg.Reva.Storages.S3.Endpoint, - "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.S3.Prefix, - }, - }, + "prefix": cfg.Reva.StorageOCData.Prefix, + "driver": cfg.Reva.StorageOCData.Driver, + "drivers": drivers(cfg), "timeout": 86400, "insecure": true, "disable_tus": false, diff --git a/pkg/command/storagepubliclink.go b/pkg/command/storagepubliclink.go index d40313156..21bcd6abd 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-link", }, "shared": map[string]interface{}{ "jwt_secret": cfg.Reva.JWTSecret, @@ -83,8 +86,6 @@ func StoragePublicLink(cfg *config.Config) *cli.Command { "services": map[string]interface{}{ "publicstorageprovider": map[string]interface{}{ "mount_path": cfg.Reva.StoragePublicLink.MountPath, - "mount_id": cfg.Reva.StoragePublicLink.MountID, - "driver_addr": cfg.Reva.StoragePublicLink.PublicShareProviderAddr, "gateway_addr": cfg.Reva.Gateway.URL, }, "authprovider": map[string]interface{}{ diff --git a/pkg/command/storageroot.go b/pkg/command/storageroot.go index f63d23b6d..ed9968018 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -87,64 +87,8 @@ func StorageRoot(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ - "driver": cfg.Reva.StorageRoot.Driver, - "drivers": 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, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "sec_protocol": cfg.Reva.Storages.EOS.SecProtocol, - "keytab": cfg.Reva.Storages.EOS.Keytab, - "single_username": cfg.Reva.Storages.EOS.SingleUsername, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.EOS.Namespace, - "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.EOS.ShareFolder, - "eos_binary": cfg.Reva.Storages.EOS.EosBinary, - "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, - "master_url": cfg.Reva.Storages.EOS.MasterURL, - "slave_url": cfg.Reva.Storages.EOS.SlaveURL, - "cache_directory": cfg.Reva.Storages.EOS.CacheDirectory, - "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, - "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, - "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "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.Layout, - "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, - }, - "local": map[string]interface{}{ - "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{}{ - "region": cfg.Reva.Storages.S3.Region, - "access_key": cfg.Reva.Storages.S3.AccessKey, - "secret_key": cfg.Reva.Storages.S3.SecretKey, - "endpoint": cfg.Reva.Storages.S3.Endpoint, - "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.S3.Prefix, - }, - }, + "driver": cfg.Reva.StorageRoot.Driver, + "drivers": drivers(cfg), "mount_path": cfg.Reva.StorageRoot.MountPath, "mount_id": cfg.Reva.StorageRoot.MountID, "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, diff --git a/pkg/config/config.go b/pkg/config/config.go index 6bb8cc5e0..71bcaf113 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -94,9 +94,7 @@ type PublicStorage struct { StoragePort PublicShareProviderAddr string - StorageProviderAddr string UserProviderAddr string - MountID string } // StorageConfig combines all available storage driver configuration parts. @@ -105,20 +103,18 @@ type StorageConfig struct { Local DriverLocal OwnCloud DriverOwnCloud S3 DriverS3 + Common DriverCommon // TODO checksums ... figure out what that is supposed to do } // DriverEOS defines the available EOS driver configuration. type DriverEOS struct { - // Namespace for metadata operations - Namespace string // ShadowNamespace for storing shadow data ShadowNamespace string - // ShareFolder defines the name of the folder in the - // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares - ShareFolder string + // UploadsNamespace for storing upload data + UploadsNamespace string // Location of the eos binary. // Default is /usr/bin/eos. @@ -132,6 +128,10 @@ type DriverEOS struct { // Default is root://eos-example.org MasterURL string + // URI of the EOS MGM grpc server + // Default is empty + GrpcURI string + // URL of the Slave EOS MGM. // Default is root://eos-example.org SlaveURL string @@ -154,9 +154,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 @@ -166,9 +163,6 @@ type DriverEOS struct { // SingleUsername is the username to use when SingleUserMode is enabled SingleUsername string - // Layout of the users home dir path - Layout string - // gateway service to use for uid lookups GatewaySVC string } @@ -178,13 +172,23 @@ type DriverLocal struct { Root string } +// DriverCommon defines common driver configuration options. +type DriverCommon struct { + // Root is the absolute path to the location of the data + Root string + //ShareFolder defines the name of the folder jailing all shares + ShareFolder string + // UserLayout contains the template used to construct + // the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}` + UserLayout string + // EnableHome enables the creation of home directories. + EnableHome bool +} + // DriverOwnCloud defines the available ownCloud storage driver configuration. type DriverOwnCloud struct { - Datadirectory string - Layout string - Redis string - Scan bool - EnableHome bool + Redis string + Scan bool } // DriverS3 defines the available S3 storage driver configuration. @@ -194,7 +198,6 @@ type DriverS3 struct { SecretKey string Endpoint string Bucket string - Prefix string } // OIDC defines the available OpenID Connect configuration. @@ -273,6 +276,7 @@ type Reva struct { AuthBearer Port Sharing Sharing StorageRoot StoragePort + StorageRootData StoragePort StorageHome StoragePort StorageHomeData StoragePort StorageEOS StoragePort diff --git a/pkg/flagset/authbasic.go b/pkg/flagset/authbasic.go index 4e10a7755..09ee616fb 100644 --- a/pkg/flagset/authbasic.go +++ b/pkg/flagset/authbasic.go @@ -7,42 +7,7 @@ import ( // AuthBasicWithConfig applies cfg to the root flagset func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,35 +17,6 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_AUTH_BASIC_DEBUG_ADDR"}, Destination: &cfg.Reva.AuthBasic.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Auth @@ -99,87 +35,6 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.AuthProvider.JSON, }, - // LDAP - - &cli.StringFlag{ - Name: "ldap-hostname", - Value: "localhost", - Usage: "LDAP hostname", - EnvVars: []string{"REVA_LDAP_HOSTNAME"}, - Destination: &cfg.Reva.LDAP.Hostname, - }, - &cli.IntFlag{ - Name: "ldap-port", - Value: 9126, - Usage: "LDAP port", - EnvVars: []string{"REVA_LDAP_PORT"}, - Destination: &cfg.Reva.LDAP.Port, - }, - &cli.StringFlag{ - Name: "ldap-base-dn", - Value: "dc=example,dc=org", - Usage: "LDAP basedn", - EnvVars: []string{"REVA_LDAP_BASE_DN"}, - Destination: &cfg.Reva.LDAP.BaseDN, - }, - &cli.StringFlag{ - Name: "ldap-loginfilter", - Value: "(&(objectclass=posixAccount)(|(cn={{login}})(mail={{login}})))", - Usage: "LDAP login filter", - EnvVars: []string{"REVA_LDAP_LOGINFILTER"}, - Destination: &cfg.Reva.LDAP.LoginFilter, - }, - &cli.StringFlag{ - Name: "ldap-bind-dn", - Value: "cn=reva,ou=sysusers,dc=example,dc=org", - Usage: "LDAP bind dn", - EnvVars: []string{"REVA_LDAP_BIND_DN"}, - Destination: &cfg.Reva.LDAP.BindDN, - }, - &cli.StringFlag{ - Name: "ldap-bind-password", - Value: "reva", - Usage: "LDAP bind password", - EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"}, - Destination: &cfg.Reva.LDAP.BindPassword, - }, - &cli.StringFlag{ - Name: "ldap-idp", - Value: "https://localhost:9200", - Usage: "Identity provider to use for users", - EnvVars: []string{"REVA_LDAP_IDP"}, - Destination: &cfg.Reva.LDAP.IDP, - }, - // ldap dn is always the dn - &cli.StringFlag{ - Name: "ldap-schema-uid", - Value: "ownclouduuid", - Usage: "LDAP schema uid", - EnvVars: []string{"REVA_LDAP_SCHEMA_UID"}, - Destination: &cfg.Reva.LDAP.Schema.UID, - }, - &cli.StringFlag{ - Name: "ldap-schema-mail", - Value: "mail", - Usage: "LDAP schema mail", - EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"}, - Destination: &cfg.Reva.LDAP.Schema.Mail, - }, - &cli.StringFlag{ - Name: "ldap-schema-displayName", - Value: "displayname", - Usage: "LDAP schema displayName", - EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"}, - Destination: &cfg.Reva.LDAP.Schema.DisplayName, - }, - &cli.StringFlag{ - Name: "ldap-schema-cn", - Value: "cn", - Usage: "LDAP schema cn", - EnvVars: []string{"REVA_LDAP_SCHEMA_CN"}, - Destination: &cfg.Reva.LDAP.Schema.CN, - }, - // Services // AuthBasic @@ -219,4 +74,11 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_AUTH_BASIC_SERVICES"}, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, LDAPWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/authbearer.go b/pkg/flagset/authbearer.go index 17a8d0785..181032c89 100644 --- a/pkg/flagset/authbearer.go +++ b/pkg/flagset/authbearer.go @@ -7,42 +7,7 @@ import ( // AuthBearerWithConfig applies cfg to the root flagset func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,35 +17,6 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_AUTH_BEARER_DEBUG_ADDR"}, Destination: &cfg.Reva.AuthBearer.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // OIDC @@ -165,4 +101,10 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_AUTH_BEARER_SERVICES"}, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/debug.go b/pkg/flagset/debug.go new file mode 100644 index 000000000..0056942f5 --- /dev/null +++ b/pkg/flagset/debug.go @@ -0,0 +1,31 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// DebugWithConfig applies common debug config cfg to the flagset +func DebugWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "debug-token", + Value: "", + Usage: "Token to grant metrics access", + EnvVars: []string{"REVA_DEBUG_TOKEN"}, + Destination: &cfg.Debug.Token, + }, + &cli.BoolFlag{ + Name: "debug-pprof", + Usage: "Enable pprof debugging", + EnvVars: []string{"REVA_DEBUG_PPROF"}, + Destination: &cfg.Debug.Pprof, + }, + &cli.BoolFlag{ + Name: "debug-zpages", + Usage: "Enable zpages debugging", + EnvVars: []string{"REVA_DEBUG_ZPAGES"}, + Destination: &cfg.Debug.Zpages, + }, + } +} diff --git a/pkg/flagset/drivereos.go b/pkg/flagset/drivereos.go new file mode 100644 index 000000000..3ea27170a --- /dev/null +++ b/pkg/flagset/drivereos.go @@ -0,0 +1,133 @@ +package flagset + +import ( + "os" + + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// DriverEOSWithConfig applies cfg to the root flagset +func DriverEOSWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + + &cli.StringFlag{ + Name: "storage-eos-namespace", + Value: "/eos/dockertest/reva", + Usage: "Namespace for metadata operations", + EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, + Destination: &cfg.Reva.Storages.Common.Root, + }, + &cli.StringFlag{ + Name: "storage-eos-shadow-namespace", + // Defaults to path.Join(c.Namespace, ".shadow") + Usage: "Shadow namespace where share references are stored", + EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, + Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, + }, + &cli.StringFlag{ + Name: "storage-eos-share-folder", + Value: "/Shares", + Usage: "name of the share folder", + EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, + Destination: &cfg.Reva.Storages.Common.ShareFolder, + }, + &cli.StringFlag{ + Name: "storage-eos-binary", + Value: "/usr/bin/eos", + Usage: "Location of the eos binary", + EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, + Destination: &cfg.Reva.Storages.EOS.EosBinary, + }, + &cli.StringFlag{ + Name: "storage-eos-xrdcopy-binary", + Value: "/usr/bin/xrdcopy", + Usage: "Location of the xrdcopy binary", + EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, + Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, + }, + &cli.StringFlag{ + Name: "storage-eos-master-url", + Value: "root://eos-mgm1.eoscluster.cern.ch:1094", + Usage: "URL of the Master EOS MGM", + EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, + Destination: &cfg.Reva.Storages.EOS.MasterURL, + }, + &cli.StringFlag{ + Name: "storage-eos-slave-url", + Value: "root://eos-mgm1.eoscluster.cern.ch:1094", + Usage: "URL of the Slave EOS MGM", + EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, + Destination: &cfg.Reva.Storages.EOS.SlaveURL, + }, + &cli.StringFlag{ + Name: "storage-eos-cache-directory", + Value: os.TempDir(), + Usage: "Location on the local fs where to store reads", + EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, + Destination: &cfg.Reva.Storages.EOS.CacheDirectory, + }, + &cli.BoolFlag{ + Name: "storage-eos-enable-logging", + Usage: "Enables logging of the commands executed", + EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, + Destination: &cfg.Reva.Storages.EOS.EnableLogging, + }, + &cli.BoolFlag{ + Name: "storage-eos-show-hidden-sysfiles", + Usage: "show internal EOS files like .sys.v# and .sys.a# files.", + EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, + Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, + }, + &cli.BoolFlag{ + Name: "storage-eos-force-singleuser-mode", + Usage: "force connections to EOS to use SingleUsername", + EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, + Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, + }, + &cli.BoolFlag{ + Name: "storage-eos-use-keytab", + Usage: "authenticate requests by using an EOS keytab", + EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, + Destination: &cfg.Reva.Storages.EOS.UseKeytab, + }, + &cli.BoolFlag{ + Name: "storage-eos-enable-home", + Usage: "enable the creation of home directories", + EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.Common.EnableHome, + }, + &cli.StringFlag{ + Name: "storage-eos-sec-protocol", + Usage: "the xrootd security protocol to use between the server and EOS", + EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, + Destination: &cfg.Reva.Storages.EOS.SecProtocol, + }, + &cli.StringFlag{ + Name: "storage-eos-keytab", + Usage: "the location of the keytab to use to authenticate to EOS", + EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, + Destination: &cfg.Reva.Storages.EOS.Keytab, + }, + &cli.StringFlag{ + Name: "storage-eos-single-username", + Usage: "the username to use when SingleUserMode is enabled", + EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, + Destination: &cfg.Reva.Storages.EOS.SingleUsername, + }, + &cli.StringFlag{ + Name: "storage-eos-layout", + Value: "{{substr 0 1 .Username}}/{{.Username}}", + Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, + EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, + Destination: &cfg.Reva.Storages.Common.UserLayout, + }, + &cli.StringFlag{ + Name: "storage-eos-gatewaysvc", + Value: "localhost:9142", + Usage: "URL to use for the reva gateway service", + EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, + Destination: &cfg.Reva.Storages.EOS.GatewaySVC, + }, + } +} diff --git a/pkg/flagset/driverlocal.go b/pkg/flagset/driverlocal.go new file mode 100644 index 000000000..ba8eda4da --- /dev/null +++ b/pkg/flagset/driverlocal.go @@ -0,0 +1,19 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// DriverLocalWithConfig applies cfg to the root flagset +func DriverLocalWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "storage-local-root", + Value: "/var/tmp/reva/root", + Usage: "the path to the local storage root", + EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, + Destination: &cfg.Reva.Storages.Local.Root, + }, + } +} diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go new file mode 100644 index 000000000..a33e94d41 --- /dev/null +++ b/pkg/flagset/driverowncloud.go @@ -0,0 +1,47 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// DriverOwnCloudWithConfig applies cfg to the root flagset +func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "storage-owncloud-datadir", + Value: "/var/tmp/reva/data", + Usage: "the path to the owncloud data directory", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, + Destination: &cfg.Reva.Storages.Common.Root, + }, + &cli.BoolFlag{ + Name: "storage-owncloud-scan", + Value: true, + Usage: "scan files on startup to add fileids", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, + Destination: &cfg.Reva.Storages.OwnCloud.Scan, + }, + &cli.StringFlag{ + Name: "storage-owncloud-redis", + Value: ":6379", + Usage: "the address of the redis server", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, + Destination: &cfg.Reva.Storages.OwnCloud.Redis, + }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: false, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.Common.EnableHome, + }, + &cli.StringFlag{ + Name: "storage-owncloud-layout", + Value: "{{.Id.OpaqueId}}", + Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, + Destination: &cfg.Reva.Storages.Common.UserLayout, + }, + } +} diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index 94ec4a934..5dbd7b222 100644 --- a/pkg/flagset/frontend.go +++ b/pkg/flagset/frontend.go @@ -7,42 +7,7 @@ import ( // FrontendWithConfig applies cfg to the root flagset func FrontendWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,35 +17,9 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_FRONTEND_DEBUG_ADDR"}, Destination: &cfg.Reva.Frontend.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, // REVA - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, &cli.StringFlag{ Name: "transfer-secret", Value: "replace-me-with-a-transfer-secret", @@ -202,4 +141,10 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.UploadHTTPMethodOverride, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 68c9838a3..0da9e9df0 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -7,42 +7,7 @@ import ( // GatewayWithConfig applies cfg to the root flagset func GatewayWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,35 +17,9 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_GATEWAY_DEBUG_ADDR"}, Destination: &cfg.Reva.Gateway.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, // REVA - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, &cli.StringFlag{ Name: "transfer-secret", Value: "replace-me-with-a-transfer-secret", @@ -229,6 +168,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Sharing.URL, }, + &cli.StringSliceFlag{ + Name: "storage-registry-rule", + Value: cli.NewStringSlice(), + Usage: `Replace the generated storage registry rules with this set --storage-registry-rule "/eos=localhost:9158" [--storage-registry-rule "1284d238-aa92-42ce-bdc4-0b0000009162=localhost:9162"]`, + EnvVars: []string{"REVA_STORAGE_REGISTRY_RULES"}, + }, + &cli.StringFlag{ Name: "storage-root-url", Value: "localhost:9152", @@ -266,11 +212,8 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageHome.MountPath, }, &cli.StringFlag{ - Name: "storage-home-mount-id", - // This is tho mount id of the /oc storage - // set it to 1284d238-aa92-42ce-bdc4-0b0000009158 for /eos - // Value: "1284d238-aa92-42ce-bdc4-0b0000009162", /os - Value: "1284d238-aa92-42ce-bdc4-0b0000009154", // /home + Name: "storage-home-mount-id", + Value: "1284d238-aa92-42ce-bdc4-0b0000009154", Usage: "mount id", EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_ID"}, Destination: &cfg.Reva.StorageHome.MountID, @@ -319,12 +262,27 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_MOUNT_ID"}, Destination: &cfg.Reva.StorageOC.MountID, }, + &cli.StringFlag{ - Name: "public-links-url", + Name: "public-link-url", Value: "localhost:10054", Usage: "URL to use for the public links service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, Destination: &cfg.Reva.StoragePublicLink.URL, }, + &cli.StringFlag{ + Name: "storage-public-link-mount-path", + Value: "/public/", + Usage: "mount path", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, + Destination: &cfg.Reva.StoragePublicLink.MountPath, + }, + // public-link has no mount id } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/ldap.go b/pkg/flagset/ldap.go new file mode 100644 index 000000000..0aa54693f --- /dev/null +++ b/pkg/flagset/ldap.go @@ -0,0 +1,134 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// LDAPWithConfig applies LDAP cfg to the flagset +func LDAPWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "ldap-hostname", + Value: "localhost", + Usage: "LDAP hostname", + EnvVars: []string{"REVA_LDAP_HOSTNAME"}, + Destination: &cfg.Reva.LDAP.Hostname, + }, + &cli.IntFlag{ + Name: "ldap-port", + Value: 9126, + Usage: "LDAP port", + EnvVars: []string{"REVA_LDAP_PORT"}, + Destination: &cfg.Reva.LDAP.Port, + }, + &cli.StringFlag{ + Name: "ldap-base-dn", + Value: "dc=example,dc=org", + Usage: "LDAP basedn", + EnvVars: []string{"REVA_LDAP_BASE_DN"}, + Destination: &cfg.Reva.LDAP.BaseDN, + }, + &cli.StringFlag{ + Name: "ldap-loginfilter", + Value: "(&(objectclass=posixAccount)(|(cn={{login}})(mail={{login}})))", + Usage: "LDAP login filter", + EnvVars: []string{"REVA_LDAP_LOGINFILTER"}, + Destination: &cfg.Reva.LDAP.LoginFilter, + }, + &cli.StringFlag{ + Name: "ldap-userfilter", + Value: "(&(objectclass=posixAccount)(|(ownclouduuid={{.OpaqueId}})(cn={{.OpaqueId}})))", + Usage: "LDAP filter used when getting a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.", + EnvVars: []string{"REVA_LDAP_USERFILTER"}, + Destination: &cfg.Reva.LDAP.UserFilter, + }, + &cli.StringFlag{ + Name: "ldap-attributefilter", + Value: "(&(objectclass=posixAccount)({{attr}}={{value}}))", + Usage: "LDAP filter used when searching for a user by claim/attribute. {{attr}} will be replaced with the attribute, {{value}} with the value.", + EnvVars: []string{"REVA_LDAP_ATTRIBUTEFILTER"}, + Destination: &cfg.Reva.LDAP.AttributeFilter, + }, + &cli.StringFlag{ + Name: "ldap-findfilter", + Value: "(&(objectclass=posixAccount)(|(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)))", + Usage: "LDAP filter used when searching for recipients. {{query}} will be replaced with the search query", + EnvVars: []string{"REVA_LDAP_FINDFILTER"}, + Destination: &cfg.Reva.LDAP.FindFilter, + }, + &cli.StringFlag{ + Name: "ldap-groupfilter", + // FIXME the reva implementation needs to use the memberof overlay to get the cn when it only has the uuid, + // because the ldap schema either uses the dn or the member(of) attributes to establish membership + Value: "(&(objectclass=posixGroup)(ownclouduuid={{.OpaqueId}}*))", // This filter will never work + Usage: "LDAP filter used when getting the groups of a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.", + EnvVars: []string{"REVA_LDAP_GROUPFILTER"}, + Destination: &cfg.Reva.LDAP.GroupFilter, + }, + &cli.StringFlag{ + Name: "ldap-bind-dn", + Value: "cn=reva,ou=sysusers,dc=example,dc=org", + Usage: "LDAP bind dn", + EnvVars: []string{"REVA_LDAP_BIND_DN"}, + Destination: &cfg.Reva.LDAP.BindDN, + }, + &cli.StringFlag{ + Name: "ldap-bind-password", + Value: "reva", + Usage: "LDAP bind password", + EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"}, + Destination: &cfg.Reva.LDAP.BindPassword, + }, + &cli.StringFlag{ + Name: "ldap-idp", + Value: "https://localhost:9200", + Usage: "Identity provider to use for users", + EnvVars: []string{"REVA_LDAP_IDP"}, + Destination: &cfg.Reva.LDAP.IDP, + }, + // ldap dn is always the dn + &cli.StringFlag{ + Name: "ldap-schema-uid", + Value: "ownclouduuid", + Usage: "LDAP schema uid", + EnvVars: []string{"REVA_LDAP_SCHEMA_UID"}, + Destination: &cfg.Reva.LDAP.Schema.UID, + }, + &cli.StringFlag{ + Name: "ldap-schema-mail", + Value: "mail", + Usage: "LDAP schema mail", + EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"}, + Destination: &cfg.Reva.LDAP.Schema.Mail, + }, + &cli.StringFlag{ + Name: "ldap-schema-displayName", + Value: "displayname", + Usage: "LDAP schema displayName", + EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"}, + Destination: &cfg.Reva.LDAP.Schema.DisplayName, + }, + &cli.StringFlag{ + Name: "ldap-schema-cn", + Value: "cn", + Usage: "LDAP schema cn", + EnvVars: []string{"REVA_LDAP_SCHEMA_CN"}, + Destination: &cfg.Reva.LDAP.Schema.CN, + }, + &cli.StringFlag{ + Name: "ldap-schema-uidnumber", + Value: "uidnumber", + Usage: "LDAP schema uidnumber", + EnvVars: []string{"REVA_LDAP_SCHEMA_UID_NUMBER"}, + Destination: &cfg.Reva.LDAP.Schema.UIDNumber, + }, + &cli.StringFlag{ + Name: "ldap-schema-gidnumber", + Value: "gidnumber", + Usage: "LDAP schema gidnumber", + EnvVars: []string{"REVA_LDAP_SCHEMA_GIDNUMBER"}, + Destination: &cfg.Reva.LDAP.Schema.GIDNumber, + }, + } +} diff --git a/pkg/flagset/secret.go b/pkg/flagset/secret.go new file mode 100644 index 000000000..deaa83aa7 --- /dev/null +++ b/pkg/flagset/secret.go @@ -0,0 +1,19 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// SecretWithConfig applies cfg to the root flagset +func SecretWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "jwt-secret", + Value: "Pive-Fumkiu4", + Usage: "Shared jwt secret for reva service communication", + EnvVars: []string{"REVA_JWT_SECRET"}, + Destination: &cfg.Reva.JWTSecret, + }, + } +} diff --git a/pkg/flagset/sharing.go b/pkg/flagset/sharing.go index b6f5420c2..34252bf97 100644 --- a/pkg/flagset/sharing.go +++ b/pkg/flagset/sharing.go @@ -7,42 +7,7 @@ import ( // SharingWithConfig applies cfg to the root flagset func SharingWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,35 +17,6 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"}, Destination: &cfg.Reva.Sharing.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -142,4 +78,10 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Sharing.PublicDriver, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index 29414ad74..51c95f04e 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageEOSWithConfig applies cfg to the root flagset func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,39 +17,8 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageEOS.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, - - // Services - - // Storage oc + // Storage eos &cli.StringFlag{ Name: "network", @@ -165,176 +97,14 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME_CREATION"}, Destination: &cfg.Reva.StorageEOS.EnableHomeCreation, }, - - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "/eos/dockertest/reva", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "/Shares", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: false, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storageeosdata.go b/pkg/flagset/storageeosdata.go index e8b5201e6..1249d6421 100644 --- a/pkg/flagset/storageeosdata.go +++ b/pkg/flagset/storageeosdata.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageEOSDataWithConfig applies cfg to the root flagset func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageEOSData.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -144,177 +78,6 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageEOSData.TempFolder, }, - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "/eos/dockertest/reva", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "/Shares", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: false, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - // Gateway &cli.StringFlag{ @@ -324,5 +87,24 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_GATEWAY_URL"}, Destination: &cfg.Reva.Gateway.URL, }, + + // User provider + + &cli.StringFlag{ + Name: "users-url", + Value: "localhost:9144", + Usage: "URL to use for the reva service", + EnvVars: []string{"REVA_USERS_URL"}, + Destination: &cfg.Reva.Users.URL, + }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 8a7b1dabf..c771ed268 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageHomeWithConfig applies cfg to the root flagset func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageHome.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -170,178 +104,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageHome.EnableHomeCreation, }, - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "/eos/dockertest/reva/users", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "/Shares", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Value: true, - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: true, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - // User provider &cli.StringFlag{ @@ -352,4 +114,13 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Users.URL, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 70bfc2419..494a8c50d 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageHomeDataWithConfig applies cfg to the root flagset func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageHomeData.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -144,178 +78,6 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageHomeData.TempFolder, }, - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "/eos/dockertest/reva/users", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "/Shares", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-mgm1.eoscluster.cern.ch:1094", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Value: true, - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "E/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: true, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - // Gateway &cli.StringFlag{ @@ -336,4 +98,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Users.URL, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index cfdc9e623..30f3153a7 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageOCWithConfig applies cfg to the root flagset func StorageOCWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageOC.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -166,180 +100,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageOC.EnableHomeCreation, }, - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-example.org", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-example.org", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Value: "", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Value: "", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Value: "", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: false, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - // User provider &cli.StringFlag{ @@ -350,4 +110,13 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Users.URL, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index cb27bd8b1..3952bb595 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageOCDataWithConfig applies cfg to the root flagset func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DATA_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageOCData.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -144,180 +78,6 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageOCData.TempFolder, }, - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-shadow-namespace", - // Defaults to path.Join(c.Namespace, ".shadow") - Usage: "Shadow namespace where share references are stored", - EnvVars: []string{"REVA_STORAGE_EOS_SHADOW_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.ShadowNamespace, - }, - &cli.StringFlag{ - Name: "storage-eos-share-folder", - Value: "", - Usage: "name of the share folder", - EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.EOS.ShareFolder, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-example.org", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-example.org", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Value: "", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Value: "", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Value: "", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: false, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, - // Gateway &cli.StringFlag{ @@ -338,4 +98,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Users.URL, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storagepubliclink.go b/pkg/flagset/storagepubliclink.go index a665d959f..ebe429d53 100644 --- a/pkg/flagset/storagepubliclink.go +++ b/pkg/flagset/storagepubliclink.go @@ -7,74 +7,16 @@ import ( // StoragePublicLink applies cfg to the root flagset func StoragePublicLink(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ + &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:10053", + Value: "0.0.0.0:9179", Usage: "Address to bind debug server", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, + &cli.StringFlag{ Name: "network", Value: "tcp", @@ -91,74 +33,19 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "addr", - Value: "localhost:10054", + Value: "0.0.0.0:9178", Usage: "Address to bind reva service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ADDR"}, Destination: &cfg.Reva.StoragePublicLink.Addr, }, - &cli.StringSliceFlag{ - Name: "service", - Value: cli.NewStringSlice("storageprovider"), - Usage: "--service storageprovider [--service otherservice]", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_SERVICES"}, + &cli.StringFlag{ + Name: "url", + Value: "localhost:9178", + Usage: "Address to bind reva service", + EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, + Destination: &cfg.Reva.StoragePublicLink.URL, }, - &cli.StringFlag{ - Name: "public_share_provider_addr", - Value: "localhost:9150", - Usage: "public share provider service address", - EnvVars: []string{"REVA_STORAGE_PUBLICLINK_PUBLIC_SHARE_PROVIDER_ADDR"}, - Destination: &cfg.Reva.StoragePublicLink.PublicShareProviderAddr, - }, - &cli.StringFlag{ - Name: "user_provider_addr", - Value: "localhost:9144", - Usage: "user provider service address", - EnvVars: []string{"REVA_STORAGE_PUBLICLINK_USER_PROVIDER_ADDR"}, - Destination: &cfg.Reva.StoragePublicLink.UserProviderAddr, - }, - &cli.StringFlag{ - Name: "storage_provider_addr", - Value: "localhost:9154", - Usage: "storage provider service address", - EnvVars: []string{"REVA_STORAGE_PUBLICLINK_STORAGE_PROVIDER_ADDR"}, - Destination: &cfg.Reva.StoragePublicLink.StorageProviderAddr, - }, - &cli.StringFlag{ - Name: "driver", - Value: "owncloud", - Usage: "storage driver, eg. local, eos, owncloud or s3", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DRIVER"}, - Destination: &cfg.Reva.StoragePublicLink.Driver, - }, - &cli.StringFlag{ - Name: "mount-id", - Value: "e1a73ede-549b-4226-abdf-40e69ca8230d", - Usage: "mount id", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_ID"}, - Destination: &cfg.Reva.StoragePublicLink.MountID, - }, - &cli.BoolFlag{ - Name: "expose-data-server", - Value: false, - Usage: "exposes a dedicated data server", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER"}, - Destination: &cfg.Reva.StoragePublicLink.ExposeDataServer, - }, - &cli.StringFlag{ - Name: "data-server-url", - Value: "http://localhost:9156/data", - Usage: "data server url", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_DATA_SERVER_URL"}, - Destination: &cfg.Reva.StoragePublicLink.DataServerURL, - }, - &cli.BoolFlag{ - Name: "enable-home-creation", - Value: true, - Usage: "if enabled home dirs will be automatically created", - EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_ENABLE_HOME_CREATION"}, - Destination: &cfg.Reva.StoragePublicLink.EnableHomeCreation, - }, &cli.StringFlag{ Name: "mount-path", Value: "/public/", @@ -166,6 +53,7 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH"}, Destination: &cfg.Reva.StoragePublicLink.MountPath, }, + &cli.StringFlag{ Name: "gateway-url", Value: "localhost:9142", @@ -174,4 +62,10 @@ func StoragePublicLink(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Gateway.URL, }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 1c19104bb..791f8fbd5 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -1,50 +1,13 @@ package flagset import ( - "os" - "github.com/micro/cli/v2" "github.com/owncloud/ocis-reva/pkg/config" ) // StorageRootWithConfig applies cfg to the root flagset func StorageRootWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -54,35 +17,6 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_DEBUG_ADDR"}, Destination: &cfg.Reva.StorageRoot.DebugAddr, }, - &cli.StringFlag{ - Name: "debug-token", - Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - - // REVA - - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, // Services @@ -163,165 +97,14 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"}, Destination: &cfg.Reva.StorageHome.EnableHomeCreation, }, - - // Storage drivers - - // Eos - - &cli.StringFlag{ - Name: "storage-eos-namespace", - Value: "", - Usage: "Namespace for metadata operations", - EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.EOS.Namespace, - }, - &cli.StringFlag{ - Name: "storage-eos-binary", - Value: "/usr/bin/eos", - Usage: "Location of the eos binary", - EnvVars: []string{"REVA_STORAGE_EOS_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.EosBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-xrdcopy-binary", - Value: "/usr/bin/xrdcopy", - Usage: "Location of the xrdcopy binary", - EnvVars: []string{"REVA_STORAGE_EOS_XRDCOPY_BINARY"}, - Destination: &cfg.Reva.Storages.EOS.XrdcopyBinary, - }, - &cli.StringFlag{ - Name: "storage-eos-master-url", - Value: "root://eos-example.org", - Usage: "URL of the Master EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_MASTER_URL"}, - Destination: &cfg.Reva.Storages.EOS.MasterURL, - }, - &cli.StringFlag{ - Name: "storage-eos-slave-url", - Value: "root://eos-example.org", - Usage: "URL of the Slave EOS MGM", - EnvVars: []string{"REVA_STORAGE_EOS_SLAVE_URL"}, - Destination: &cfg.Reva.Storages.EOS.SlaveURL, - }, - &cli.StringFlag{ - Name: "storage-eos-cache-directory", - Value: os.TempDir(), - Usage: "Location on the local fs where to store reads", - EnvVars: []string{"REVA_STORAGE_EOS_CACHE_DIRECTORY"}, - Destination: &cfg.Reva.Storages.EOS.CacheDirectory, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-logging", - Usage: "Enables logging of the commands executed", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_LOGGING"}, - Destination: &cfg.Reva.Storages.EOS.EnableLogging, - }, - &cli.BoolFlag{ - Name: "storage-eos-show-hidden-sysfiles", - Usage: "show internal EOS files like .sys.v# and .sys.a# files.", - EnvVars: []string{"REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES"}, - Destination: &cfg.Reva.Storages.EOS.ShowHiddenSysFiles, - }, - &cli.BoolFlag{ - Name: "storage-eos-force-singleuser-mode", - Usage: "force connections to EOS to use SingleUsername", - EnvVars: []string{"REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE"}, - Destination: &cfg.Reva.Storages.EOS.ForceSingleUserMode, - }, - &cli.BoolFlag{ - Name: "storage-eos-use-keytab", - Usage: "authenticate requests by using an EOS keytab", - EnvVars: []string{"REVA_STORAGE_EOS_USE_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.UseKeytab, - }, - &cli.BoolFlag{ - Name: "storage-eos-enable-home", - Usage: "enable the creation of home directories", - EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.EOS.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-eos-sec-protocol", - Value: "", - Usage: "the xrootd security protocol to use between the server and EOS", - EnvVars: []string{"REVA_STORAGE_EOS_SEC_PROTOCOL"}, - Destination: &cfg.Reva.Storages.EOS.SecProtocol, - }, - &cli.StringFlag{ - Name: "storage-eos-keytab", - Value: "", - Usage: "the location of the keytab to use to authenticate to EOS", - EnvVars: []string{"REVA_STORAGE_EOS_KEYTAB"}, - Destination: &cfg.Reva.Storages.EOS.Keytab, - }, - &cli.StringFlag{ - Name: "storage-eos-single-username", - Value: "", - Usage: "the username to use when SingleUserMode is enabled", - EnvVars: []string{"REVA_STORAGE_EOS_SINGLE_USERNAME"}, - Destination: &cfg.Reva.Storages.EOS.SingleUsername, - }, - &cli.StringFlag{ - Name: "storage-eos-layout", - Value: "{{substr 0 1 .Username}}/{{.Username}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.EOS.Layout, - }, - &cli.StringFlag{ - Name: "storage-eos-gatewaysvc", - Value: "localhost:9142", - Usage: "URL to use for the reva gateway service", - EnvVars: []string{"REVA_STORAGE_EOS_GATEWAYSVC"}, - Destination: &cfg.Reva.Storages.EOS.GatewaySVC, - }, - - // local - - &cli.StringFlag{ - Name: "storage-local-root", - Value: "/var/tmp/reva/root", - Usage: "the path to the local storage root", - EnvVars: []string{"REVA_STORAGE_LOCAL_ROOT"}, - Destination: &cfg.Reva.Storages.Local.Root, - }, - - // owncloud - - &cli.StringFlag{ - Name: "storage-owncloud-datadir", - Value: "/var/tmp/reva/data", - Usage: "the path to the owncloud data directory", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Datadirectory, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-scan", - Value: true, - Usage: "scan files on startup to add fileids", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SCAN"}, - Destination: &cfg.Reva.Storages.OwnCloud.Scan, - }, - &cli.StringFlag{ - Name: "storage-owncloud-redis", - Value: ":6379", - Usage: "the address of the redis server", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, - Destination: &cfg.Reva.Storages.OwnCloud.Redis, - }, - &cli.BoolFlag{ - Name: "storage-owncloud-enable-home", - Value: false, - Usage: "enable the creation of home storages", - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, - }, - &cli.StringFlag{ - Name: "storage-owncloud-layout", - Value: "{{.Id.OpaqueId}}", - Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, - EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.OwnCloud.Layout, - }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, DriverEOSWithConfig(cfg)...) + flags = append(flags, DriverLocalWithConfig(cfg)...) + flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + + return flags } diff --git a/pkg/flagset/tracing.go b/pkg/flagset/tracing.go new file mode 100644 index 000000000..5c39832a8 --- /dev/null +++ b/pkg/flagset/tracing.go @@ -0,0 +1,47 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// TracingWithConfig applies cfg to the root flagset +func TracingWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + + &cli.BoolFlag{ + Name: "tracing-enabled", + Usage: "Enable sending traces", + EnvVars: []string{"REVA_TRACING_ENABLED"}, + Destination: &cfg.Tracing.Enabled, + }, + &cli.StringFlag{ + Name: "tracing-type", + Value: "jaeger", + Usage: "Tracing backend type", + EnvVars: []string{"REVA_TRACING_TYPE"}, + Destination: &cfg.Tracing.Type, + }, + &cli.StringFlag{ + Name: "tracing-endpoint", + Value: "", + Usage: "Endpoint for the agent", + EnvVars: []string{"REVA_TRACING_ENDPOINT"}, + Destination: &cfg.Tracing.Endpoint, + }, + &cli.StringFlag{ + Name: "tracing-collector", + Value: "", + Usage: "Endpoint for the collector", + EnvVars: []string{"REVA_TRACING_COLLECTOR"}, + Destination: &cfg.Tracing.Collector, + }, + &cli.StringFlag{ + Name: "tracing-service", + Value: "reva", + Usage: "Service name for tracing", + EnvVars: []string{"REVA_TRACING_SERVICE"}, + Destination: &cfg.Tracing.Service, + }, + } +} diff --git a/pkg/flagset/users.go b/pkg/flagset/users.go index baaffec8b..b54df0633 100644 --- a/pkg/flagset/users.go +++ b/pkg/flagset/users.go @@ -7,42 +7,7 @@ import ( // UsersWithConfig applies cfg to the root flagset func UsersWithConfig(cfg *config.Config) []cli.Flag { - return []cli.Flag{ - - &cli.BoolFlag{ - Name: "tracing-enabled", - Usage: "Enable sending traces", - EnvVars: []string{"REVA_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - &cli.StringFlag{ - Name: "tracing-type", - Value: "jaeger", - Usage: "Tracing backend type", - EnvVars: []string{"REVA_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - &cli.StringFlag{ - Name: "tracing-endpoint", - Value: "", - Usage: "Endpoint for the agent", - EnvVars: []string{"REVA_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - &cli.StringFlag{ - Name: "tracing-collector", - Value: "", - Usage: "Endpoint for the collector", - EnvVars: []string{"REVA_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - &cli.StringFlag{ - Name: "tracing-service", - Value: "reva", - Usage: "Service name for tracing", - EnvVars: []string{"REVA_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, + flags := []cli.Flag{ // debug ports are the odd ports &cli.StringFlag{ @@ -52,153 +17,63 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_SHARING_DEBUG_ADDR"}, Destination: &cfg.Reva.Users.DebugAddr, }, + + // Services + + // Users + &cli.StringFlag{ - Name: "debug-token", + Name: "network", + Value: "tcp", + Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'", + EnvVars: []string{"REVA_USERS_NETWORK"}, + Destination: &cfg.Reva.Users.Network, + }, + &cli.StringFlag{ + Name: "protocol", + Value: "grpc", + Usage: "protocol for reva service, can be 'http' or 'grpc'", + EnvVars: []string{"REVA_USERS_PROTOCOL"}, + Destination: &cfg.Reva.Users.Protocol, + }, + &cli.StringFlag{ + Name: "addr", + Value: "0.0.0.0:9144", + Usage: "Address to bind reva service", + EnvVars: []string{"REVA_USERS_ADDR"}, + Destination: &cfg.Reva.Users.Addr, + }, + &cli.StringFlag{ + Name: "url", + Value: "localhost:9144", + Usage: "URL to use for the reva service", + EnvVars: []string{"REVA_USERS_URL"}, + Destination: &cfg.Reva.Users.URL, + }, + &cli.StringSliceFlag{ + Name: "service", + Value: cli.NewStringSlice("userprovider"), // TODO preferences + Usage: "--service userprovider [--service otherservice]", + EnvVars: []string{"REVA_USERS_SERVICES"}, + }, + + &cli.StringFlag{ + Name: "driver", + Value: "ldap", + Usage: "user driver: 'demo', 'json', 'ldap', or 'rest'", + EnvVars: []string{"REVA_USERS_DRIVER"}, + Destination: &cfg.Reva.Users.Driver, + }, + &cli.StringFlag{ + Name: "json-config", Value: "", - Usage: "Token to grant metrics access", - EnvVars: []string{"REVA_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - &cli.BoolFlag{ - Name: "debug-pprof", - Usage: "Enable pprof debugging", - EnvVars: []string{"REVA_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - &cli.BoolFlag{ - Name: "debug-zpages", - Usage: "Enable zpages debugging", - EnvVars: []string{"REVA_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, + Usage: "Path to users.json file", + EnvVars: []string{"REVA_USERS_JSON"}, + Destination: &cfg.Reva.Users.JSON, }, - // REVA + // rest driver - &cli.StringFlag{ - Name: "jwt-secret", - Value: "Pive-Fumkiu4", - Usage: "Shared jwt secret for reva service communication", - EnvVars: []string{"REVA_JWT_SECRET"}, - Destination: &cfg.Reva.JWTSecret, - }, - - // LDAP - - &cli.StringFlag{ - Name: "ldap-hostname", - Value: "localhost", - Usage: "LDAP hostname", - EnvVars: []string{"REVA_LDAP_HOSTNAME"}, - Destination: &cfg.Reva.LDAP.Hostname, - }, - &cli.IntFlag{ - Name: "ldap-port", - Value: 9126, - Usage: "LDAP port", - EnvVars: []string{"REVA_LDAP_PORT"}, - Destination: &cfg.Reva.LDAP.Port, - }, - &cli.StringFlag{ - Name: "ldap-base-dn", - Value: "dc=example,dc=org", - Usage: "LDAP basedn", - EnvVars: []string{"REVA_LDAP_BASE_DN"}, - Destination: &cfg.Reva.LDAP.BaseDN, - }, - &cli.StringFlag{ - Name: "ldap-userfilter", - Value: "(&(objectclass=posixAccount)(|(ownclouduuid={{.OpaqueId}})(cn={{.OpaqueId}})))", - Usage: "LDAP filter used when getting a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.", - EnvVars: []string{"REVA_LDAP_USERFILTER"}, - Destination: &cfg.Reva.LDAP.UserFilter, - }, - &cli.StringFlag{ - Name: "ldap-attributefilter", - Value: "(&(objectclass=posixAccount)({{attr}}={{value}}))", - Usage: "LDAP filter used when searching for a user by claim/attribute. {{attr}} will be replaced with the attribute, {{value}} with the value.", - EnvVars: []string{"REVA_LDAP_ATTRIBUTEFILTER"}, - Destination: &cfg.Reva.LDAP.AttributeFilter, - }, - &cli.StringFlag{ - Name: "ldap-findfilter", - Value: "(&(objectclass=posixAccount)(|(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)))", - Usage: "LDAP filter used when searching for recipients. {{query}} will be replaced with the search query", - EnvVars: []string{"REVA_LDAP_FINDFILTER"}, - Destination: &cfg.Reva.LDAP.FindFilter, - }, - &cli.StringFlag{ - Name: "ldap-groupfilter", - // FIXME the reva implementation needs to use the memberof overlay to get the cn when it only has the uuid, - // because the ldap schema either uses the dn or the member(of) attributes to establish membership - Value: "(&(objectclass=posixGroup)(ownclouduuid={{.OpaqueId}}*))", // This filter will never work - Usage: "LDAP filter used when getting the groups of a user. The CS3 userid properties {{.OpaqueId}} and {{.Idp}} are available.", - EnvVars: []string{"REVA_LDAP_GROUPFILTER"}, - Destination: &cfg.Reva.LDAP.GroupFilter, - }, - &cli.StringFlag{ - Name: "ldap-bind-dn", - Value: "cn=reva,ou=sysusers,dc=example,dc=org", - Usage: "LDAP bind dn", - EnvVars: []string{"REVA_LDAP_BIND_DN"}, - Destination: &cfg.Reva.LDAP.BindDN, - }, - &cli.StringFlag{ - Name: "ldap-bind-password", - Value: "reva", - Usage: "LDAP bind password", - EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"}, - Destination: &cfg.Reva.LDAP.BindPassword, - }, - &cli.StringFlag{ - Name: "ldap-idp", - Value: "https://localhost:9200", - Usage: "Identity provider to use for users", - EnvVars: []string{"REVA_LDAP_IDP"}, - Destination: &cfg.Reva.LDAP.IDP, - }, - // ldap dn is always the dn - &cli.StringFlag{ - Name: "ldap-schema-uid", - Value: "ownclouduuid", - Usage: "LDAP schema uid", - EnvVars: []string{"REVA_LDAP_SCHEMA_UID"}, - Destination: &cfg.Reva.LDAP.Schema.UID, - }, - &cli.StringFlag{ - Name: "ldap-schema-mail", - Value: "mail", - Usage: "LDAP schema mail", - EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"}, - Destination: &cfg.Reva.LDAP.Schema.Mail, - }, - &cli.StringFlag{ - Name: "ldap-schema-displayName", - Value: "displayname", - Usage: "LDAP schema displayName", - EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"}, - Destination: &cfg.Reva.LDAP.Schema.DisplayName, - }, - &cli.StringFlag{ - Name: "ldap-schema-cn", - Value: "cn", - Usage: "LDAP schema cn", - EnvVars: []string{"REVA_LDAP_SCHEMA_CN"}, - Destination: &cfg.Reva.LDAP.Schema.CN, - }, - &cli.StringFlag{ - Name: "ldap-schema-uidnumber", - Value: "uidnumber", - Usage: "LDAP schema uidnumber", - EnvVars: []string{"REVA_LDAP_SCHEMA_UID_NUMBER"}, - Destination: &cfg.Reva.LDAP.Schema.UIDNumber, - }, - &cli.StringFlag{ - Name: "ldap-schema-gidnumber", - Value: "gidnumber", - Usage: "LDAP schema gidnumber", - EnvVars: []string{"REVA_LDAP_SCHEMA_GIDNUMBER"}, - Destination: &cfg.Reva.LDAP.Schema.GIDNumber, - }, &cli.StringFlag{ Name: "rest-client-id", Value: "", @@ -269,59 +144,12 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_REST_TARGET_API"}, Destination: &cfg.Reva.UserRest.TargetAPI, }, - - // Services - - // Users - - &cli.StringFlag{ - Name: "network", - Value: "tcp", - Usage: "Network to use for the reva service, can be 'tcp', 'udp' or 'unix'", - EnvVars: []string{"REVA_USERS_NETWORK"}, - Destination: &cfg.Reva.Users.Network, - }, - &cli.StringFlag{ - Name: "protocol", - Value: "grpc", - Usage: "protocol for reva service, can be 'http' or 'grpc'", - EnvVars: []string{"REVA_USERS_PROTOCOL"}, - Destination: &cfg.Reva.Users.Protocol, - }, - &cli.StringFlag{ - Name: "addr", - Value: "0.0.0.0:9144", - Usage: "Address to bind reva service", - EnvVars: []string{"REVA_USERS_ADDR"}, - Destination: &cfg.Reva.Users.Addr, - }, - &cli.StringFlag{ - Name: "url", - Value: "localhost:9144", - Usage: "URL to use for the reva service", - EnvVars: []string{"REVA_USERS_URL"}, - Destination: &cfg.Reva.Users.URL, - }, - &cli.StringSliceFlag{ - Name: "service", - Value: cli.NewStringSlice("userprovider"), // TODO preferences - Usage: "--service userprovider [--service otherservice]", - EnvVars: []string{"REVA_USERS_SERVICES"}, - }, - - &cli.StringFlag{ - Name: "driver", - Value: "ldap", - Usage: "user driver: 'demo', 'json', 'ldap', or 'rest'", - EnvVars: []string{"REVA_USERS_DRIVER"}, - Destination: &cfg.Reva.Users.Driver, - }, - &cli.StringFlag{ - Name: "json-config", - Value: "", - Usage: "Path to users.json file", - EnvVars: []string{"REVA_USERS_JSON"}, - Destination: &cfg.Reva.Users.JSON, - }, } + + flags = append(flags, TracingWithConfig(cfg)...) + flags = append(flags, DebugWithConfig(cfg)...) + flags = append(flags, SecretWithConfig(cfg)...) + flags = append(flags, LDAPWithConfig(cfg)...) + + return flags } From 1cd35ce609952dd8ebc671b7344b562fcc12b452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 1 Sep 2020 15:34:21 +0200 Subject: [PATCH 02/13] add ocis driver, arbitrary storage driver rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- docs/configuration.md | 3 --- pkg/command/drivers.go | 41 +++++++++++++++++------------- pkg/command/gateway.go | 40 +++++++++++++---------------- pkg/config/config.go | 46 +++++++++++++++++++--------------- pkg/flagset/drivereos.go | 8 +++--- pkg/flagset/driverocis.go | 33 ++++++++++++++++++++++++ pkg/flagset/driverowncloud.go | 6 ++--- pkg/flagset/gateway.go | 31 +++++++++++------------ pkg/flagset/storageeos.go | 1 + pkg/flagset/storageeosdata.go | 1 + pkg/flagset/storagehome.go | 1 + pkg/flagset/storagehomedata.go | 1 + pkg/flagset/storageoc.go | 1 + pkg/flagset/storageocdata.go | 1 + pkg/flagset/storageroot.go | 1 + 15 files changed, 128 insertions(+), 87 deletions(-) create mode 100644 pkg/flagset/driverocis.go diff --git a/docs/configuration.md b/docs/configuration.md index f2523ec63..636ab4c0a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -885,9 +885,6 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --share-folder | $REVA_GATEWAY_SHARE_FOLDER : mount shares in this folder of the home storage provider. Default: `Shares`. ---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`. - --disable-home-creation-on-login | $REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN : Disable creation of home folder on login. diff --git a/pkg/command/drivers.go b/pkg/command/drivers.go index 7140409b3..3e1a41abe 100644 --- a/pkg/command/drivers.go +++ b/pkg/command/drivers.go @@ -7,10 +7,10 @@ import ( func drivers(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "eos": map[string]interface{}{ - "namespace": cfg.Reva.Storages.Common.Root, + "namespace": cfg.Reva.Storages.EOS.Root, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "uploads_namespace": cfg.Reva.Storages.EOS.UploadsNamespace, - "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "share_folder": cfg.Reva.Storages.EOS.ShareFolder, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, "master_url": cfg.Reva.Storages.EOS.MasterURL, @@ -26,10 +26,10 @@ func drivers(cfg *config.Config) map[string]interface{} { "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, }, "eoshome": map[string]interface{}{ - "namespace": cfg.Reva.Storages.Common.Root, + "namespace": cfg.Reva.Storages.EOS.Root, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, "uploads_namespace": cfg.Reva.Storages.EOS.UploadsNamespace, - "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "share_folder": cfg.Reva.Storages.EOS.ShareFolder, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, "master_url": cfg.Reva.Storages.EOS.MasterURL, @@ -38,7 +38,7 @@ func drivers(cfg *config.Config) map[string]interface{} { "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.Common.UserLayout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, @@ -46,9 +46,9 @@ func drivers(cfg *config.Config) map[string]interface{} { "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, }, "eosgrpc": map[string]interface{}{ - "namespace": cfg.Reva.Storages.Common.Root, + "namespace": cfg.Reva.Storages.EOS.Root, "shadow_namespace": cfg.Reva.Storages.EOS.ShadowNamespace, - "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "share_folder": cfg.Reva.Storages.EOS.ShareFolder, "eos_binary": cfg.Reva.Storages.EOS.EosBinary, "xrdcopy_binary": cfg.Reva.Storages.EOS.XrdcopyBinary, "master_url": cfg.Reva.Storages.EOS.MasterURL, @@ -58,38 +58,43 @@ func drivers(cfg *config.Config) map[string]interface{} { "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.Common.UserLayout, + "user_layout": cfg.Reva.Storages.EOS.UserLayout, "enable_logging": cfg.Reva.Storages.EOS.EnableLogging, "show_hidden_sys_files": cfg.Reva.Storages.EOS.ShowHiddenSysFiles, "force_single_user_mode": cfg.Reva.Storages.EOS.ForceSingleUserMode, "use_keytab": cfg.Reva.Storages.EOS.UseKeytab, - "enable_home": cfg.Reva.Storages.Common.EnableHome, + "enable_home": cfg.Reva.Storages.EOS.EnableHome, "gatewaysvc": cfg.Reva.Storages.EOS.GatewaySVC, }, "local": map[string]interface{}{ - "root": cfg.Reva.Storages.Common.Root, - "share_folder": cfg.Reva.Storages.Common.ShareFolder, + "root": cfg.Reva.Storages.Local.Root, + "share_folder": cfg.Reva.Storages.Local.ShareFolder, }, "localhome": map[string]interface{}{ - "root": cfg.Reva.Storages.Common.Root, - "share_folder": cfg.Reva.Storages.Common.ShareFolder, - "user_layout": cfg.Reva.Storages.Common.UserLayout, + "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.Common.Root, + "datadirectory": cfg.Reva.Storages.OwnCloud.Root, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "enable_home": cfg.Reva.Storages.Common.EnableHome, - "user_layout": cfg.Reva.Storages.Common.UserLayout, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, + "user_layout": cfg.Reva.Storages.OwnCloud.UserLayout, "userprovidersvc": cfg.Reva.Users.URL, }, + "ocis": map[string]interface{}{ + "root": cfg.Reva.Storages.Common.Root, + "enable_home": cfg.Reva.Storages.Common.EnableHome, + "user_layout": cfg.Reva.Storages.Common.UserLayout, + }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, "access_key": cfg.Reva.Storages.S3.AccessKey, "secret_key": cfg.Reva.Storages.S3.SecretKey, "endpoint": cfg.Reva.Storages.S3.Endpoint, "bucket": cfg.Reva.Storages.S3.Bucket, - "prefix": cfg.Reva.Storages.Common.Root, + "prefix": cfg.Reva.Storages.S3.Root, }, } } diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index f2f7644e9..3eceec340 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -5,6 +5,7 @@ import ( "os" "os/signal" "path" + "strings" "time" "github.com/cs3org/reva/cmd/revad/runtime" @@ -25,6 +26,7 @@ func Gateway(cfg *config.Config) *cli.Command { Flags: flagset.GatewayWithConfig(cfg), Before: func(c *cli.Context) error { cfg.Reva.Gateway.Services = c.StringSlice("service") + cfg.Reva.StorageRegistry.Rules = c.StringSlice("storage-registry-rule") return nil }, @@ -104,8 +106,6 @@ func Gateway(cfg *config.Config) *cli.Command { "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. - // public links - "link_grants_file": cfg.Reva.Gateway.LinkGrants, // other "disable_home_creation_on_login": cfg.Reva.Gateway.DisableHomeCreationOnLogin, "datagateway": urlWithScheme(cfg.Reva.DataGateway.URL), @@ -125,28 +125,11 @@ func Gateway(cfg *config.Config) *cli.Command { }, }, "storageregistry": map[string]interface{}{ - "driver": "static", + "driver": cfg.Reva.StorageRegistry.Driver, "drivers": map[string]interface{}{ "static": map[string]interface{}{ - "home_provider": cfg.Reva.Gateway.HomeProvider, - "rules": map[string]interface{}{ - cfg.Reva.StorageRoot.MountPath: cfg.Reva.StorageRoot.URL, - cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, - cfg.Reva.StorageHome.MountPath: cfg.Reva.StorageHome.URL, - cfg.Reva.StorageHome.MountID: cfg.Reva.StorageHome.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", - }, + "home_provider": cfg.Reva.StorageRegistry.HomeProvider, + "rules": rules(cfg), }, }, }, @@ -244,6 +227,17 @@ func Gateway(cfg *config.Config) *cli.Command { func rules(cfg *config.Config) map[string]interface{} { + // if a list of rules is given it overrides the generated rules from below + if len(cfg.Reva.StorageRegistry.Rules) > 0 { + rules := map[string]interface{}{} + for i := range cfg.Reva.StorageRegistry.Rules { + parts := strings.SplitN(cfg.Reva.StorageRegistry.Rules[i], "=", 2) + rules[parts[0]] = parts[1] + } + return rules + } + + // generate rules based on default config return map[string]interface{}{ cfg.Reva.StorageRoot.MountPath: cfg.Reva.StorageRoot.URL, cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, @@ -260,6 +254,6 @@ func rules(cfg *config.Config) map[string]interface{} { 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, + // public link storage returns the mount id of the actual storage } } diff --git a/pkg/config/config.go b/pkg/config/config.go index 71bcaf113..e28e58bd7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -23,9 +23,14 @@ type Gateway struct { ShareFolder string LinkGrants string DisableHomeCreationOnLogin bool - // include the home folder config for the storage registry +} + +// StorageRegistry defines the available storage registry configuration +type StorageRegistry struct { + Driver string // HomeProvider is the path in the global namespace that the static storage registry uses to determine the home storage HomeProvider string + Rules []string } // Sharing defines the available sharing configuration. @@ -100,15 +105,29 @@ type PublicStorage struct { // StorageConfig combines all available storage driver configuration parts. type StorageConfig struct { EOS DriverEOS - Local DriverLocal + Local DriverCommon OwnCloud DriverOwnCloud S3 DriverS3 Common DriverCommon // TODO checksums ... figure out what that is supposed to do } +// DriverCommon defines common driver configuration options. +type DriverCommon struct { + // Root is the absolute path to the location of the data + Root string + //ShareFolder defines the name of the folder jailing all shares + ShareFolder string + // UserLayout contains the template used to construct + // the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}` + UserLayout string + // EnableHome enables the creation of home directories. + EnableHome bool +} + // DriverEOS defines the available EOS driver configuration. type DriverEOS struct { + DriverCommon // ShadowNamespace for storing shadow data ShadowNamespace string @@ -167,32 +186,18 @@ type DriverEOS struct { GatewaySVC string } -// DriverLocal defines the available local storage driver configuration. -type DriverLocal struct { - Root string -} - -// DriverCommon defines common driver configuration options. -type DriverCommon struct { - // Root is the absolute path to the location of the data - Root string - //ShareFolder defines the name of the folder jailing all shares - ShareFolder string - // UserLayout contains the template used to construct - // the internal path, eg: `{{substr 0 1 .Username}}/{{.Username}}` - UserLayout string - // EnableHome enables the creation of home directories. - EnableHome bool -} - // DriverOwnCloud defines the available ownCloud storage driver configuration. type DriverOwnCloud struct { + DriverCommon + Redis string Scan bool } // DriverS3 defines the available S3 storage driver configuration. type DriverS3 struct { + DriverCommon + Region string AccessKey string SecretKey string @@ -270,6 +275,7 @@ type Reva struct { Frontend FrontendPort DataGateway Port Gateway Gateway + StorageRegistry StorageRegistry Users Users AuthProvider Users AuthBasic Port diff --git a/pkg/flagset/drivereos.go b/pkg/flagset/drivereos.go index 3ea27170a..3c2955d63 100644 --- a/pkg/flagset/drivereos.go +++ b/pkg/flagset/drivereos.go @@ -16,7 +16,7 @@ func DriverEOSWithConfig(cfg *config.Config) []cli.Flag { Value: "/eos/dockertest/reva", Usage: "Namespace for metadata operations", EnvVars: []string{"REVA_STORAGE_EOS_NAMESPACE"}, - Destination: &cfg.Reva.Storages.Common.Root, + Destination: &cfg.Reva.Storages.EOS.Root, }, &cli.StringFlag{ Name: "storage-eos-shadow-namespace", @@ -30,7 +30,7 @@ func DriverEOSWithConfig(cfg *config.Config) []cli.Flag { Value: "/Shares", Usage: "name of the share folder", EnvVars: []string{"REVA_STORAGE_EOS_SHARE_FOLDER"}, - Destination: &cfg.Reva.Storages.Common.ShareFolder, + Destination: &cfg.Reva.Storages.EOS.ShareFolder, }, &cli.StringFlag{ Name: "storage-eos-binary", @@ -95,7 +95,7 @@ func DriverEOSWithConfig(cfg *config.Config) []cli.Flag { Name: "storage-eos-enable-home", Usage: "enable the creation of home directories", EnvVars: []string{"REVA_STORAGE_EOS_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.Common.EnableHome, + Destination: &cfg.Reva.Storages.EOS.EnableHome, }, &cli.StringFlag{ Name: "storage-eos-sec-protocol", @@ -120,7 +120,7 @@ func DriverEOSWithConfig(cfg *config.Config) []cli.Flag { Value: "{{substr 0 1 .Username}}/{{.Username}}", Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.UsernameLower}} and {{.Provider}} also supports prefixing dirs: "{{.UsernamePrefixCount.2}}/{{.UsernameLower}}" will turn "Einstein" into "Ei/Einstein" `, EnvVars: []string{"REVA_STORAGE_EOS_LAYOUT"}, - Destination: &cfg.Reva.Storages.Common.UserLayout, + Destination: &cfg.Reva.Storages.EOS.UserLayout, }, &cli.StringFlag{ Name: "storage-eos-gatewaysvc", diff --git a/pkg/flagset/driverocis.go b/pkg/flagset/driverocis.go new file mode 100644 index 000000000..533b0f150 --- /dev/null +++ b/pkg/flagset/driverocis.go @@ -0,0 +1,33 @@ +package flagset + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/config" +) + +// DriverOCISWithConfig applies cfg to the root flagset +func DriverOCISWithConfig(cfg *config.Config) []cli.Flag { + return []cli.Flag{ + &cli.StringFlag{ + Name: "storage-ocis-root", + Value: "/var/tmp/ocis/root", + Usage: "the path to the local storage root", + EnvVars: []string{"REVA_STORAGE_OCIS_ROOT"}, + Destination: &cfg.Reva.Storages.Common.Root, + }, + &cli.BoolFlag{ + Name: "storage-ocis-enable-home", + Value: true, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OCIS_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.Common.EnableHome, + }, + &cli.StringFlag{ + Name: "storage-ocis-layout", + Value: "{{.Id.OpaqueId}}", + Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, + EnvVars: []string{"REVA_STORAGE_OCIS_LAYOUT"}, + Destination: &cfg.Reva.Storages.Common.UserLayout, + }, + } +} diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go index a33e94d41..7cbe16355 100644 --- a/pkg/flagset/driverowncloud.go +++ b/pkg/flagset/driverowncloud.go @@ -13,7 +13,7 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { Value: "/var/tmp/reva/data", Usage: "the path to the owncloud data directory", EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, - Destination: &cfg.Reva.Storages.Common.Root, + Destination: &cfg.Reva.Storages.OwnCloud.Root, }, &cli.BoolFlag{ Name: "storage-owncloud-scan", @@ -34,14 +34,14 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { Value: false, Usage: "enable the creation of home storages", EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, - Destination: &cfg.Reva.Storages.Common.EnableHome, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Id.OpaqueId}}", Usage: `"layout of the users home dir path on disk, in addition to {{.Username}}, {{.Mail}}, {{.Id.OpaqueId}}, {{.Id.Idp}} also supports prefixing dirs: "{{substr 0 1 .Username}}/{{.Username}}" will turn "Einstein" into "Ei/Einstein" `, EnvVars: []string{"REVA_STORAGE_OWNCLOUD_LAYOUT"}, - Destination: &cfg.Reva.Storages.Common.UserLayout, + Destination: &cfg.Reva.Storages.OwnCloud.UserLayout, }, } } diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 0da9e9df0..f773b90c3 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -98,14 +98,6 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_GATEWAY_SHARE_FOLDER"}, Destination: &cfg.Reva.Gateway.ShareFolder, }, - // TODO(refs) temporary workaround needed for storing link grants. - &cli.StringFlag{ - Name: "link_grants_file", - Value: "/var/tmp/reva/link_grants.json", - Usage: "when using a json manager, file to use as json serialized database", - EnvVars: []string{"REVA_GATEWAY_LINK_GRANTS_FILE"}, - Destination: &cfg.Reva.Gateway.LinkGrants, - }, &cli.BoolFlag{ Name: "disable-home-creation-on-login", Usage: "Disable creation of home folder on login", @@ -117,12 +109,26 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { // storage registry + &cli.StringFlag{ + Name: "storage-registry-driver", + Value: "static", + Usage: "driver of the storage registry", + EnvVars: []string{"REVA_STORAGE_REGISTRY_DRIVER"}, + Destination: &cfg.Reva.StorageRegistry.Driver, + }, + &cli.StringSliceFlag{ + Name: "storage-registry-rule", + Value: cli.NewStringSlice(), + Usage: `Replaces the generated storage registry rules with this set: --storage-registry-rule "/eos=localhost:9158" [--storage-registry-rule "1284d238-aa92-42ce-bdc4-0b0000009162=localhost:9162"]`, + EnvVars: []string{"REVA_STORAGE_REGISTRY_RULES"}, + }, + &cli.StringFlag{ Name: "storage-home-provider", Value: "/home", Usage: "mount point of the storage provider for user homes in the global namespace", EnvVars: []string{"REVA_STORAGE_HOME_PROVIDER"}, - Destination: &cfg.Reva.Gateway.HomeProvider, + Destination: &cfg.Reva.StorageRegistry.HomeProvider, }, &cli.StringFlag{ @@ -168,13 +174,6 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Sharing.URL, }, - &cli.StringSliceFlag{ - Name: "storage-registry-rule", - Value: cli.NewStringSlice(), - Usage: `Replace the generated storage registry rules with this set --storage-registry-rule "/eos=localhost:9158" [--storage-registry-rule "1284d238-aa92-42ce-bdc4-0b0000009162=localhost:9162"]`, - EnvVars: []string{"REVA_STORAGE_REGISTRY_RULES"}, - }, - &cli.StringFlag{ Name: "storage-root-url", Value: "localhost:9152", diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index 51c95f04e..39c9124a7 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -105,6 +105,7 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storageeosdata.go b/pkg/flagset/storageeosdata.go index 1249d6421..227a07847 100644 --- a/pkg/flagset/storageeosdata.go +++ b/pkg/flagset/storageeosdata.go @@ -105,6 +105,7 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index c771ed268..369b852c0 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -121,6 +121,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 494a8c50d..1d00b4ae5 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -105,6 +105,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 30f3153a7..8017b6daf 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -117,6 +117,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index 3952bb595..f984623a7 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -105,6 +105,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 791f8fbd5..57a05cd0a 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -105,6 +105,7 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { flags = append(flags, DriverEOSWithConfig(cfg)...) flags = append(flags, DriverLocalWithConfig(cfg)...) flags = append(flags, DriverOwnCloudWithConfig(cfg)...) + flags = append(flags, DriverOCISWithConfig(cfg)...) return flags } From bb278ddaafdfa3ad411518d8dfc8a62b96588ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 1 Sep 2020 16:10:56 +0200 Subject: [PATCH 03/13] reordering to align with reva, add missing owncloud options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/command/drivers.go | 6 ++++-- pkg/config/config.go | 5 +++-- pkg/flagset/driverowncloud.go | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/pkg/command/drivers.go b/pkg/command/drivers.go index 3e1a41abe..9a92b7996 100644 --- a/pkg/command/drivers.go +++ b/pkg/command/drivers.go @@ -77,10 +77,12 @@ func drivers(cfg *config.Config) map[string]interface{} { }, "owncloud": map[string]interface{}{ "datadirectory": cfg.Reva.Storages.OwnCloud.Root, - "scan": cfg.Reva.Storages.OwnCloud.Scan, + "upload_info_dir": cfg.Reva.Storages.OwnCloud.UploadInfoDir, + "sharedirectory": cfg.Reva.Storages.OwnCloud.ShareFolder, + "user_layout": cfg.Reva.Storages.OwnCloud.UserLayout, "redis": cfg.Reva.Storages.OwnCloud.Redis, "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, - "user_layout": cfg.Reva.Storages.OwnCloud.UserLayout, + "scan": cfg.Reva.Storages.OwnCloud.Scan, "userprovidersvc": cfg.Reva.Users.URL, }, "ocis": map[string]interface{}{ diff --git a/pkg/config/config.go b/pkg/config/config.go index e28e58bd7..aa539ec47 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -190,8 +190,9 @@ type DriverEOS struct { type DriverOwnCloud struct { DriverCommon - Redis string - Scan bool + UploadInfoDir string + Redis string + Scan bool } // DriverS3 defines the available S3 storage driver configuration. diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go index 7cbe16355..5e287df40 100644 --- a/pkg/flagset/driverowncloud.go +++ b/pkg/flagset/driverowncloud.go @@ -15,6 +15,20 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_DATADIR"}, Destination: &cfg.Reva.Storages.OwnCloud.Root, }, + &cli.StringFlag{ + Name: "storage-owncloud-uploadinfo-dir", + Value: "/var/tmp/reva/uploadinfo", + Usage: "the path to the tus upload info directory", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_UPLOADINFO_DIR"}, + Destination: &cfg.Reva.Storages.OwnCloud.UploadInfoDir, + }, + &cli.StringFlag{ + Name: "storage-owncloud-uploadinfo-dir", + Value: "/Shares", + Usage: "name of the shares folder", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SHARE_FOLDER"}, + Destination: &cfg.Reva.Storages.OwnCloud.ShareFolder, + }, &cli.BoolFlag{ Name: "storage-owncloud-scan", Value: true, From 5156ac5c2315f03ba8b9b032f9b87458794740aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 1 Sep 2020 16:17:10 +0200 Subject: [PATCH 04/13] fix flag name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/flagset/driverowncloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go index 5e287df40..8d5f0b5ab 100644 --- a/pkg/flagset/driverowncloud.go +++ b/pkg/flagset/driverowncloud.go @@ -23,7 +23,7 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.Storages.OwnCloud.UploadInfoDir, }, &cli.StringFlag{ - Name: "storage-owncloud-uploadinfo-dir", + Name: "storage-owncloud-share-folder", Value: "/Shares", Usage: "name of the shares folder", EnvVars: []string{"REVA_STORAGE_OWNCLOUD_SHARE_FOLDER"}, From 6054650988e9c3a0d7b6d38f1ca4083520475995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 7 Sep 2020 10:45:23 +0200 Subject: [PATCH 05/13] default oc driver to enable home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/flagset/driverowncloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go index 8d5f0b5ab..a9f027423 100644 --- a/pkg/flagset/driverowncloud.go +++ b/pkg/flagset/driverowncloud.go @@ -45,7 +45,7 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "storage-owncloud-enable-home", - Value: false, + Value: true, Usage: "enable the creation of home storages", EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, From 259e5640925eaa9e766ad4c6a6f7b6aee1508c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Sep 2020 13:11:02 +0200 Subject: [PATCH 06/13] home creation is a config option for storage drivers, not for storage providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/command/storageeos.go | 3 +-- pkg/command/storagehome.go | 3 +-- pkg/command/storageoc.go | 3 +-- pkg/command/storageroot.go | 13 ++++++------- pkg/config/config.go | 11 +++++------ pkg/flagset/storageeos.go | 7 ------- pkg/flagset/storagehome.go | 17 +++++------------ pkg/flagset/storageoc.go | 7 ------- pkg/flagset/storageroot.go | 6 ------ 9 files changed, 19 insertions(+), 51 deletions(-) diff --git a/pkg/command/storageeos.go b/pkg/command/storageeos.go index 6fab0e763..67300247a 100644 --- a/pkg/command/storageeos.go +++ b/pkg/command/storageeos.go @@ -93,8 +93,7 @@ func StorageEOS(cfg *config.Config) *cli.Command { "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/storagehome.go b/pkg/command/storagehome.go index c528ff8a8..731fc81a6 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -93,8 +93,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/storageoc.go b/pkg/command/storageoc.go index dfe39702b..2ca35b67f 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -93,8 +93,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/storageroot.go b/pkg/command/storageroot.go index ed9968018..b35c779dd 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -87,13 +87,12 @@ func StorageRoot(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "storageprovider": map[string]interface{}{ - "driver": cfg.Reva.StorageRoot.Driver, - "drivers": drivers(cfg), - "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, + "driver": cfg.Reva.StorageRoot.Driver, + "drivers": drivers(cfg), + "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 aa539ec47..a06da1be2 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -82,12 +82,11 @@ type FrontendPort 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 diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index 39c9124a7..c52b71d32 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -90,13 +90,6 @@ 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, - }, } flags = append(flags, TracingWithConfig(cfg)...) diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 369b852c0..c70aeeaad 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -73,11 +73,11 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "mount-id", - // This is tho mount id of the /oc storage - // set it to 1284d238-aa92-42ce-bdc4-0b0000009158 for /eos - // Value: "1284d238-aa92-42ce-bdc4-0b0000009162", /os - - Value: "1284d238-aa92-42ce-bdc4-0b0000009154", // /home + // This is the mount id of the storage provider using the same storage driver + // as /home but withoud home enabled. Set it to + // 1284d238-aa92-42ce-bdc4-0b0000009158 for /eos + // 1284d238-aa92-42ce-bdc4-0b0000009162 for /oc + Value: "1284d238-aa92-42ce-bdc4-0b0000009162", // /oc Usage: "mount id", EnvVars: []string{"REVA_STORAGE_HOME_MOUNT_ID"}, Destination: &cfg.Reva.StorageHome.MountID, @@ -96,13 +96,6 @@ 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, - }, // User provider diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 8017b6daf..0b6d7f8b9 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -92,13 +92,6 @@ 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, - }, // User provider diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 57a05cd0a..b02602f2f 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -91,12 +91,6 @@ 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, - }, } flags = append(flags, TracingWithConfig(cfg)...) From 6d4935c1f39a1ac0afa9f23596fa120b688d1d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Sep 2020 13:37:20 +0200 Subject: [PATCH 07/13] make only home storage default to enable home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/command/storagehome.go | 8 ++++++++ pkg/config/config.go | 1 + pkg/flagset/driverocis.go | 2 +- pkg/flagset/driverowncloud.go | 2 +- pkg/flagset/storagehome.go | 7 +++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index 731fc81a6..e63b708d0 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -70,6 +70,14 @@ func StorageHome(cfg *config.Config) *cli.Command { uuid := uuid.Must(uuid.NewV4()) pidFile := path.Join(os.TempDir(), "revad-"+c.Command.Name+"-"+uuid.String()+".pid") + // override driver enable home option with home config + if cfg.Reva.Storages.Home.EnableHome { + cfg.Reva.Storages.Common.EnableHome = true + cfg.Reva.Storages.EOS.EnableHome = true + cfg.Reva.Storages.Local.EnableHome = true + cfg.Reva.Storages.OwnCloud.EnableHome = true + cfg.Reva.Storages.S3.EnableHome = true + } rcfg := map[string]interface{}{ "core": map[string]interface{}{ "max_cpus": cfg.Reva.Users.MaxCPUs, diff --git a/pkg/config/config.go b/pkg/config/config.go index a06da1be2..aac373ac6 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -103,6 +103,7 @@ type PublicStorage struct { // StorageConfig combines all available storage driver configuration parts. type StorageConfig struct { + Home DriverCommon EOS DriverEOS Local DriverCommon OwnCloud DriverOwnCloud diff --git a/pkg/flagset/driverocis.go b/pkg/flagset/driverocis.go index 533b0f150..6338bf081 100644 --- a/pkg/flagset/driverocis.go +++ b/pkg/flagset/driverocis.go @@ -17,7 +17,7 @@ func DriverOCISWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "storage-ocis-enable-home", - Value: true, + Value: false, Usage: "enable the creation of home storages", EnvVars: []string{"REVA_STORAGE_OCIS_ENABLE_HOME"}, Destination: &cfg.Reva.Storages.Common.EnableHome, diff --git a/pkg/flagset/driverowncloud.go b/pkg/flagset/driverowncloud.go index a9f027423..8d5f0b5ab 100644 --- a/pkg/flagset/driverowncloud.go +++ b/pkg/flagset/driverowncloud.go @@ -45,7 +45,7 @@ func DriverOwnCloudWithConfig(cfg *config.Config) []cli.Flag { }, &cli.BoolFlag{ Name: "storage-owncloud-enable-home", - Value: true, + Value: false, Usage: "enable the creation of home storages", EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index c70aeeaad..467417f34 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -96,6 +96,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", + Value: true, + Usage: "enable the creation of home directories", + EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.Home.EnableHome, + }, // User provider From e3c081ba1a8b67f9642b81c8caa3810c2ce23b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Sep 2020 14:12:53 +0200 Subject: [PATCH 08/13] make home data use same enable home override 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/storagehomedata.go | 8 ++++++++ pkg/flagset/storagehomedata.go | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/pkg/command/storagehomedata.go b/pkg/command/storagehomedata.go index 6f909bd2d..3128fe034 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -70,6 +70,14 @@ func StorageHomeData(cfg *config.Config) *cli.Command { uuid := uuid.Must(uuid.NewV4()) pidFile := path.Join(os.TempDir(), "revad-"+c.Command.Name+"-"+uuid.String()+".pid") + // override driver enable home option with home config + if cfg.Reva.Storages.Home.EnableHome { + cfg.Reva.Storages.Common.EnableHome = true + cfg.Reva.Storages.EOS.EnableHome = true + cfg.Reva.Storages.Local.EnableHome = true + cfg.Reva.Storages.OwnCloud.EnableHome = true + cfg.Reva.Storages.S3.EnableHome = true + } rcfg := map[string]interface{}{ "core": map[string]interface{}{ "max_cpus": cfg.Reva.Users.MaxCPUs, diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 1d00b4ae5..4dc9ccf04 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -77,6 +77,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DATA_TEMP_FOLDER"}, Destination: &cfg.Reva.StorageHomeData.TempFolder, }, + &cli.BoolFlag{ + Name: "enable-home", + Value: true, + Usage: "enable the creation of home directories", + EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.Home.EnableHome, + }, // Gateway From 01592572f37770d476f6be7a194bf4920e24621b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Sep 2020 14:29:35 +0200 Subject: [PATCH 09/13] add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/config-cleanup.md | 8 ++++++++ changelog/unreleased/storage-registry-rules.md | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 changelog/unreleased/config-cleanup.md create mode 100644 changelog/unreleased/storage-registry-rules.md diff --git a/changelog/unreleased/config-cleanup.md b/changelog/unreleased/config-cleanup.md new file mode 100644 index 000000000..f969a9427 --- /dev/null +++ b/changelog/unreleased/config-cleanup.md @@ -0,0 +1,8 @@ +Bugfix: Fix default configuration for accessing shares + +The storage provider mounted at `/home` should always have EnableHome set to `true`. The other storage providers should have it set to `false`. + +https://github.com/owncloud/product/issues/205 +https://github.com/owncloud/ocis-reva/pull/461 + + diff --git a/changelog/unreleased/storage-registry-rules.md b/changelog/unreleased/storage-registry-rules.md new file mode 100644 index 000000000..31260b8a5 --- /dev/null +++ b/changelog/unreleased/storage-registry-rules.md @@ -0,0 +1,8 @@ +Enhancement: Allow configuring arbitrary storage registry rules + +We added a new config flag `storage-registry-rule` that can be given multiple times for the gateway to specify arbitrary storage registry rules. You can also use a comma separated list of rules in the `REVA_STORAGE_REGISTRY_RULES` environment variable. + +https://github.com/owncloud/product/issues/193 +https://github.com/owncloud/ocis-reva/pull/461 + + From 87b9469235ba162f224c96d97799af42bceff10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 8 Sep 2020 14:36:50 +0200 Subject: [PATCH 10/13] fix public sharing port, update generated docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- docs/configuration.md | 1392 ++++++++-------------------------------- pkg/flagset/gateway.go | 2 +- 2 files changed, 256 insertions(+), 1138 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 636ab4c0a..b57b1ab3e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,6 +1,6 @@ --- title: "Configuration" -date: "2020-06-24T22:26:40+0200" +date: "2020-09-08T14:35:15+0200" weight: 20 geekdocRepo: https://github.com/owncloud/ocis-reva geekdocEditPath: edit/master/docs @@ -57,411 +57,15 @@ Usage: `ocis-reva [global options] command [command options] [arguments...]` ## Sub Commands -### 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`. - ---debug-addr | $REVA_SHARING_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9145`. - ---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`. - ---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_USERS_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. - ---addr | $REVA_USERS_ADDR -: Address to bind reva service. Default: `0.0.0.0:9144`. - ---url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. - ---driver | $REVA_USERS_DRIVER -: user driver: 'demo', 'json' or 'ldap'. Default: `ldap`. - ---json-config | $REVA_USERS_JSON -: Path to users.json file. - -### ocis-reva auth-basic - -Start reva authprovider for basic auth - -Usage: `ocis-reva auth-basic [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_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. - ---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`. - ---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))`. - ---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_AUTH_BASIC_NETWORK -: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_AUTH_BASIC_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. - ---addr | $REVA_AUTH_BASIC_ADDR -: Address to bind reva service. Default: `0.0.0.0:9146`. - ---url | $REVA_AUTH_BASIC_URL -: URL to use for the reva service. Default: `localhost:9146`. - -### ocis-reva storage-oc-data - -Start reva storage-oc-data service - -Usage: `ocis-reva storage-oc-data [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_STORAGE_OC_DATA_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9165`. - ---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`. - ---network | $REVA_STORAGE_OC_DATA_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_STORAGE_OC_DATA_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. - ---addr | $REVA_STORAGE_OC_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9164`. - ---url | $REVA_STORAGE_OC_DATA_URL -: URL to use for the reva service. Default: `localhost:9164`. - ---driver | $REVA_STORAGE_OC_DATA_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. - ---prefix | $REVA_STORAGE_OC_DATA_PREFIX -: prefix for the http endpoint, without leading slash. Default: `data`. - ---temp-folder | $REVA_STORAGE_OC_DATA_TEMP_FOLDER -: temp folder. Default: `/var/tmp/`. - ---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`. - ---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. - ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. - ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: 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. - ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. - ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: 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}}`. - ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. - ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. - ---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}}`. - ---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 Usage: `ocis-reva storage-root [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_STORAGE_ROOT_DEBUG_ADDR : Address to bind debug server. Default: `0.0.0.0:9153`. ---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`. - --network | $REVA_STORAGE_ROOT_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. @@ -489,192 +93,15 @@ Usage: `ocis-reva storage-root [command options] [arguments...]` --data-server-url | $REVA_STORAGE_ROOT_DATA_SERVER_URL : data server url. ---enable-home-creation | $REVA_STORAGE_HOME_ENABLE_HOME_CREATION -: if enabled home dirs will be automatically created. - ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. - ---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`. - ---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. - ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. - ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: 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. - ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. - ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: 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}}`. - ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. - ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. - ---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 reva-storage-public-link - -Start reva storage-public-link service - -Usage: `ocis-reva reva-storage-public-link [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_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. - ---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`. - ---network | $REVA_STORAGE_PUBLIC_LINK_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_STORAGE_PUBLIC_LINK_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`. - ---storage_provider_addr | $REVA_STORAGE_PUBLICLINK_STORAGE_PROVIDER_ADDR -: storage provider service address. Default: `localhost:9154`. - ---driver | $REVA_STORAGE_PUBLIC_LINK_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`. - ---expose-data-server | $REVA_STORAGE_PUBLIC_LINK_EXPOSE_DATA_SERVER -: exposes a dedicated data server. Default: `true`. - ---data-server-url | $REVA_STORAGE_PUBLIC_LINK_DATA_SERVER_URL -: data server url. Default: `http://localhost:9156/data`. - ---enable-home-creation | $REVA_STORAGE_PUBLIC_LINK_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 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 auth-bearer Start reva authprovider for bearer auth Usage: `ocis-reva auth-bearer [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_AUTH_BEARER_DEBUG_ADDR : Address to bind debug server. Default: `0.0.0.0:9149`. ---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`. - --oidc-issuer | $REVA_OIDC_ISSUER : OIDC issuer. Default: `https://localhost:9200`. @@ -684,6 +111,12 @@ Usage: `ocis-reva auth-bearer [command options] [arguments...]` --oidc-id-claim | $REVA_OIDC_ID_CLAIM : OIDC id claim. Default: `preferred_username`. +--oidc-uid-claim | $REVA_OIDC_UID_CLAIM +: OIDC uid claim. + +--oidc-gid-claim | $REVA_OIDC_GID_CLAIM +: OIDC gid claim. + --network | $REVA_AUTH_BEARER_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. @@ -696,171 +129,15 @@ Usage: `ocis-reva auth-bearer [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. - ---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_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. - ---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`. - ---network | $REVA_STORAGE_HOME_DATA_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`. - ---addr | $REVA_STORAGE_HOME_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9156`. - ---url | $REVA_STORAGE_HOME_DATA_URL -: URL to use for the reva service. Default: `localhost:9156`. - ---driver | $REVA_STORAGE_HOME_DATA_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`. - ---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/users`. - ---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`. - ---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-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. - ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. - ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: 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. - ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. - ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: 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}}`. - ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. - ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. - ---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: `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}}`. - ---gateway-url | $REVA_GATEWAY_URL -: URL to use for the reva gateway service. Default: `localhost:9142`. - ### ocis-reva gateway Start reva gateway Usage: `ocis-reva gateway [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_GATEWAY_DEBUG_ADDR : Address to bind debug server. Default: `0.0.0.0:9143`. ---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`. @@ -888,6 +165,9 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --disable-home-creation-on-login | $REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN : Disable creation of home folder on login. +--storage-registry-driver | $REVA_STORAGE_REGISTRY_DRIVER +: driver of the storage registry. Default: `static`. + --storage-home-provider | $REVA_STORAGE_HOME_PROVIDER : mount point of the storage provider for user homes in the global namespace. Default: `/home`. @@ -924,6 +204,9 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --storage-home-mount-path | $REVA_STORAGE_HOME_MOUNT_PATH : mount path. Default: `/home`. +--storage-home-mount-id | $REVA_STORAGE_HOME_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009154`. + --storage-eos-url | $REVA_STORAGE_EOS_URL : URL to use for the reva service. Default: `localhost:9158`. @@ -942,8 +225,47 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --storage-oc-mount-id | $REVA_STORAGE_OC_MOUNT_ID : mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. ---public-links-url | $REVA_STORAGE_PUBLIC_LINK_URL -: URL to use for the public links service. Default: `localhost:10054`. +--public-link-url | $REVA_STORAGE_PUBLIC_LINK_URL +: URL to use for the public links service. Default: `localhost:9178`. + +--storage-public-link-mount-path | $REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH +: mount path. Default: `/public/`. + +### ocis-reva storage-eos-data + +Start reva storage-eos-data service + +Usage: `ocis-reva storage-eos-data [command options] [arguments...]` + +--debug-addr | $REVA_STORAGE_OC_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9161`. + +--network | $REVA_STORAGE_EOS_DATA_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_STORAGE_EOS_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`. + +--url | $REVA_STORAGE_EOS_DATA_URL +: URL to use for the reva service. Default: `localhost:9160`. + +--driver | $REVA_STORAGE_EOS_DATA_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. + +--prefix | $REVA_STORAGE_EOS_DATA_PREFIX +: prefix for the http endpoint, without leading slash. Default: `data`. + +--temp-folder | $REVA_STORAGE_EOS_DATA_TEMP_FOLDER +: temp folder. Default: `/var/tmp/`. + +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. + +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ### ocis-reva storage-home @@ -951,36 +273,9 @@ Start reva storage-home service Usage: `ocis-reva storage-home [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_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. - ---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`. - --network | $REVA_STORAGE_HOME_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. @@ -1008,263 +303,113 @@ Usage: `ocis-reva storage-home [command options] [arguments...]` --data-server-url | $REVA_STORAGE_HOME_DATA_SERVER_URL : data server url. Default: `http://localhost:9156/data`. ---enable-home-creation | $REVA_STORAGE_HOME_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/users`. - ---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`. - ---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-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. - ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. - ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME +--enable-home | $REVA_STORAGE_HOME_ENABLE_HOME : 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. +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +### ocis-reva reva-storage-public-link ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +Start reva storage-public-link service ---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}}`. +Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +--debug-addr | $REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9179`. ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. - ---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: `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}}`. - -### ocis-reva storage-eos-data - -Start reva storage-eos-data service - -Usage: `ocis-reva storage-eos-data [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_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. - ---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`. - ---network | $REVA_STORAGE_EOS_DATA_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_DATA_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. +--protocol | $REVA_STORAGE_PUBLIC_LINK_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---addr | $REVA_STORAGE_EOS_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9160`. +--addr | $REVA_STORAGE_PUBLIC_LINK_ADDR +: Address to bind reva service. Default: `0.0.0.0:9178`. ---url | $REVA_STORAGE_EOS_DATA_URL -: URL to use for the reva service. Default: `localhost:9160`. +--url | $REVA_STORAGE_PUBLIC_LINK_URL +: Address to bind reva service. Default: `localhost:9178`. ---driver | $REVA_STORAGE_EOS_DATA_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. - ---prefix | $REVA_STORAGE_EOS_DATA_PREFIX -: prefix for the http endpoint, without leading slash. Default: `data`. - ---temp-folder | $REVA_STORAGE_EOS_DATA_TEMP_FOLDER -: temp folder. Default: `/var/tmp/`. - ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva`. - ---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`. - ---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-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. - ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. - ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: 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. - ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. - ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: 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}}`. - ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. - ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. - ---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}}`. +--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 sharing +### ocis-reva auth-basic -Start reva sharing service +Start reva authprovider for basic auth -Usage: `ocis-reva sharing [command options] [arguments...]` +Usage: `ocis-reva auth-basic [command options] [arguments...]` ---tracing-enabled | $REVA_TRACING_ENABLED -: Enable sending traces. +--debug-addr | $REVA_AUTH_BASIC_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9147`. ---tracing-type | $REVA_TRACING_TYPE -: Tracing backend type. Default: `jaeger`. +--auth-driver | $REVA_AUTH_DRIVER +: auth driver: 'demo', 'json' or 'ldap'. Default: `ldap`. ---tracing-endpoint | $REVA_TRACING_ENDPOINT -: Endpoint for the agent. +--auth-json | $REVA_AUTH_JSON +: Path to users.json file. ---tracing-collector | $REVA_TRACING_COLLECTOR -: Endpoint for the collector. +--network | $REVA_AUTH_BASIC_NETWORK +: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---tracing-service | $REVA_TRACING_SERVICE -: Service name for tracing. Default: `reva`. - ---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. - ---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`. - ---network | $REVA_SHARING_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_SHARING_PROTOCOL +--protocol | $REVA_AUTH_BASIC_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`. +--addr | $REVA_AUTH_BASIC_ADDR +: Address to bind reva service. Default: `0.0.0.0:9146`. ---url | $REVA_SHARING_URL -: URL to use for the reva service. Default: `localhost:9150`. +--url | $REVA_AUTH_BASIC_URL +: URL to use for the reva service. Default: `localhost:9146`. ---user-driver | $REVA_SHARING_USER_DRIVER -: driver to use for the UserShareProvider. Default: `json`. +### ocis-reva frontend ---user-json-file | $REVA_SHARING_USER_JSON_FILE -: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. +Start reva frontend service ---public-driver | $REVA_SHARING_PUBLIC_DRIVER -: driver to use for the PublicShareProvider. Default: `json`. +Usage: `ocis-reva frontend [command options] [arguments...]` + +--debug-addr | $REVA_FRONTEND_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9141`. + +--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`. + +--datagateway-prefix | $REVA_FRONTEND_DATAGATEWAY_PREFIX +: datagateway prefix. Default: `data`. + +--ocdav-prefix | $REVA_FRONTEND_OCDAV_PREFIX +: owncloud webdav endpoint prefix. + +--ocs-prefix | $REVA_FRONTEND_OCS_PREFIX +: open collaboration services endpoint prefix. Default: `ocs`. + +--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-eos @@ -1272,36 +417,9 @@ Start reva storage-eos service Usage: `ocis-reva storage-eos [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_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. - ---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`. - --network | $REVA_STORAGE_EOS_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. @@ -1329,77 +447,89 @@ Usage: `ocis-reva storage-eos [command options] [arguments...]` --data-server-url | $REVA_STORAGE_EOS_DATA_SERVER_URL : data server url. Default: `http://localhost:9160/data`. ---enable-home-creation | $REVA_STORAGE_EOS_ENABLE_HOME_CREATION -: if enabled home dirs will be automatically created. Default: `false`. +### ocis-reva storage-oc-data ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. Default: `/eos/dockertest/reva`. +Start reva storage-oc-data service ---storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE -: Shadow namespace where share references are stored. +Usage: `ocis-reva storage-oc-data [command options] [arguments...]` ---storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. Default: `/Shares`. +--debug-addr | $REVA_STORAGE_OC_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9165`. ---storage-eos-binary | $REVA_STORAGE_EOS_BINARY -: Location of the eos binary. Default: `/usr/bin/eos`. +--network | $REVA_STORAGE_OC_DATA_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY -: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. +--protocol | $REVA_STORAGE_OC_DATA_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. ---storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +--addr | $REVA_STORAGE_OC_DATA_ADDR +: Address to bind reva service. Default: `0.0.0.0:9164`. ---storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-mgm1.eoscluster.cern.ch:1094`. +--url | $REVA_STORAGE_OC_DATA_URL +: URL to use for the reva service. Default: `localhost:9164`. ---storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY -: Location on the local fs where to store reads. Default: `os.TempDir()`. +--driver | $REVA_STORAGE_OC_DATA_DRIVER +: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. ---storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING -: Enables logging of the commands executed. +--prefix | $REVA_STORAGE_OC_DATA_PREFIX +: prefix for the http endpoint, without leading slash. Default: `data`. ---storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES -: show internal EOS files like .sys.v# and .sys.a# files.. +--temp-folder | $REVA_STORAGE_OC_DATA_TEMP_FOLDER +: temp folder. Default: `/var/tmp/`. ---storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE -: force connections to EOS to use SingleUsername. +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. +### ocis-reva health ---storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL -: the xrootd security protocol to use between the server and EOS. +Check health status ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +Usage: `ocis-reva health [command options] [arguments...]` ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +--debug-addr | $REVA_DEBUG_ADDR +: Address to debug endpoint. Default: `0.0.0.0:9109`. ---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}}`. +### ocis-reva storage-home-data ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +Start reva storage-home-data service ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. +Usage: `ocis-reva storage-home-data [command options] [arguments...]` ---storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN -: scan files on startup to add fileids. Default: `true`. +--debug-addr | $REVA_STORAGE_HOME_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9157`. ---storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR -: the address of the redis server. Default: `:6379`. +--network | $REVA_STORAGE_HOME_DATA_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `false`. +--protocol | $REVA_STORAGE_HOME_DATA_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. ---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}}`. +--addr | $REVA_STORAGE_HOME_DATA_ADDR +: Address to bind reva service. Default: `0.0.0.0:9156`. + +--url | $REVA_STORAGE_HOME_DATA_URL +: URL to use for the reva service. Default: `localhost:9156`. + +--driver | $REVA_STORAGE_HOME_DATA_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`. + +--temp-folder | $REVA_STORAGE_HOME_DATA_TEMP_FOLDER +: temp folder. Default: `/var/tmp/`. + +--enable-home | $REVA_STORAGE_HOME_ENABLE_HOME +: enable the creation of home directories. Default: `true`. + +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. + +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ### ocis-reva storage-oc @@ -1407,36 +537,9 @@ Start reva storage-oc service Usage: `ocis-reva storage-oc [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_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. - ---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`. - --network | $REVA_STORAGE_OC_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. @@ -1464,75 +567,90 @@ Usage: `ocis-reva storage-oc [command options] [arguments...]` --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`. +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---storage-eos-namespace | $REVA_STORAGE_EOS_NAMESPACE -: Namespace for metadata operations. +### ocis-reva users ---storage-eos-shadow-namespace | $REVA_STORAGE_EOS_SHADOW_NAMESPACE -: Shadow namespace where share references are stored. +Start reva users service ---storage-eos-share-folder | $REVA_STORAGE_EOS_SHARE_FOLDER -: name of the share folder. +Usage: `ocis-reva users [command options] [arguments...]` ---storage-eos-binary | $REVA_STORAGE_EOS_BINARY -: Location of the eos binary. Default: `/usr/bin/eos`. +--debug-addr | $REVA_SHARING_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9145`. ---storage-eos-xrdcopy-binary | $REVA_STORAGE_EOS_XRDCOPY_BINARY -: Location of the xrdcopy binary. Default: `/usr/bin/xrdcopy`. +--network | $REVA_USERS_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---storage-eos-master-url | $REVA_STORAGE_EOS_MASTER_URL -: URL of the Master EOS MGM. Default: `root://eos-example.org`. +--protocol | $REVA_USERS_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. ---storage-eos-slave-url | $REVA_STORAGE_EOS_SLAVE_URL -: URL of the Slave EOS MGM. Default: `root://eos-example.org`. +--addr | $REVA_USERS_ADDR +: Address to bind reva service. Default: `0.0.0.0:9144`. ---storage-eos-cache-directory | $REVA_STORAGE_EOS_CACHE_DIRECTORY -: Location on the local fs where to store reads. Default: `os.TempDir()`. +--url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. ---storage-eos-enable-logging | $REVA_STORAGE_EOS_ENABLE_LOGGING -: Enables logging of the commands executed. +--driver | $REVA_USERS_DRIVER +: user driver: 'demo', 'json', 'ldap', or 'rest'. Default: `ldap`. ---storage-eos-show-hidden-sysfiles | $REVA_STORAGE_EOS_SHOW_HIDDEN_SYSFILES -: show internal EOS files like .sys.v# and .sys.a# files.. +--json-config | $REVA_USERS_JSON +: Path to users.json file. ---storage-eos-force-singleuser-mode | $REVA_STORAGE_EOS_FORCE_SINGLEUSER_MODE -: force connections to EOS to use SingleUsername. +--rest-client-id | $REVA_REST_CLIENT_ID +: User rest driver Client ID. ---storage-eos-use-keytab | $REVA_STORAGE_EOS_USE_KEYTAB -: authenticate requests by using an EOS keytab. +--rest-client-secret | $REVA_REST_CLIENT_SECRET +: User rest driver Client Secret. ---storage-eos-enable-home | $REVA_STORAGE_EOS_ENABLE_HOME -: enable the creation of home directories. +--rest-redis-address | $REVA_REST_REDIS_ADDRESS +: Address for redis server. Default: `localhost:6379`. ---storage-eos-sec-protocol | $REVA_STORAGE_EOS_SEC_PROTOCOL -: the xrootd security protocol to use between the server and EOS. +--rest-redis-username | $REVA_REST_REDIS_USERNAME +: Username for redis server. ---storage-eos-keytab | $REVA_STORAGE_EOS_KEYTAB -: the location of the keytab to use to authenticate to EOS. +--rest-redis-password | $REVA_REST_REDIS_PASSWORD +: Password for redis server. ---storage-eos-single-username | $REVA_STORAGE_EOS_SINGLE_USERNAME -: the username to use when SingleUserMode is enabled. +--rest-id-provider | $REVA_REST_ID_PROVIDER +: The OIDC Provider. ---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}}`. +--rest-api-base-url | $REVA_REST_API_BASE_URL +: Base API Endpoint. ---storage-local-root | $REVA_STORAGE_LOCAL_ROOT -: the path to the local storage root. Default: `/var/tmp/reva/root`. +--rest-oidc-token-endpoint | $REVA_REST_OIDC_TOKEN_ENDPOINT +: Endpoint to generate token to access the API. ---storage-owncloud-datadir | $REVA_STORAGE_OWNCLOUD_DATADIR -: the path to the owncloud data directory. Default: `/var/tmp/reva/data`. +--rest-target-api | $REVA_REST_TARGET_API +: The target application. ---storage-owncloud-scan | $REVA_STORAGE_OWNCLOUD_SCAN -: scan files on startup to add fileids. Default: `true`. +### ocis-reva sharing ---storage-owncloud-redis | $REVA_STORAGE_OWNCLOUD_REDIS_ADDR -: the address of the redis server. Default: `:6379`. +Start reva sharing service ---storage-owncloud-enable-home | $REVA_STORAGE_OWNCLOUD_ENABLE_HOME -: enable the creation of home storages. Default: `false`. +Usage: `ocis-reva sharing [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}}`. +--debug-addr | $REVA_SHARING_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9151`. + +--network | $REVA_SHARING_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_SHARING_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`. + +--user-driver | $REVA_SHARING_USER_DRIVER +: driver to use for the UserShareProvider. Default: `json`. + +--user-json-file | $REVA_SHARING_USER_JSON_FILE +: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. + +--public-driver | $REVA_SHARING_PUBLIC_DRIVER +: driver to use for the PublicShareProvider. Default: `json`. diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index f773b90c3..a579b615b 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -264,7 +264,7 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "public-link-url", - Value: "localhost:10054", + Value: "localhost:9178", Usage: "URL to use for the public links service", EnvVars: []string{"REVA_STORAGE_PUBLIC_LINK_URL"}, Destination: &cfg.Reva.StoragePublicLink.URL, From d462e3212c3401452112ebb1a4d208ad5cb1a0ea Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 9 Sep 2020 12:37:32 +0200 Subject: [PATCH 11/13] Add ocis to driver list in help Also added slight hint about them being mounts with specific drivers. --- docs/configuration.md | 542 ++++++++++++++++----------------- pkg/flagset/storageeos.go | 2 +- pkg/flagset/storageeosdata.go | 2 +- pkg/flagset/storagehome.go | 2 +- pkg/flagset/storagehomedata.go | 2 +- pkg/flagset/storageoc.go | 2 +- pkg/flagset/storageocdata.go | 2 +- pkg/flagset/storageroot.go | 2 +- 8 files changed, 278 insertions(+), 278 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index b57b1ab3e..792b5a530 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,6 +1,6 @@ --- title: "Configuration" -date: "2020-09-08T14:35:15+0200" +date: "2020-09-09T12:38:00+0200" weight: 20 geekdocRepo: https://github.com/owncloud/ocis-reva geekdocEditPath: edit/master/docs @@ -57,77 +57,167 @@ Usage: `ocis-reva [global options] command [command options] [arguments...]` ## Sub Commands -### ocis-reva storage-root +### ocis-reva frontend -Start reva storage-root service +Start reva frontend service -Usage: `ocis-reva storage-root [command options] [arguments...]` +Usage: `ocis-reva frontend [command options] [arguments...]` ---debug-addr | $REVA_STORAGE_ROOT_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9153`. +--debug-addr | $REVA_FRONTEND_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9141`. ---network | $REVA_STORAGE_ROOT_NETWORK +--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_STORAGE_ROOT_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. +--protocol | $REVA_FRONTEND_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. ---addr | $REVA_STORAGE_ROOT_ADDR -: Address to bind reva service. Default: `0.0.0.0:9152`. +--addr | $REVA_FRONTEND_ADDR +: Address to bind reva service. Default: `0.0.0.0:9140`. ---url | $REVA_STORAGE_ROOT_URL -: URL to use for the reva service. Default: `localhost:9152`. +--url | $REVA_FRONTEND_URL +: URL to use for the reva service. Default: `https://localhost:9200`. ---driver | $REVA_STORAGE_ROOT_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `local`. +--datagateway-prefix | $REVA_FRONTEND_DATAGATEWAY_PREFIX +: datagateway prefix. Default: `data`. ---mount-path | $REVA_STORAGE_ROOT_MOUNT_PATH -: mount path. Default: `/`. +--ocdav-prefix | $REVA_FRONTEND_OCDAV_PREFIX +: owncloud webdav endpoint prefix. ---mount-id | $REVA_STORAGE_ROOT_MOUNT_ID -: mount id. Default: `123e4567-e89b-12d3-a456-426655440001`. +--ocs-prefix | $REVA_FRONTEND_OCS_PREFIX +: open collaboration services endpoint prefix. Default: `ocs`. ---expose-data-server | $REVA_STORAGE_ROOT_EXPOSE_DATA_SERVER -: exposes a dedicated data server. +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. ---data-server-url | $REVA_STORAGE_ROOT_DATA_SERVER_URL -: data server url. +--upload-disable-tus | $REVA_FRONTEND_UPLOAD_DISABLE_TUS +: Disables TUS upload mechanism. Default: `false`. -### ocis-reva auth-bearer +--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. -Start reva authprovider for bearer auth +### ocis-reva health -Usage: `ocis-reva auth-bearer [command options] [arguments...]` +Check health status ---debug-addr | $REVA_AUTH_BEARER_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9149`. +Usage: `ocis-reva health [command options] [arguments...]` ---oidc-issuer | $REVA_OIDC_ISSUER -: OIDC issuer. Default: `https://localhost:9200`. +--debug-addr | $REVA_DEBUG_ADDR +: Address to debug endpoint. Default: `0.0.0.0:9109`. ---oidc-insecure | $REVA_OIDC_INSECURE -: OIDC allow insecure communication. Default: `true`. +### ocis-reva storage-home-data ---oidc-id-claim | $REVA_OIDC_ID_CLAIM -: OIDC id claim. Default: `preferred_username`. +Start reva storage-home-data service ---oidc-uid-claim | $REVA_OIDC_UID_CLAIM -: OIDC uid claim. +Usage: `ocis-reva storage-home-data [command options] [arguments...]` ---oidc-gid-claim | $REVA_OIDC_GID_CLAIM -: OIDC gid claim. +--debug-addr | $REVA_STORAGE_HOME_DATA_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9157`. ---network | $REVA_AUTH_BEARER_NETWORK +--network | $REVA_STORAGE_HOME_DATA_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_AUTH_BEARER_PROTOCOL +--protocol | $REVA_STORAGE_HOME_DATA_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `http`. + +--addr | $REVA_STORAGE_HOME_DATA_ADDR +: Address to bind reva service. Default: `0.0.0.0:9156`. + +--url | $REVA_STORAGE_HOME_DATA_URL +: URL to use for the reva service. Default: `localhost:9156`. + +--driver | $REVA_STORAGE_HOME_DATA_DRIVER +: storage driver for home data mount: eg. local, eos, owncloud, ocis or s3. Default: `owncloud`. + +--prefix | $REVA_STORAGE_HOME_DATA_PREFIX +: prefix for the http endpoint, without leading slash. Default: `data`. + +--temp-folder | $REVA_STORAGE_HOME_DATA_TEMP_FOLDER +: temp folder. Default: `/var/tmp/`. + +--enable-home | $REVA_STORAGE_HOME_ENABLE_HOME +: enable the creation of home directories. Default: `true`. + +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. + +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. + +### ocis-reva storage-oc + +Start reva storage-oc service + +Usage: `ocis-reva storage-oc [command options] [arguments...]` + +--debug-addr | $REVA_STORAGE_OC_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9163`. + +--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_AUTH_BEARER_ADDR -: Address to bind reva service. Default: `0.0.0.0:9148`. +--addr | $REVA_STORAGE_OC_ADDR +: Address to bind reva service. Default: `0.0.0.0:9162`. ---url | $REVA_AUTH_BEARER_URL -: URL to use for the reva service. Default: `localhost:9148`. +--url | $REVA_STORAGE_OC_URL +: URL to use for the reva service. Default: `localhost:9162`. + +--driver | $REVA_STORAGE_OC_DRIVER +: storage driver for oc mount: eg. local, eos, owncloud, ocis 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: `false`. + +--data-server-url | $REVA_STORAGE_OC_DATA_SERVER_URL +: data server url. Default: `http://localhost:9164/data`. + +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. + +### ocis-reva auth-basic + +Start reva authprovider for basic auth + +Usage: `ocis-reva auth-basic [command options] [arguments...]` + +--debug-addr | $REVA_AUTH_BASIC_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9147`. + +--auth-driver | $REVA_AUTH_DRIVER +: auth driver: 'demo', 'json' or 'ldap'. Default: `ldap`. + +--auth-json | $REVA_AUTH_JSON +: Path to users.json file. + +--network | $REVA_AUTH_BASIC_NETWORK +: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_AUTH_BASIC_PROTOCOL +: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. + +--addr | $REVA_AUTH_BASIC_ADDR +: Address to bind reva service. Default: `0.0.0.0:9146`. + +--url | $REVA_AUTH_BASIC_URL +: URL to use for the reva service. Default: `localhost:9146`. ### ocis-reva gateway @@ -231,6 +321,36 @@ Usage: `ocis-reva gateway [command options] [arguments...]` --storage-public-link-mount-path | $REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH : mount path. Default: `/public/`. +### ocis-reva sharing + +Start reva sharing service + +Usage: `ocis-reva sharing [command options] [arguments...]` + +--debug-addr | $REVA_SHARING_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9151`. + +--network | $REVA_SHARING_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_SHARING_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`. + +--user-driver | $REVA_SHARING_USER_DRIVER +: driver to use for the UserShareProvider. Default: `json`. + +--user-json-file | $REVA_SHARING_USER_JSON_FILE +: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. + +--public-driver | $REVA_SHARING_PUBLIC_DRIVER +: driver to use for the PublicShareProvider. Default: `json`. + ### ocis-reva storage-eos-data Start reva storage-eos-data service @@ -253,7 +373,7 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` : URL to use for the reva service. Default: `localhost:9160`. --driver | $REVA_STORAGE_EOS_DATA_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. +: storage driver for eos data mount: eg. local, eos, owncloud, ocis or s3. Default: `eos`. --prefix | $REVA_STORAGE_EOS_DATA_PREFIX : prefix for the http endpoint, without leading slash. Default: `data`. @@ -267,149 +387,41 @@ Usage: `ocis-reva storage-eos-data [command options] [arguments...]` --users-url | $REVA_USERS_URL : URL to use for the reva service. Default: `localhost:9144`. -### ocis-reva storage-home +### ocis-reva auth-bearer -Start reva storage-home service +Start reva authprovider for bearer auth -Usage: `ocis-reva storage-home [command options] [arguments...]` +Usage: `ocis-reva auth-bearer [command options] [arguments...]` ---debug-addr | $REVA_STORAGE_HOME_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9155`. +--debug-addr | $REVA_AUTH_BEARER_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9149`. ---network | $REVA_STORAGE_HOME_NETWORK +--oidc-issuer | $REVA_OIDC_ISSUER +: OIDC issuer. Default: `https://localhost:9200`. + +--oidc-insecure | $REVA_OIDC_INSECURE +: OIDC allow insecure communication. Default: `true`. + +--oidc-id-claim | $REVA_OIDC_ID_CLAIM +: OIDC id claim. Default: `preferred_username`. + +--oidc-uid-claim | $REVA_OIDC_UID_CLAIM +: OIDC uid claim. + +--oidc-gid-claim | $REVA_OIDC_GID_CLAIM +: OIDC gid claim. + +--network | $REVA_AUTH_BEARER_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_STORAGE_HOME_PROTOCOL +--protocol | $REVA_AUTH_BEARER_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_AUTH_BEARER_ADDR +: Address to bind reva service. Default: `0.0.0.0:9148`. ---url | $REVA_STORAGE_HOME_URL -: URL to use for the reva service. Default: `localhost:9154`. - ---driver | $REVA_STORAGE_HOME_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. - ---mount-path | $REVA_STORAGE_HOME_MOUNT_PATH -: mount path. Default: `/home`. - ---mount-id | $REVA_STORAGE_HOME_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. - ---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 | $REVA_STORAGE_HOME_ENABLE_HOME -: enable the creation of home directories. Default: `true`. - ---users-url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. - -### ocis-reva reva-storage-public-link - -Start reva storage-public-link service - -Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` - ---debug-addr | $REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9179`. - ---network | $REVA_STORAGE_PUBLIC_LINK_NETWORK -: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_STORAGE_PUBLIC_LINK_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. - ---addr | $REVA_STORAGE_PUBLIC_LINK_ADDR -: Address to bind reva service. Default: `0.0.0.0:9178`. - ---url | $REVA_STORAGE_PUBLIC_LINK_URL -: Address to bind reva service. Default: `localhost:9178`. - ---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 auth-basic - -Start reva authprovider for basic auth - -Usage: `ocis-reva auth-basic [command options] [arguments...]` - ---debug-addr | $REVA_AUTH_BASIC_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9147`. - ---auth-driver | $REVA_AUTH_DRIVER -: auth driver: 'demo', 'json' or 'ldap'. Default: `ldap`. - ---auth-json | $REVA_AUTH_JSON -: Path to users.json file. - ---network | $REVA_AUTH_BASIC_NETWORK -: Network to use for the reva auth-basic service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. - ---protocol | $REVA_AUTH_BASIC_PROTOCOL -: protocol for reva service, can be 'http' or 'grpc'. Default: `grpc`. - ---addr | $REVA_AUTH_BASIC_ADDR -: Address to bind reva service. Default: `0.0.0.0:9146`. - ---url | $REVA_AUTH_BASIC_URL -: URL to use for the reva service. Default: `localhost:9146`. - -### ocis-reva frontend - -Start reva frontend service - -Usage: `ocis-reva frontend [command options] [arguments...]` - ---debug-addr | $REVA_FRONTEND_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9141`. - ---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`. - ---datagateway-prefix | $REVA_FRONTEND_DATAGATEWAY_PREFIX -: datagateway prefix. Default: `data`. - ---ocdav-prefix | $REVA_FRONTEND_OCDAV_PREFIX -: owncloud webdav endpoint prefix. - ---ocs-prefix | $REVA_FRONTEND_OCS_PREFIX -: open collaboration services endpoint prefix. Default: `ocs`. - ---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. +--url | $REVA_AUTH_BEARER_URL +: URL to use for the reva service. Default: `localhost:9148`. ### ocis-reva storage-eos @@ -433,7 +445,7 @@ Usage: `ocis-reva storage-eos [command options] [arguments...]` : URL to use for the reva service. Default: `localhost:9158`. --driver | $REVA_STORAGE_EOS_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `eos`. +: storage driver for eos mount: eg. local, eos, owncloud, ocis or s3. Default: `eos`. --mount-path | $REVA_STORAGE_EOS_MOUNT_PATH : mount path. Default: `/eos`. @@ -447,6 +459,48 @@ Usage: `ocis-reva storage-eos [command options] [arguments...]` --data-server-url | $REVA_STORAGE_EOS_DATA_SERVER_URL : data server url. Default: `http://localhost:9160/data`. +### ocis-reva storage-home + +Start reva storage-home service + +Usage: `ocis-reva storage-home [command options] [arguments...]` + +--debug-addr | $REVA_STORAGE_HOME_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9155`. + +--network | $REVA_STORAGE_HOME_NETWORK +: Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. + +--protocol | $REVA_STORAGE_HOME_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`. + +--url | $REVA_STORAGE_HOME_URL +: URL to use for the reva service. Default: `localhost:9154`. + +--driver | $REVA_STORAGE_HOME_DRIVER +: storage driver for home mount: eg. local, eos, owncloud, ocis or s3. Default: `owncloud`. + +--mount-path | $REVA_STORAGE_HOME_MOUNT_PATH +: mount path. Default: `/home`. + +--mount-id | $REVA_STORAGE_HOME_MOUNT_ID +: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. + +--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 | $REVA_STORAGE_HOME_ENABLE_HOME +: enable the creation of home directories. Default: `true`. + +--users-url | $REVA_USERS_URL +: URL to use for the reva service. Default: `localhost:9144`. + ### ocis-reva storage-oc-data Start reva storage-oc-data service @@ -469,7 +523,7 @@ Usage: `ocis-reva storage-oc-data [command options] [arguments...]` : URL to use for the reva service. Default: `localhost:9164`. --driver | $REVA_STORAGE_OC_DATA_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. +: storage driver for oc data mount: eg. local, eos, owncloud, ocis or s3. Default: `owncloud`. --prefix | $REVA_STORAGE_OC_DATA_PREFIX : prefix for the http endpoint, without leading slash. Default: `data`. @@ -483,92 +537,41 @@ Usage: `ocis-reva storage-oc-data [command options] [arguments...]` --users-url | $REVA_USERS_URL : URL to use for the reva service. Default: `localhost:9144`. -### ocis-reva health +### ocis-reva storage-root -Check health status +Start reva storage-root service -Usage: `ocis-reva health [command options] [arguments...]` +Usage: `ocis-reva storage-root [command options] [arguments...]` ---debug-addr | $REVA_DEBUG_ADDR -: Address to debug endpoint. Default: `0.0.0.0:9109`. +--debug-addr | $REVA_STORAGE_ROOT_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9153`. -### ocis-reva storage-home-data - -Start reva storage-home-data service - -Usage: `ocis-reva storage-home-data [command options] [arguments...]` - ---debug-addr | $REVA_STORAGE_HOME_DATA_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9157`. - ---network | $REVA_STORAGE_HOME_DATA_NETWORK +--network | $REVA_STORAGE_ROOT_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`. - ---addr | $REVA_STORAGE_HOME_DATA_ADDR -: Address to bind reva service. Default: `0.0.0.0:9156`. - ---url | $REVA_STORAGE_HOME_DATA_URL -: URL to use for the reva service. Default: `localhost:9156`. - ---driver | $REVA_STORAGE_HOME_DATA_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`. - ---temp-folder | $REVA_STORAGE_HOME_DATA_TEMP_FOLDER -: temp folder. Default: `/var/tmp/`. - ---enable-home | $REVA_STORAGE_HOME_ENABLE_HOME -: enable the creation of home directories. Default: `true`. - ---gateway-url | $REVA_GATEWAY_URL -: URL to use for the reva gateway service. Default: `localhost:9142`. - ---users-url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. - -### ocis-reva storage-oc - -Start reva storage-oc service - -Usage: `ocis-reva storage-oc [command options] [arguments...]` - ---debug-addr | $REVA_STORAGE_OC_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9163`. - ---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 | $REVA_STORAGE_ROOT_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`. +--addr | $REVA_STORAGE_ROOT_ADDR +: Address to bind reva service. Default: `0.0.0.0:9152`. ---url | $REVA_STORAGE_OC_URL -: URL to use for the reva service. Default: `localhost:9162`. +--url | $REVA_STORAGE_ROOT_URL +: URL to use for the reva service. Default: `localhost:9152`. ---driver | $REVA_STORAGE_OC_DRIVER -: storage driver, eg. local, eos, owncloud or s3. Default: `owncloud`. +--driver | $REVA_STORAGE_ROOT_DRIVER +: storage driver for root mount: eg. local, eos, owncloud, ocis or s3. Default: `local`. ---mount-path | $REVA_STORAGE_OC_MOUNT_PATH -: mount path. Default: `/oc`. +--mount-path | $REVA_STORAGE_ROOT_MOUNT_PATH +: mount path. Default: `/`. ---mount-id | $REVA_STORAGE_OC_MOUNT_ID -: mount id. Default: `1284d238-aa92-42ce-bdc4-0b0000009162`. +--mount-id | $REVA_STORAGE_ROOT_MOUNT_ID +: mount id. Default: `123e4567-e89b-12d3-a456-426655440001`. ---expose-data-server | $REVA_STORAGE_OC_EXPOSE_DATA_SERVER -: exposes a dedicated data server. Default: `false`. +--expose-data-server | $REVA_STORAGE_ROOT_EXPOSE_DATA_SERVER +: exposes a dedicated data server. ---data-server-url | $REVA_STORAGE_OC_DATA_SERVER_URL -: data server url. Default: `http://localhost:9164/data`. - ---users-url | $REVA_USERS_URL -: URL to use for the reva service. Default: `localhost:9144`. +--data-server-url | $REVA_STORAGE_ROOT_DATA_SERVER_URL +: data server url. ### ocis-reva users @@ -624,33 +627,30 @@ Usage: `ocis-reva users [command options] [arguments...]` --rest-target-api | $REVA_REST_TARGET_API : The target application. -### ocis-reva sharing +### ocis-reva reva-storage-public-link -Start reva sharing service +Start reva storage-public-link service -Usage: `ocis-reva sharing [command options] [arguments...]` +Usage: `ocis-reva reva-storage-public-link [command options] [arguments...]` ---debug-addr | $REVA_SHARING_DEBUG_ADDR -: Address to bind debug server. Default: `0.0.0.0:9151`. +--debug-addr | $REVA_STORAGE_PUBLIC_LINK_DEBUG_ADDR +: Address to bind debug server. Default: `0.0.0.0:9179`. ---network | $REVA_SHARING_NETWORK +--network | $REVA_STORAGE_PUBLIC_LINK_NETWORK : Network to use for the reva service, can be 'tcp', 'udp' or 'unix'. Default: `tcp`. ---protocol | $REVA_SHARING_PROTOCOL +--protocol | $REVA_STORAGE_PUBLIC_LINK_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`. +--addr | $REVA_STORAGE_PUBLIC_LINK_ADDR +: Address to bind reva service. Default: `0.0.0.0:9178`. ---url | $REVA_SHARING_URL -: URL to use for the reva service. Default: `localhost:9150`. +--url | $REVA_STORAGE_PUBLIC_LINK_URL +: Address to bind reva service. Default: `localhost:9178`. ---user-driver | $REVA_SHARING_USER_DRIVER -: driver to use for the UserShareProvider. Default: `json`. +--mount-path | $REVA_STORAGE_PUBLIC_LINK_MOUNT_PATH +: mount path. Default: `/public/`. ---user-json-file | $REVA_SHARING_USER_JSON_FILE -: file used to persist shares for the UserShareProvider. Default: `/var/tmp/reva/shares.json`. - ---public-driver | $REVA_SHARING_PUBLIC_DRIVER -: driver to use for the PublicShareProvider. Default: `json`. +--gateway-url | $REVA_GATEWAY_URL +: URL to use for the reva gateway service. Default: `localhost:9142`. diff --git a/pkg/flagset/storageeos.go b/pkg/flagset/storageeos.go index c52b71d32..a11a18e75 100644 --- a/pkg/flagset/storageeos.go +++ b/pkg/flagset/storageeos.go @@ -58,7 +58,7 @@ func StorageEOSWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "eos", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for eos mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_EOS_DRIVER"}, Destination: &cfg.Reva.StorageEOS.Driver, }, diff --git a/pkg/flagset/storageeosdata.go b/pkg/flagset/storageeosdata.go index 227a07847..1ba2a46a4 100644 --- a/pkg/flagset/storageeosdata.go +++ b/pkg/flagset/storageeosdata.go @@ -59,7 +59,7 @@ func StorageEOSDataWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "eos", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for eos data mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_EOS_DATA_DRIVER"}, Destination: &cfg.Reva.StorageEOSData.Driver, }, diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 467417f34..49fd4bed0 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -60,7 +60,7 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "owncloud", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for home mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_HOME_DRIVER"}, Destination: &cfg.Reva.StorageHome.Driver, }, diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 4dc9ccf04..d6672bef2 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -59,7 +59,7 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "owncloud", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for home data mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_HOME_DATA_DRIVER"}, Destination: &cfg.Reva.StorageHomeData.Driver, }, diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 0b6d7f8b9..718970a22 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -60,7 +60,7 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "owncloud", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for oc mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_OC_DRIVER"}, Destination: &cfg.Reva.StorageOC.Driver, }, diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index f984623a7..ebf3ae02b 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -59,7 +59,7 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "owncloud", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for oc data mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_OC_DATA_DRIVER"}, Destination: &cfg.Reva.StorageOCData.Driver, }, diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index b02602f2f..55cda67bd 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -60,7 +60,7 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", Value: "local", - Usage: "storage driver, eg. local, eos, owncloud or s3", + Usage: "storage driver for root mount: eg. local, eos, owncloud, ocis or s3", EnvVars: []string{"REVA_STORAGE_ROOT_DRIVER"}, Destination: &cfg.Reva.StorageRoot.Driver, }, From aa41066f93f8bc03aa3f4e5d494d4912177c20b1 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 10 Sep 2020 10:07:40 +0200 Subject: [PATCH 12/13] Update core commit --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 6fec0eeea..0a90c42db 100644 --- a/.drone.star +++ b/.drone.star @@ -1,7 +1,7 @@ config = { 'apiTests': { 'coreBranch': 'master', - 'coreCommit': '1f5506549cbebdc910b6d24681278e9a210f6d82', + 'coreCommit': 'dd8d46129616602f02a0740bb5cf83bd6b28aa19', 'numberOfParts': 2 } } From 40f24f296cdb30ada05771df44f71e1590535ca8 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 10 Sep 2020 10:25:07 +0200 Subject: [PATCH 13/13] Remove expected failure for download on received share --- tests/acceptance/expected-failures-on-OC-storage.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/acceptance/expected-failures-on-OC-storage.txt b/tests/acceptance/expected-failures-on-OC-storage.txt index 56b9be3e5..3ca62aa25 100644 --- a/tests/acceptance/expected-failures-on-OC-storage.txt +++ b/tests/acceptance/expected-failures-on-OC-storage.txt @@ -186,7 +186,6 @@ apiShareManagement/acceptShares.feature:696 # # https://github.com/owncloud/product/issues/208 After accepting a share data in the received file cannot be downloaded apiShareManagement/acceptSharesToSharesFolder.feature:15 -apiShareManagement/acceptSharesToSharesFolder.feature:22 # # https://github.com/owncloud/product/issues/207 Response is empty when accepting a share apiShareManagement/acceptSharesToSharesFolder.feature:30