config.toml only searched in /etc/ #7

Closed
opened 2023-03-09 13:00:17 +01:00 by mo · 3 comments

config.toml is only ever searched in /etc/goca/. As per documentation this file should also be searched in $XDG_CONFIG_HOME/goca/config.toml or $HOME/.goca/config.toml.

  • XDG_CONFIG_HOME is ignored
  • ~/.goca/ is never searched
root@fw1:~ # strace -f goca show|& grep config.toml
[pid  5078] openat(AT_FDCWD, "/etc/goca/config.toml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  5078] write(2, "warning: config file: open /etc/"..., 76warning: config file: open /etc/goca/config.toml: no such file or directory

root@fw1:~ # export XDG_CONFIG_HOME=~/.config

root@fw1:~ # strace -f goca show|& grep config.toml
[pid  5094] openat(AT_FDCWD, "/etc/goca/config.toml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
[pid  5094] write(2, "warning: config file: open /etc/"..., 76warning: config file: open /etc/goca/config.toml: no such file or directory
config.toml is only ever searched in `/etc/goca/`. As per documentation this file should also be searched in `$XDG_CONFIG_HOME/goca/config.toml` or `$HOME/.goca/config.toml`. * XDG_CONFIG_HOME is ignored * `~/.goca/` is never searched ``` root@fw1:~ # strace -f goca show|& grep config.toml [pid 5078] openat(AT_FDCWD, "/etc/goca/config.toml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) [pid 5078] write(2, "warning: config file: open /etc/"..., 76warning: config file: open /etc/goca/config.toml: no such file or directory root@fw1:~ # export XDG_CONFIG_HOME=~/.config root@fw1:~ # strace -f goca show|& grep config.toml [pid 5094] openat(AT_FDCWD, "/etc/goca/config.toml", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) [pid 5094] write(2, "warning: config file: open /etc/"..., 76warning: config file: open /etc/goca/config.toml: no such file or directory ```
heiko self-assigned this 2023-03-09 14:06:37 +01:00
Owner

The XDG_CONFIG stuff ist valid for non-root users. If root uses the goca he/she acts as a global admin and therefore he doesn't have a private configuration.

I'll need to update the docs.

The XDG_CONFIG stuff ist valid for non-root users. If root uses the goca he/she acts as a global admin and therefore he doesn't have a _private_ configuration. I'll need to update the docs.
Owner

Oh, steht doch dort schon

Goca can use a configuration file. The default location is
$XDG_CONFIG_HOME/goca/config.toml or $HOME/.goca/config.toml when
running with an effective UID != 0, and it is /etc/goca/config.toml
when running with an effective UID == 0. The latter mode is not
recommended. An alternative location can be used by using -config
command line parameter (which must be the very first parameter).

Oh, steht doch dort schon Goca can use a configuration file. The default location is `$XDG_CONFIG_HOME/goca/config.toml` or `$HOME/.goca/config.toml` when running with an effective UID != 0, and it is `/etc/goca/config.toml` when running with an effective UID == 0. The latter mode is **not** recommended. An alternative location can be used by using `-config` command line parameter (which must be the very first parameter).
heiko closed this issue 2023-03-09 14:10:46 +01:00
Author

right, sorry.

right, sorry.
Sign in to join this conversation.
No milestone
No project
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
IUS/goca#7
No description provided.