On Sat, 14 Apr 2018 at 16:04:58, Lukas Fleischer wrote: > On Thu, 12 Apr 2018 at 19:44:15, Eli Schwartz wrote: > > This change allows aurweb configuration to be done via either: > > - copying config.proto to config and modifying values > > - creating a new config only containing modified values, next to a > > config.proto containing unmodified values > > > > The motivation for this change is to enable ansible configuration by > > storing only changed values, and deferring to config.proto otherwise. > > > > If a config.proto file does not exist next to /etc/aurweb/config or > > $AUR_CONFIG, it is ignored and *all* values are expected to live in the > > modified config file. > > > > Signed-off-by: Eli Schwartz <[email protected]> > > --- > > aurweb/config.py | 4 ++++ > > web/lib/confparser.inc.php | 8 +++++++- > > 2 files changed, 11 insertions(+), 1 deletion(-) > > [...] > > Thanks, I like the idea. However, I think it would be better to make > both the path to the defaults file and the path to the configuration > file itself configurable (i.e. add a new environment variable > AUR_CONFIG_DEFAULTS). By default, /etc/aurweb/config.defaults and > /etc/aurweb/config could be used.
Maybe even better: make AUR_CONFIG default to /etc/aurweb/config and AUR_CONFIG_DEFAULTS default to the value of AUR_CONFIG with an additional ".defaults" suffix. Then, if no environment variables are set, aurweb would look for default values in /etc/aurweb/config.defaults and for additional configuration in /etc/aurweb/config. If only AUR_CONFIG is set (say, to /some/path), aurweb looks for default values under /some/path.defaults and for additional configuration under /some/path. And if you really want to store the defaults somewhere else, you can set AUR_CONFIG_DEFAULTS. Best regards, Lukas Fleischer
