From 026c35725642baa7939598c10e7161fb2c57bf15 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 20 Oct 2023 15:26:02 +0200 Subject: [PATCH] allow configuring storage registry by envvars Signed-off-by: jkoberg --- changelog/unreleased/storage-registry-envvar-config.md | 5 +++++ services/gateway/pkg/config/config.go | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/storage-registry-envvar-config.md diff --git a/changelog/unreleased/storage-registry-envvar-config.md b/changelog/unreleased/storage-registry-envvar-config.md new file mode 100644 index 000000000..d2e2a7d14 --- /dev/null +++ b/changelog/unreleased/storage-registry-envvar-config.md @@ -0,0 +1,5 @@ +Enhancement: Allow configuring storage registry with envvars + +Introduced new envvars to configure the storage registry in the gateway service + +https://github.com/owncloud/ocis/pull/7554 diff --git a/services/gateway/pkg/config/config.go b/services/gateway/pkg/config/config.go index c19f88785..0d4343be1 100644 --- a/services/gateway/pkg/config/config.go +++ b/services/gateway/pkg/config/config.go @@ -76,9 +76,9 @@ type GRPCConfig struct { } type StorageRegistry struct { - Driver string `yaml:"driver"` // TODO: configure via env? - Rules []string `yaml:"rules"` // TODO: configure via env? - JSON string `yaml:"json"` // TODO: configure via env? + Driver string `yaml:"driver" env:"GATEWAY_STORAGE_REGISTRY_DRIVER" desc:"The driver name of the storage registry to use"` + Rules []string `yaml:"rules" env:"GATEWAY_STORAGE_REGISTRY_RULES" desc:"The rules for the storage registry"` + JSON string `yaml:"json" env:"GATEWAY_STORAGE_REGISTRY_CONFIG_JSON" desc:"Additional configuration for the storage registry in json format"` StorageUsersMountID string `yaml:"storage_users_mount_id" env:"GATEWAY_STORAGE_USERS_MOUNT_ID" desc:"Mount ID of this storage. Admins can set the ID for the storage in this config option manually which is then used to reference the storage. Any reasonable long string is possible, preferably this would be an UUIDv4 format."` }