decred / vspd

A Voting Service Provider (VSP) for the Decred network.
ISC License
19 stars 20 forks source link

config: Deprecate --configfile. #470

Closed jholdstock closed 4 months ago

jholdstock commented 4 months ago

This removes the --configfile option from vspd. It introduced quite a few weird edge cases (and a fair bit of code to deal with them) but afaik nobody actually used it. Note that the --homedir option stays, so it is still possible to run vspd with config in a non-default location if required.

jholdstock commented 4 months ago

This feature was incidentally inherited from dcrd a few years ago via copy & pasting config.go and it hasn't been used/tested/maintained since. I understand this feature could be more important in dcrd where specifying a different config file whilst reusing an existing datadir would be desirable, but vspd does not have the same restriction of a multi-gigabyte datadir.

I'd like to drop this behavior so that config creation/management can be more easily refactored into a new purpose built binary (#465). Preserving the behavior while nobody uses it creates extra work unnecessarily.

Every config value can still be overwritten via CLI, so testing with shell aliases is still feasible.

davecgh commented 4 months ago

Code looks fine, so I'll approve. I still disagree with the premise though. I know it's possible to use a shell alias to specify a bunch of command line options, but it is far more annoying than having separate config files that the aliases point to. You can modify the config file without having to mess with updating the shell aliases and restarting the shell or rehashing, etc. I also keep the config files in version control so it's easy to compare them and even go back to older versions of software where the options were different. Config files are generally just a better choice when it comes to managing config.