sebadob / rauthy

OpenID Connect Single Sign-On Identity & Access Management
https://sebadob.github.io/rauthy/
Apache License 2.0
297 stars 15 forks source link

Configuration via environment variables #518

Closed ellieschieder closed 1 month ago

ellieschieder commented 1 month ago

Is it currently possible to configure rauthy completely or partial via environment variables (e.g. docker compose)?

If not, what / where would changes need to be made?

sebadob commented 1 month ago

Yes, absolutely.

This is the reason why the config variables have such long names sometimes, because they are not organized in a toml file. You can choose whatever you like more, either env vars or provide a config file.

If you provide both, the config file will be parsed first and the env vars will have the higher priority.

ellieschieder commented 1 month ago

Awesome! Do I need to prefix the env variables?

sebadob commented 1 month ago

No, just use the exact same names.

The way Rauthy does it is it's parsing the optionally given config file as raw env variables. This is why they must not contain whitespace around = for instance, but in the end makes the configuration a lot more flexible. For instance, for testing some stuff, I can just edit env vars on the fly which is much fast in docker or kubernetes than modifying a ConfigMap.