Allow configuration of any config value using environment variables #1829
dubo-dubon-duponey
started this conversation in
Ideas
Replies: 1 comment
-
In case people find this useful, here is a quick and dirty bash script implementation that will generate a shairport-sync config file from the environment.
Test: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using containers, mounting files is cumbersome and error prone.
Furthermore, it is often desirable to have parametric values for certain configuration options (eg: metadata pipename could be dependent on the value of some other environment variable (like
XDG_RUNTIME_DIR
)), which is not possible currently with the configuration file (unless I am mistaken?)A number of projects have adopted a way to allow overriding any configuration value using environment variables following a
PROJECT_KEY_..._SUBKEY=value
scheme.In the case of shairport-sync, for example:
SHAIRPORT_MQTT_ENABLED=whatever
would override the base value of:Implementing something like this has the following benefits:
Grafana is an example of a project doing this:
https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/
The Docker Registry is another IIRC.
What do you folks think?
Beta Was this translation helpful? Give feedback.
All reactions