Skip to content

Commit

Permalink
Merge pull request #3802 from wkloucek/fix-storage-users-config
Browse files Browse the repository at this point in the history
Bugfix: Fix multiple configuration environment variables for the storage-users extension
  • Loading branch information
wkloucek authored May 16, 2022
2 parents 6a7fc50 + 713bdfc commit 61b9b6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions changelog/unreleased/fix-storage-users-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Bugfix: Fix multiple storage-users env variables

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
8 changes: 4 additions & 4 deletions extensions/storage-users/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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"`
Expand All @@ -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"`
Expand Down

0 comments on commit 61b9b6c

Please sign in to comment.