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] 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 000000000..e62720b4c --- /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 a6b815a1b..a68167e5a 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 {