From c8b7e9793ab13cb4b36bd35fb1a8cacc2bdcf506 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 21 Jun 2022 09:05:45 +0200 Subject: [PATCH 1/2] remove unused configuration --- changelog/unreleased/fix-remove-unused-config.md | 8 ++++++++ .../grpc/services/storageprovider/storageprovider.go | 11 ----------- internal/http/services/dataprovider/dataprovider.go | 1 - 3 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 changelog/unreleased/fix-remove-unused-config.md diff --git a/changelog/unreleased/fix-remove-unused-config.md b/changelog/unreleased/fix-remove-unused-config.md new file mode 100644 index 0000000000..cc41f539e5 --- /dev/null +++ b/changelog/unreleased/fix-remove-unused-config.md @@ -0,0 +1,8 @@ +Bugfix: Remove unused configuration + +We've fixed removed unused configuration: + +- `insecure` from the dataprovider +- `tmp_folder` from the storageprovider + +https://github.com/cs3org/reva/pull/2993 diff --git a/internal/grpc/services/storageprovider/storageprovider.go b/internal/grpc/services/storageprovider/storageprovider.go index c1e9d5e42f..91a56563a5 100644 --- a/internal/grpc/services/storageprovider/storageprovider.go +++ b/internal/grpc/services/storageprovider/storageprovider.go @@ -60,7 +60,6 @@ func init() { type config struct { Driver string `mapstructure:"driver" docs:"localhome;The storage driver to be used."` Drivers map[string]map[string]interface{} `mapstructure:"drivers" docs:"url:pkg/storage/fs/localhome/localhome.go"` - TmpFolder string `mapstructure:"tmp_folder" docs:"/var/tmp;Path to temporary folder."` DataServerURL string `mapstructure:"data_server_url" docs:"http://localhost/data;The URL for the data server."` ExposeDataServer bool `mapstructure:"expose_data_server" docs:"false;Whether to expose data server."` // if true the client will be able to upload/download directly to it AvailableXS map[string]uint32 `mapstructure:"available_checksums" docs:"nil;List of available checksums."` @@ -73,10 +72,6 @@ func (c *config) init() { c.Driver = "localhome" } - if c.TmpFolder == "" { - c.TmpFolder = "/var/tmp/reva/tmp" - } - if c.DataServerURL == "" { host, err := os.Hostname() if err != nil || host == "" { @@ -95,7 +90,6 @@ func (c *config) init() { type service struct { conf *config storage storage.FS - tmpFolder string dataServerURL *url.URL availableXS []*provider.ResourceChecksumPriority } @@ -164,10 +158,6 @@ func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { c.init() - if err := os.MkdirAll(c.TmpFolder, 0755); err != nil { - return nil, err - } - fs, err := getFS(c) if err != nil { return nil, err @@ -198,7 +188,6 @@ func New(m map[string]interface{}, ss *grpc.Server) (rgrpc.Service, error) { service := &service{ conf: c, storage: fs, - tmpFolder: c.TmpFolder, dataServerURL: u, availableXS: xsTypes, } diff --git a/internal/http/services/dataprovider/dataprovider.go b/internal/http/services/dataprovider/dataprovider.go index bdf76de63e..c71f74790f 100644 --- a/internal/http/services/dataprovider/dataprovider.go +++ b/internal/http/services/dataprovider/dataprovider.go @@ -45,7 +45,6 @@ type config struct { Drivers map[string]map[string]interface{} `mapstructure:"drivers" docs:"url:pkg/storage/fs/localhome/localhome.go;The configuration for the storage driver"` DataTXs map[string]map[string]interface{} `mapstructure:"data_txs" docs:"url:pkg/rhttp/datatx/manager/simple/simple.go;The configuration for the data tx protocols"` Timeout int64 `mapstructure:"timeout"` - Insecure bool `mapstructure:"insecure"` NatsAddress string `mapstructure:"nats_address"` NatsClusterID string `mapstructure:"nats_clusterID"` } From 401002c89ed078fd0639c58d8b4963da3fe8aa8c Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 21 Jun 2022 10:40:06 +0200 Subject: [PATCH 2/2] remove unused timeout option from the dataprovider --- changelog/unreleased/fix-remove-unused-config.md | 1 + internal/http/services/dataprovider/dataprovider.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/fix-remove-unused-config.md b/changelog/unreleased/fix-remove-unused-config.md index cc41f539e5..f9d7b36db1 100644 --- a/changelog/unreleased/fix-remove-unused-config.md +++ b/changelog/unreleased/fix-remove-unused-config.md @@ -3,6 +3,7 @@ Bugfix: Remove unused configuration We've fixed removed unused configuration: - `insecure` from the dataprovider +- `timeout` from the dataprovider - `tmp_folder` from the storageprovider https://github.com/cs3org/reva/pull/2993 diff --git a/internal/http/services/dataprovider/dataprovider.go b/internal/http/services/dataprovider/dataprovider.go index c71f74790f..e614e5b36a 100644 --- a/internal/http/services/dataprovider/dataprovider.go +++ b/internal/http/services/dataprovider/dataprovider.go @@ -44,7 +44,6 @@ type config struct { Driver string `mapstructure:"driver" docs:"localhome;The storage driver to be used."` Drivers map[string]map[string]interface{} `mapstructure:"drivers" docs:"url:pkg/storage/fs/localhome/localhome.go;The configuration for the storage driver"` DataTXs map[string]map[string]interface{} `mapstructure:"data_txs" docs:"url:pkg/rhttp/datatx/manager/simple/simple.go;The configuration for the data tx protocols"` - Timeout int64 `mapstructure:"timeout"` NatsAddress string `mapstructure:"nats_address"` NatsClusterID string `mapstructure:"nats_clusterID"` }