From d486ef295b62dcf55cc1874ec7d26cffffd8ad2c Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 16 May 2022 08:47:19 +0200 Subject: [PATCH 1/2] fix multiple env variables --- changelog/unreleased/fix-storage-users-config.md | 11 +++++++++++ extensions/storage-users/pkg/config/config.go | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/fix-storage-users-config.md diff --git a/changelog/unreleased/fix-storage-users-config.md b/changelog/unreleased/fix-storage-users-config.md new file mode 100644 index 00000000000..a258d874950 --- /dev/null +++ b/changelog/unreleased/fix-storage-users-config.md @@ -0,0 +1,11 @@ +Bugfix: Fix multiple configuration environment variables for the storage-users extension + +We've fixed multiple environment variable configuration options for the storage-users extension: + +* `STORAGE_USERS_GRPC_ADDR` was used to configure both the address of the http and grpc server. + This resulted in a failing startup of the storage-users extension if this config option is set, + because the service tries to double-bind the configured port (one time for each of the http and grpc server). You can now configure the grpc server's address with the environment variable `STORAGE_USERS_GRPC_ADDR` and the http server's address with the environment variable `STORAGE_USERS_HTTP_ADDR` +* `STORAGE_USERS_S3NG_USERS_PROVIDER_ENDPOINT` was used to configure the permissions service endpoint for the S3NG driver and was therefore renamed to `STORAGE_USERS_S3NG_PERMISSIONS_ENDPOINT` +* It's now possible to configure the permissions service endpoint for all storage drivers with the environment variable `STORAGE_USERS_PERMISSION_ENDPOINT`, which was previously only used by the S3NG driver. + +https://github.com/owncloud/ocis/pull/3802 diff --git a/extensions/storage-users/pkg/config/config.go b/extensions/storage-users/pkg/config/config.go index 0ecde7803bb..3ee48ecc278 100644 --- a/extensions/storage-users/pkg/config/config.go +++ b/extensions/storage-users/pkg/config/config.go @@ -66,9 +66,9 @@ type GRPCConfig struct { } type HTTPConfig struct { - Addr string `yaml:"addr" env:"STORAGE_USERS_GRPC_ADDR" desc:"The address of the grpc service."` + Addr string `yaml:"addr" env:"STORAGE_USERS_HTTP_ADDR" desc:"The address of the http service."` Namespace string `yaml:"-"` - Protocol string `yaml:"protocol" env:"STORAGE_USERS_GRPC_PROTOCOL" desc:"The transport protocol of the grpc service."` + Protocol string `yaml:"protocol" env:"STORAGE_USERS_HTTP_PROTOCOL" desc:"The transport protocol of the http service."` Prefix string } @@ -86,7 +86,7 @@ type OCISDriver struct { // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_OCIS_ROOT"` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_OCIS_USER_LAYOUT"` - PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_OCIS_PERMISSIONS_ENDPOINT"` + PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT,STORAGE_USERS_OCIS_PERMISSIONS_ENDPOINT"` // PersonalSpaceAliasTemplate contains the template used to construct // the personal space alias, eg: `"{{.SpaceType}}/{{.User.Username | lower}}"` PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template" env:"STORAGE_USERS_OCIS_PERSONAL_SPACE_ALIAS_TEMPLATE"` @@ -101,7 +101,7 @@ type S3NGDriver struct { // Root is the absolute path to the location of the data Root string `yaml:"root" env:"STORAGE_USERS_S3NG_ROOT"` UserLayout string `yaml:"user_layout" env:"STORAGE_USERS_S3NG_USER_LAYOUT"` - PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_S3NG_USERS_PROVIDER_ENDPOINT"` + PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_S3NG_PERMISSIONS_ENDPOINT"` Region string `yaml:"region" env:"STORAGE_USERS_S3NG_REGION"` AccessKey string `yaml:"access_key" env:"STORAGE_USERS_S3NG_ACCESS_KEY"` SecretKey string `yaml:"secret_key" env:"STORAGE_USERS_S3NG_SECRET_KEY"` From 713bdfccc5099dbd2cc1e5bcdeac7c489ac04125 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 16 May 2022 09:00:04 +0200 Subject: [PATCH 2/2] shorten changelog title --- changelog/unreleased/fix-storage-users-config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/fix-storage-users-config.md b/changelog/unreleased/fix-storage-users-config.md index a258d874950..3ebc92333ed 100644 --- a/changelog/unreleased/fix-storage-users-config.md +++ b/changelog/unreleased/fix-storage-users-config.md @@ -1,4 +1,4 @@ -Bugfix: Fix multiple configuration environment variables for the storage-users extension +Bugfix: Fix multiple storage-users env variables We've fixed multiple environment variable configuration options for the storage-users extension: