Try multiple path to find Garage's configuration #360

Closed
opened 2022-08-12 15:58:45 +00:00 by quentin · 2 comments
Owner

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.

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.
quentin added the
Newcomer
Low priority
Improvement
labels 2022-08-12 15:58:45 +00:00
Owner

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:

  • radvd (/etc/radvd.conf)
  • yggdrasil (/etc/yggdrasil.conf)
  • dhcpcd (/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 file garage.conf instead of garage.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?)

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`: - radvd (`/etc/radvd.conf`) - yggdrasil (`/etc/yggdrasil.conf`) - dhcpcd (`/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 file `garage.conf` instead of `garage.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?)
Author
Owner

systemd looks at least in 3 different folders for its configurations:

  • /usr/lib/systemd
  • /etc/systemd
  • /var/run/systemd

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 ;-)

systemd looks at least in 3 different folders for its configurations: - /usr/lib/systemd - /etc/systemd - /var/run/systemd 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 ;-)
lx closed this issue 2022-09-14 13:28:33 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#360
No description provided.