Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support global configuration files in /etc/rustic/ #652

Closed
pheki opened this issue Jun 1, 2023 · 4 comments · Fixed by #672
Closed

Support global configuration files in /etc/rustic/ #652

pheki opened this issue Jun 1, 2023 · 4 comments · Fixed by #672
Labels
A-cli Area: `rustic` command line interface C-enhancement Category: New feature or request

Comments

@pheki
Copy link
Contributor

pheki commented Jun 1, 2023

I think it would be great to have global config files in /etc/rustic/ which could be used for backups by "system" users (which don't have a home directory) or configurations shared between users, so for example one user could create the backup and other users would still be able to access it.

The configuration files at ~/.config/ would have precedence over /etc/.

If you're interested, I'm willing to find some time and give this a try.

@aawsome
Copy link
Member

aawsome commented Jun 1, 2023

I also like the idea. Especially with the possibility to use other config file, see use-profile, there is a good use case to have global config options and maybe per-user config options referring to to the global ones.

Some notes:

@pheki
Copy link
Contributor Author

pheki commented Jun 3, 2023

We are currently about to refactor rustic

Oh, good to know! Waiting is good to me

  • Please have in mind that we should stay compatible with non-linux systems, i.e. MacOS and Windows.

Hmmm totally forgot about Windows... Here are some options I've gathered:

Windows:

  • %ProgramData%\rustic\config (resolves to C:\ProgramData\rustic\config)

MacOS:

  • /etc/rustic/
  • /usr/local/etc/rustic (for software installed using homebrew)
  • /Library/Application Support/com.rustic.rustic (I don't know the actual values you're using here but you get the point)
  • /Users/Shared/* (could use .config or Library/ApplicationSupport)

For MacOS I think /etc/ and /usr/local/etc are the best option (we could just check both directories).

Currently https://docs.rs/directories/latest/directories/struct.ProjectDirs.html is used. Maybe you can find a better crate which supports user/global config dirs.

Just opened a issue there: dirs-dev/directories-rs#82

@aawsome
Copy link
Member

aawsome commented Jun 3, 2023

Yes, would be great to have this implemented upstream. But I'm also fine with adding global config support to rustic until it's conveniently supported by a crate.

@aawsome aawsome added A-cli Area: `rustic` command line interface C-enhancement Category: New feature or request labels Jun 6, 2023
@aawsome
Copy link
Member

aawsome commented Jun 6, 2023

FYI, #617 has just been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: `rustic` command line interface C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants