Try multiple path to find Garage's configuration #360
Labels
No Label
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#360
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In an effort to make Garage more accessible, we could try to read multiple configuration path before giving up. Currently, we try only
/etc/garage.toml
.But we could also try:
/etc/garage/garage.toml
/etc/garage/config.toml
By using these parameters, I think we continue to follow the principle of least astonishment. I would even say that it would even help people, as I suspect that many people are not used to files directly stored at the
/etc
root.Is it common for server software to try multiple config file paths, or would we be breaking some kind of norm here?
As a counterpoint, here are some server software that store their config file directly in
/etc
:/etc/radvd.conf
)/etc/yggdrasil.conf
)/etc/dhcpcd.conf
)But most programs nowadays seem to follow the following pattern:
/etc/progname/progname.conf
.Sidenote: config files are usually called
.conf
independantly of their configuration language. It would make sense to call Garage's config filegarage.conf
instead ofgarage.toml
.I'm against the idea of supporting multiple config file locations, and ideally we'd move the config file's default location to
/etc/garage/garage.conf
. Now the question is how to do this without breaking things (or do we just make a big warning in the release notes?)systemd looks at least in 3 different folders for its configurations:
Of course, each of these folders have a different meaning (resp. conf provided by the distribution, local conf, and temporary conf, something like that).
Some daemons that can be run as a non privileged user also check the current user home directory, like mpd.
I was not able to find a daemon that check multiple configuration paths at runtime in a way similar to the one I described previously.
Personnaly, I would prefer that we avoid introducing breaking changes on this subject: if we judge that supporting multiple path is not a good idea as it is not standard, I think closing this issue and keeping the current behavior is the most desirable solution.
Also, as a sidenote, the file extension does not seem to be a problem for people, only the path, and only to one user that had many other problems. Keeping the
.toml
will allow text editor to provide a more meaningful syntax coloration and checking.Feel free to close the issue if you are ok to keep the current behavior and have nothing to add on the subject ;-)