[GH-ISSUE #897] Config file locations should follow service.rootpath set in a config #6311

Open
opened 2026-04-20 16:53:31 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @eirnym on GitHub (Jun 7, 2025).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/897

Description

Documentation states following:

In the service.rootpath location set in a config (remember you can set config arguments via environment variables)

I believe that app should follow documentation and read all config files recursively while updating in the opposite direction (e.g. First Read Last apply)

Vikunja Version

530fe4cef

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes

Screenshots

No response

Originally created by @eirnym on GitHub (Jun 7, 2025). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/897 ### Description Documentation states following: ``` In the service.rootpath location set in a config (remember you can set config arguments via environment variables) ``` I believe that app should follow documentation and read all config files recursively while updating in the opposite direction (e.g. First Read Last apply) ### Vikunja Version 530fe4cef ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Yes ### Screenshots _No response_
GiteaMirror added the area/config label 2026-04-20 16:53:31 -05:00
Author
Owner

@kolaente commented on GitHub (Jun 13, 2025):

Can you explain why you think that should be the case?

<!-- gh-comment-id:2969200798 --> @kolaente commented on GitHub (Jun 13, 2025): Can you explain why you think that should be the case?
Author
Owner

@eirnym commented on GitHub (Jun 20, 2025):

Currently, it's a very confusing option, which can be specified as a config entry.

Option A:

Documentation states that config file will be read from the from that location and configuration option itself can be defined in a various places. including config file.

So I propose to make this configuration option consistent.

E.g. read location from config file, then apply the configuration file in that location and so on, making a potential chain. If chain is cycled, exit with error. Otherwise, apply the configuration in one or other direction, but consistent.

For example:

Llet's say a server has a global configuration in /etc/vikunja/config.yaml, which point to a site-specific /etc/vikunja/local/, in which config.yaml provides additional tweaks including an exact location to data files

Option B

State, that config.yaml won't be read from service.rootpath and should be supplied by:

  • An environment variable other than service.rootpath
  • specific set of locations (already established, but service.rootpath should be excluded because of it's not so clear how to apply it)
  • A config variable other than service.rootpath
  • Clearly state if one config file points to another location how configuration will be read.
  • Follow the previous statement
<!-- gh-comment-id:2989455924 --> @eirnym commented on GitHub (Jun 20, 2025): Currently, it's a very confusing option, which can be specified as a config entry. **Option A:** Documentation states that config file will be read from the from that location and configuration option itself can be defined in a various places. including config file. So I propose to make this configuration option consistent. E.g. read location from config file, then apply the configuration file in that location and so on, making a potential chain. If chain is cycled, exit with error. Otherwise, apply the configuration in one or other direction, but consistent. For example: Llet's say a server has a global configuration in `/etc/vikunja/config.yaml`, which point to a site-specific `/etc/vikunja/local/`, in which `config.yaml` provides additional tweaks including an exact location to data files **Option B** State, that `config.yaml` won't be read from `service.rootpath` and should be supplied by: * An environment variable other than `service.rootpath` * specific set of locations (already established, but `service.rootpath` should be excluded because of it's not so clear how to apply it) * A config variable other than `service.rootpath` * Clearly state if one config file points to another location how configuration will be read. * Follow the previous statement
Author
Owner

@kolaente commented on GitHub (Jun 24, 2025):

Currently, the root path is used, but only before the config file is read. This allows setting an env variable with a root path and then reading a config file from there. Further config files from a potential location set in that config file are not read after that.

I would accept a PR adding the behaviour you outlined, but it's unlikely that I'll spend time implementing it myself.

<!-- gh-comment-id:2999138412 --> @kolaente commented on GitHub (Jun 24, 2025): Currently, the root path is used, but only before the config file is read. This allows setting an env variable with a root path and then reading a config file from there. Further config files from a potential location set in that config file are not read after that. I would accept a PR adding the behaviour you outlined, but it's unlikely that I'll spend time implementing it myself.
Author
Owner

@eirnym commented on GitHub (Jun 24, 2025):

I understand. Could you please note this in documentation?

What would variant you prefer the most to implement? I personally prefer the second, but you may have other opinion

<!-- gh-comment-id:3000008288 --> @eirnym commented on GitHub (Jun 24, 2025): I understand. Could you please note this in documentation? What would variant you prefer the most to implement? I personally prefer the second, but you may have other opinion
Author
Owner

@kolaente commented on GitHub (Jun 24, 2025):

Added a note in b43728dd4a, should show up on the website soon.

Option B sounds simpler to implement, +1 from me.

<!-- gh-comment-id:3000472056 --> @kolaente commented on GitHub (Jun 24, 2025): Added a note in https://github.com/go-vikunja/website/commit/b43728dd4ab42e9976f78074ed7579b341d4e261, should show up [on the website](https://vikunja.io/docs/config-options/#config-file-locations) soon. Option B sounds simpler to implement, +1 from me.
Author
Owner

@dpschen commented on GitHub (Jun 26, 2025):

Unsure if we do this but it would be cool if there is a log entry that reports, which log file is currently in use.

<!-- gh-comment-id:3007737902 --> @dpschen commented on GitHub (Jun 26, 2025): Unsure if we do this but it would be cool if there is a log entry that reports, which log file is currently in use.
Author
Owner

@kolaente commented on GitHub (Jun 26, 2025):

A log entry is already happening.

<!-- gh-comment-id:3007781160 --> @kolaente commented on GitHub (Jun 26, 2025): A log entry is already happening.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#6311