diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index bd597ec5c5..4583755844 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -7,3 +7,4 @@ https://github.com/owncloud/ocis/pull/5285 https://github.com/owncloud/ocis/pull/5310 https://github.com/owncloud/ocis/pull/5404 https://github.com/owncloud/ocis/pull/5460 +https://github.com/owncloud/ocis/pull/5613 diff --git a/go.mod b/go.mod index 6fd9207154..bce7e7c476 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,8 @@ require ( github.com/go-micro/plugins/v4/registry/nats v1.2.1 github.com/go-micro/plugins/v4/server/grpc v1.2.0 github.com/go-micro/plugins/v4/server/http v1.2.0 + github.com/go-micro/plugins/v4/store/nats-js v1.1.0 + github.com/go-micro/plugins/v4/store/redis v1.1.0 github.com/go-micro/plugins/v4/wrapper/breaker/gobreaker v1.2.0 github.com/go-micro/plugins/v4/wrapper/monitoring/prometheus v1.2.0 github.com/go-micro/plugins/v4/wrapper/trace/opencensus v1.1.0 @@ -38,6 +40,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.4.3 github.com/golang/protobuf v1.5.2 github.com/google/go-tika v0.2.0 + github.com/google/uuid v1.3.0 github.com/gookit/config/v2 v2.1.8 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0 @@ -49,6 +52,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/nats-io/nats-server/v2 v2.9.4 + github.com/nats-io/nats.go v1.19.0 github.com/oklog/run v1.1.0 github.com/olekukonko/tablewriter v0.0.5 github.com/onsi/ginkgo v1.16.5 @@ -166,8 +170,6 @@ require ( github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-micro/plugins/v4/store/nats-js v1.1.0 // indirect - github.com/go-micro/plugins/v4/store/redis v1.1.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect @@ -184,7 +186,6 @@ require ( github.com/gomodule/redigo v1.8.9 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.3.0 // indirect github.com/gookit/goutil v0.5.15 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/schema v1.2.0 // indirect @@ -236,7 +237,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mschoch/smat v0.2.0 // indirect github.com/nats-io/jwt/v2 v2.3.0 // indirect - github.com/nats-io/nats.go v1.19.0 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/nxadm/tail v1.4.8 // indirect diff --git a/services/storage-system/pkg/config/config.go b/services/storage-system/pkg/config/config.go index 9439ca8d86..3896f3be4d 100644 --- a/services/storage-system/pkg/config/config.go +++ b/services/storage-system/pkg/config/config.go @@ -73,6 +73,7 @@ type Drivers struct { } type OCISDriver struct { + MetadataBackend string `yaml:"metadata_backend" env:"STORAGE_SYSTEM_OCIS_METADATA_BACKEND" desc:"The backend to use for storing metadata. Supported values are 'xattrs' and 'ini'. The setting 'xattrs' uses extended attributes to store file metadata while 'ini' uses a dedicated file to store file metadata. Defaults to 'xattrs'."` // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_SYSTEM_OCIS_ROOT" desc:"Path for the directory where the STORAGE-SYSTEM service stores it's persistent data. If not definied, the root directory derives from $OCIS_BASE_DATA_PATH:/storage."` diff --git a/services/storage-system/pkg/config/defaults/defaultconfig.go b/services/storage-system/pkg/config/defaults/defaultconfig.go index f8f3d4b093..06b85be28f 100644 --- a/services/storage-system/pkg/config/defaults/defaultconfig.go +++ b/services/storage-system/pkg/config/defaults/defaultconfig.go @@ -41,6 +41,7 @@ func DefaultConfig() *config.Config { Driver: "ocis", Drivers: config.Drivers{ OCIS: config.OCISDriver{ + MetadataBackend: "xattrs", Root: filepath.Join(defaults.BaseDataPath(), "storage", "metadata"), MaxAcquireLockCycles: 20, LockCycleDurationFactor: 30, diff --git a/services/storage-system/pkg/revaconfig/config.go b/services/storage-system/pkg/revaconfig/config.go index c4e1e7d329..007280c824 100644 --- a/services/storage-system/pkg/revaconfig/config.go +++ b/services/storage-system/pkg/revaconfig/config.go @@ -153,6 +153,7 @@ func StorageSystemFromStruct(cfg *config.Config) map[string]interface{} { func metadataDrivers(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ "ocis": map[string]interface{}{ + "metadata_backend": cfg.Drivers.OCIS.MetadataBackend, "root": cfg.Drivers.OCIS.Root, "user_layout": "{{.Id.OpaqueId}}", "treetime_accounting": false, diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 5bf644c7ff..ccb7be39a0 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -88,6 +88,7 @@ type Drivers struct { } type OCISDriver struct { + MetadataBackend string `yaml:"metadata_backend" env:"STORAGE_USERS_OCIS_METADATA_BACKEND" desc:"The backend to use for storing metadata. Supported values are 'xattrs' and 'ini'. The setting 'xattrs' uses extended attributes to store file metadata while 'ini' uses a dedicated file to store file metadata. Defaults to 'xattrs'."` // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT" desc:"The directory where the filesystem storage will store blobs and metadata. If not definied, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/users."` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_OCIS_USER_LAYOUT" desc:"Template string for the user storage layout in the user directory."` @@ -107,6 +108,7 @@ type OCISDriver struct { } type S3NGDriver struct { + MetadataBackend string `yaml:"metadata_backend" env:"STORAGE_USERS_S3NG_METADATA_BACKEND" desc:"The backend to use for storing metadata. Supported values are 'xattrs' and 'ini'. The setting 'xattrs' uses extended attributes to store file metadata while 'ini' uses a dedicated file to store file metadata. Defaults to 'xattrs'."` // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_S3NG_ROOT" desc:"The directory where the filesystem storage will store metadata for blobs. If not definied, the root directory derives from $OCIS_BASE_DATA_PATH:/storage/users."` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_S3NG_USER_LAYOUT" desc:"Template string for the user storage layout in the user directory."` diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index 6a413d1dae..494a7c8ea8 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -58,6 +58,7 @@ func DefaultConfig() *config.Config { UsersProviderEndpoint: "localhost:9144", }, S3NG: config.S3NGDriver{ + MetadataBackend: "xattrs", Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"), ShareFolder: "/Shares", UserLayout: "{{.Id.OpaqueId}}", @@ -69,6 +70,7 @@ func DefaultConfig() *config.Config { LockCycleDurationFactor: 30, }, OCIS: config.OCISDriver{ + MetadataBackend: "xattrs", Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"), ShareFolder: "/Shares", UserLayout: "{{.Id.OpaqueId}}", diff --git a/services/storage-users/pkg/revaconfig/drivers.go b/services/storage-users/pkg/revaconfig/drivers.go index b9f5a03a06..9a9ec41623 100644 --- a/services/storage-users/pkg/revaconfig/drivers.go +++ b/services/storage-users/pkg/revaconfig/drivers.go @@ -111,6 +111,7 @@ func OwnCloudSQL(cfg *config.Config) map[string]interface{} { // Ocis is the config mapping for the Ocis storage driver func Ocis(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ + "metadata_backend": cfg.Drivers.OCIS.MetadataBackend, "root": cfg.Drivers.OCIS.Root, "user_layout": cfg.Drivers.OCIS.UserLayout, "share_folder": cfg.Drivers.OCIS.ShareFolder, @@ -148,6 +149,7 @@ func Ocis(cfg *config.Config) map[string]interface{} { // OcisNoEvents is the config mapping for the ocis storage driver emitting no events func OcisNoEvents(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ + "metadata_backend": cfg.Drivers.OCIS.MetadataBackend, "root": cfg.Drivers.OCIS.Root, "user_layout": cfg.Drivers.OCIS.UserLayout, "share_folder": cfg.Drivers.OCIS.ShareFolder, @@ -184,6 +186,7 @@ func S3(cfg *config.Config) map[string]interface{} { // S3NG is the config mapping for the s3ng storage driver func S3NG(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ + "metadata_backend": cfg.Drivers.S3NG.MetadataBackend, "root": cfg.Drivers.S3NG.Root, "user_layout": cfg.Drivers.S3NG.UserLayout, "share_folder": cfg.Drivers.S3NG.ShareFolder, @@ -225,6 +228,7 @@ func S3NG(cfg *config.Config) map[string]interface{} { // S3NGNoEvents is the config mapping for the s3ng storage driver emitting no events func S3NGNoEvents(cfg *config.Config) map[string]interface{} { return map[string]interface{}{ + "metadata_backend": cfg.Drivers.S3NG.MetadataBackend, "root": cfg.Drivers.S3NG.Root, "user_layout": cfg.Drivers.S3NG.UserLayout, "share_folder": cfg.Drivers.S3NG.ShareFolder,