rustic
rustic copied to clipboard
[Feature Request] Environment variable specify config/profile directory
I believe the ability to set a dynamic path to search for config files would be a welcome addition. This would be through environment variables pointing to a directory.
This is already supported on resticprofile, through the XDG_CONFIG_HOME and XDG_CONFIG_DIRS environment variables, and I believe similar behaviour would suffice.
The docs mention the -P tag for specifying the profile name, which, when set to a full directory path, does follow, but I strongly prefer environment variables over arguments in this case.
My specific situation is as follows:
On a Windows 11 machine, with rustic installed through Scoop.
Although many of rustic's commands are supported by resticprofile, the progress bar is not supported - and thus I have a usecase for using rustic profiles directly.
However, I am not able to have a unified configuration file or password location for both tools, due to the fact that rustic searches for configuration files in C:\Users\[user]\AppData\Roaming\rustic\config\rustic.toml, C:\ProgramData\rustic\config\rustic.toml, .\rustic.toml.
The above locations are searched in despite the fact that my rustic is installed through scoop, in C:\Users\[user]\scoop\shims\, and the specific programdata and appdata config folders pointed to are not present on my machine.
My current workaround is to create the C:\Users\[user]\AppData\Roaming\rustic\config folder, and place my configuration there. As mentioned in #1410, this is not normal on Windows, as appdata and programdata aren't normally used to store any files or configurations handmade by the user, especially so for programs which aren't installed to the programfiles directories.
It would also be helpful if this behaviour could be added to the config docs on github or in the documentation.
Similar issues include: #859 #1410