Skip to content

[Feat]: Substitute environment variables in config file #2521

Description

@AndersBennedsgaard

Is your feature request related to a problem? Please describe.

I am trying to set up authentication up with OIDC, which requires a client secret in plain text in the config. I would like a way for me to not have the client secret as plain text, and it seems to be pretty common practice to support environment variable substitution in config files.

Describe the solution you'd like

Substitute environment variables in configuration files

It does not seem to be possible with native Viper, but there are workarounds like spf13/viper#418 (comment)

Describe alternatives you've considered

Add a clientsecretEnv specifying which environment variable to pull the client secret from. I would personally be fine with this, but I would guess that there are other locations where substitution could be nice. It could for example simplify the code for authenticating to S3 storage, since the credentials file could be replaced with this.

Alternatively, I could run envsubst or similar on config files before starting Zot, in order to substitute them manually

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions