Support user directory expansion everywhere #422
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#422
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Apart from
source_directories
, none of the configuration options seem to support tilde (~
). That is such paths are passed through as is toborg
or otherwise acted upon byborgmatic
without applyingos.path.expanduser
. Would be nice to have this feature applied to paths coming from configuration file in general. Perhaps normalizing (sanitizing) paths is also a good idea.This seems reasonable to me, but I'm curious: Are there specific options where you'd like to see expansion applied? Candidates I'm seeing:
patterns_from
excludes_from
borgmatic_source_directory
temporary_directory
borg_*_directory
repositories
andcheck_repositories
: Already expands~
implicitly for remote repositories due to SSH being used. I suppose it'd be handy to expand for local repository paths too?ssl_*
paths.Ones I'd probably omit:
patterns
: Would require annoying parsing, as it's not just plain paths.encryption_passcommand
: May require parsing so as not to expand command arguments, too.hooks
: Same reason.Let me know your thoughts. Thanks!
Though, that's exactly the use case I'm interested in: I have a setup with one special user doing backups, maintaining all data necessary for borg in its home directory and I store passwords there as well. The entire home is stored on an encrypted ZFS, which gets mounted manually, so it's somewhat safe. Therefore, my passcommand looks like the following right now:
While it would be a little easier to have the following instead:
Slightly less typing and things are better prepared against additional backup users or a renamed user or a relocated home directory or alike.
cat
is even used in the official borg-docs, so supporting~
for its arguments makes sense to me.Thanks, that example is helpful. It sounds like it's actually the command arguments that you want expanded! So the way I could see this working is to split the value of
encryption_passcommand
(and other options that are passed to Borg via environment variables), expand each individual command/argument in case there are tildes, and then join them back together. I think that would achieve what you're looking for.