From de76dc72d4e7034ef4c0e8d9da3fcb3e47f21668 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:02:31 +0200 Subject: [PATCH 1/3] fix env variables for JSONCS3 public driver configuration (#4593) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix env variables for JSONCS3 public driver configuration * Update services/sharing/pkg/config/config.go Co-authored-by: Jörn Friedrich Dreyer * extend list of available sharing drivers * add changelog Co-authored-by: Michael Barz Co-authored-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-jsoncs3-config-options.md | 13 +++++++++++++ services/sharing/pkg/config/config.go | 12 ++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 changelog/unreleased/fix-jsoncs3-config-options.md diff --git a/changelog/unreleased/fix-jsoncs3-config-options.md b/changelog/unreleased/fix-jsoncs3-config-options.md new file mode 100644 index 00000000000..e62720b4cee --- /dev/null +++ b/changelog/unreleased/fix-jsoncs3-config-options.md @@ -0,0 +1,13 @@ +Bugfix: Fix sharing jsoncs3 driver options + +We've fixed the environment variable config options of the jsoncs3 driver that previously +used the same environment variables as the cs3 driver. +Now the jsoncs3 driver has it's own configuration environment variables. + +If you used the jsoncs3 sharing driver and explicitly set `SHARING_PUBLIC_CS3_SYSTEM_USER_ID`, +this PR is a breaking change for your deployment. To workaround you may set the value you had +configured in `SHARING_PUBLIC_CS3_SYSTEM_USER_ID` to both `SHARING_PUBLIC_JSONCS3_SYSTEM_USER_ID` +and `SHARING_PUBLIC_JSONCS3_SYSTEM_USER_IDP`. + + +https://github.com/owncloud/ocis/pull/4593 diff --git a/services/sharing/pkg/config/config.go b/services/sharing/pkg/config/config.go index a6b815a1bff..a68167e5a28 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -21,9 +21,9 @@ type Config struct { SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"SHARING_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token."` - UserSharingDriver string `yaml:"user_sharing_driver" env:"SHARING_USER_DRIVER" desc:"Driver to be used to persist shares. Supported values are 'json', 'cs3' and 'owncloudsql'."` + UserSharingDriver string `yaml:"user_sharing_driver" env:"SHARING_USER_DRIVER" desc:"Driver to be used to persist shares. Supported values are 'jsoncs3', 'json', 'cs3' and 'owncloudsql'."` UserSharingDrivers UserSharingDrivers `yaml:"user_sharing_drivers"` - PublicSharingDriver string `yaml:"public_sharing_driver" env:"SHARING_PUBLIC_DRIVER" desc:"Driver to be used to persist public shares. Supported values are 'json' and 'cs3'."` + PublicSharingDriver string `yaml:"public_sharing_driver" env:"SHARING_PUBLIC_DRIVER" desc:"Driver to be used to persist public shares. Supported values are 'jsoncs3', 'json' and 'cs3'."` PublicSharingDrivers PublicSharingDrivers `yaml:"public_sharing_drivers"` Supervised bool `yaml:"-"` @@ -143,10 +143,10 @@ type PublicSharingCS3Driver struct { // PublicSharingJSONCS3Driver holds the jsoncs3 driver config type PublicSharingJSONCS3Driver struct { - ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."` - SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_CS3_SYSTEM_USER_ID" desc:"ID of the oCIS STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format."` - SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_ID" desc:"IDP of the oCIS STORAGE-SYSTEM system user."` - SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_PUBLIC_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."` + ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_JSONCS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."` + SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_JSONCS3_SYSTEM_USER_ID" desc:"ID of the oCIS STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format."` + SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_JSONCS3_SYSTEM_USER_IDP" desc:"IDP of the oCIS STORAGE-SYSTEM system user."` + SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_PUBLIC_JSONCS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."` } type Events struct { From 1551d442e6aa185bb463d5cf271b5771dbbaee18 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 6 Oct 2022 08:03:01 +0000 Subject: [PATCH 2/3] Automated changelog update [skip ci] --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07e7cb9296d..80beba2776e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The following sections list the changes for unreleased. * Bugfix - Bring back the settings UI in Web: [#4691](https://github.com/owncloud/ocis/pull/4691) * Bugfix - Fix cache stat table config: [#4732](https://github.com/owncloud/ocis/pull/4732) * Bugfix - Change the default value for PROXY_OIDC_INSECURE to false: [#4601](https://github.com/owncloud/ocis/pull/4601) +* Bugfix - Fix sharing jsoncs3 driver options: [#4593](https://github.com/owncloud/ocis/pull/4593) * Bugfix - Don't run auth-bearer service by default: [#4692](https://github.com/owncloud/ocis/issues/4692) * Bugfix - Fix notifications service settings: [#4652](https://github.com/owncloud/ocis/pull/4652) * Bugfix - Fix the OIDC provider cache: [#4600](https://github.com/owncloud/ocis/pull/4600) @@ -58,6 +59,20 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4601 +* Bugfix - Fix sharing jsoncs3 driver options: [#4593](https://github.com/owncloud/ocis/pull/4593) + + We've fixed the environment variable config options of the jsoncs3 driver that previously + used the same environment variables as the cs3 driver. Now the jsoncs3 driver has it's own + configuration environment variables. + + If you used the jsoncs3 sharing driver and explicitly set + `SHARING_PUBLIC_CS3_SYSTEM_USER_ID`, this PR is a breaking change for your deployment. To + workaround you may set the value you had configured in `SHARING_PUBLIC_CS3_SYSTEM_USER_ID` + to both `SHARING_PUBLIC_JSONCS3_SYSTEM_USER_ID` and + `SHARING_PUBLIC_JSONCS3_SYSTEM_USER_IDP`. + + https://github.com/owncloud/ocis/pull/4593 + * Bugfix - Don't run auth-bearer service by default: [#4692](https://github.com/owncloud/ocis/issues/4692) We no longer start the auth-bearer service by default. This service is currently unused and not From f92a355287b78ef857f2df452fa490d503fc6e0c Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 6 Oct 2022 12:37:25 +0200 Subject: [PATCH 3/3] use latest experimental reva Signed-off-by: jkoberg --- go.mod | 3 +-- go.sum | 6 ++---- services/search/pkg/service/grpc/v0/service.go | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index c64772f3926..7b88668613d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.4 github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20220929083235-bb0b1a236d6c - github.com/cs3org/reva/v2 v2.10.1-0.20221004122722-dd0e54110612 + github.com/cs3org/reva/v2 v2.10.1-0.20221006094710-138513fc9c32 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 @@ -98,7 +98,6 @@ require ( github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895 // indirect - github.com/ReneKroon/ttlcache/v2 v2.11.0 // indirect github.com/RoaringBitmap/roaring v0.9.4 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect github.com/ajg/form v1.5.1 // indirect diff --git a/go.sum b/go.sum index d15d5cf2a8f..785b0f8c8a4 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,6 @@ github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895 h1:NsReiLpErI github.com/ProtonMail/go-crypto v0.0.0-20220824120805-4b6e5c587895/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/ReneKroon/ttlcache/v2 v2.11.0 h1:OvlcYFYi941SBN3v9dsDcC2N8vRxyHcCmJb3Vl4QMoM= -github.com/ReneKroon/ttlcache/v2 v2.11.0/go.mod h1:mBxvsNY+BT8qLLd6CuAJubbKo6r0jh3nb5et22bbfGY= github.com/RoaringBitmap/roaring v0.9.4 h1:ckvZSX5gwCRaJYBNe7syNawCU5oruY9gQmjXlp4riwo= github.com/RoaringBitmap/roaring v0.9.4/go.mod h1:icnadbWcNyfEHlYdr+tDlOTih1Bf/h+rzPpv4sbomAA= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -299,8 +297,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220929083235-bb0b1a236d6c h1:b+YTmOGlf43mnF8MzO0fsy8/Ho8JLu44Iq5Y0fKLJMM= github.com/cs3org/go-cs3apis v0.0.0-20220929083235-bb0b1a236d6c/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.10.1-0.20221004122722-dd0e54110612 h1:pN7I+w2guRqhuIeSsn4XJyCWAEs4FhbpyaTrh1JLhX4= -github.com/cs3org/reva/v2 v2.10.1-0.20221004122722-dd0e54110612/go.mod h1:JSbp7jQLPLgX09UAdFtW9pH61fr2tPVtA+b8TuOB24Y= +github.com/cs3org/reva/v2 v2.10.1-0.20221006094710-138513fc9c32 h1:yCvQaGBgNCeQS2ZMN+e+cNoTZweQwnhsYHOMUT1ylAY= +github.com/cs3org/reva/v2 v2.10.1-0.20221006094710-138513fc9c32/go.mod h1:lFNeXqfaceGlthOo7bNuVCXfBCjO6oMfX5olglnLAIQ= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/services/search/pkg/service/grpc/v0/service.go b/services/search/pkg/service/grpc/v0/service.go index 3c840e11b32..7bc079fc0b7 100644 --- a/services/search/pkg/service/grpc/v0/service.go +++ b/services/search/pkg/service/grpc/v0/service.go @@ -6,12 +6,12 @@ import ( "fmt" "time" - "github.com/ReneKroon/ttlcache/v2" revactx "github.com/cs3org/reva/v2/pkg/ctx" "github.com/cs3org/reva/v2/pkg/errtypes" "github.com/cs3org/reva/v2/pkg/events/server" "github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool" "github.com/go-micro/plugins/v4/events/natsjs" + "github.com/jellydator/ttlcache/v2" "github.com/owncloud/ocis/v2/services/search/pkg/content" "github.com/owncloud/ocis/v2/services/search/pkg/engine" "github.com/owncloud/ocis/v2/services/search/pkg/search"