Replace toml
configuration with CLI + env args
#650
Mirko-von-Leipzig
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally suggested in #647, paraphrasing motivation here.
toml
files are nice for low-change, manual configuration as it gets out of the way for conventional use. It is however poorly suited for scripting and devops workflows:init
step, and an extra file to manage.grep/sed
isn't good enough as you need a section parser (e.g. there are multipleendpoint = xxx
lines under different sections.I propose shifting to a fully CLI/clap based approach. We could combine this with
toml
files by havingcli
args take precedence but in my experience this becomes a pain to maintain. The "optimal" naming scheme is also often different between the two so things drift.There are situations where having file based configuration is great. One example is updating configs across multiple instances to identical settings - ideally you just copy the file around. Or users that don't want to specify a long list of non-default cli args (though the latter could be done via alias). For this usage I propose environment args.
clap
supports these out of the box, and does the correct thing. File configuration then becomes a.env
file.An additional bonus is that many deployment tools support env var based flows, e.g. systemd service files let you specify env variables, or even
.env
files. Similarly in docker.This is a rather large breaking change; so I'd like to get consensus on this before proceeding.
Beta Was this translation helpful? Give feedback.
All reactions