Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring storage registry with envvars #7554

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/storage-registry-envvar-config.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions services/gateway/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."`
Copy link
Contributor

@mmattel mmattel Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: how does the json get assigned to the variable? Imho a reference to a file would do this.
See: USERS_LDAP_CACERT where we have a default path/file if not otherwise defined: If not defined, the root directory derives from $OCIS_BASE_DATA_PATH:/idm. Just my 2c.

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."`
}

Expand Down