Access borg repositories in read only mode #388
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
What I'm trying to do and why
Use borgmatic extract/list commands in a secured environement where borg repository are in read-only mode.
Borg add the option --bypass-lock to be compliant with read-only repository.
Other notes / implementation ideas
Environment
borgmatic version: [version here]
1.5.12
borgmatic installation method:
Docker
Borg version: [version here]
1.1.15
Python version: [version here]
Use
python3 --versionoperating system and version:
Alpine
I apologize for the super lengthy delay in this getting any attention. A
borgmatic list --bypass-lockflag seems like a good idea to me. But do you think it would be needed if there was a "read only" borgmatic configuration option as you suggest? That way borgmatic would be responsible for issuing--bypass-lockas needed. Or perhaps borgmatic could support both in order to handle one-off lock bypassing and global read-only use cases.Looks like
--bypass-lockis gone in Borg 2.I would like to work on this issue.How should I proceed with this and what remains to be implemented??
I've removed the "good first issue" label, but you're still welcome to work on this. I removed it because with
--bypass-lockgone in Borg 2, the implementation here is no longer quite as straightforward IMO. Here's how I would state the high-level requirement: Some users want to use borgmatic with a read-only Borg repository, e.g. a repo burned to a physical disc or on read-only network storage. With Borg 1, one way to support that need would be with an option that causes--bypass-lockto get passed to relevant Borg subcommands. For instance, I could envision adding an optionalread_onlyoption to each repository withinrepositories:. That way, you could indicate whether a repo is read-only with that option, and if set, borgmatic would take care of passing--bypass-lockfor any actions where Borg would put a lock in place.There is the question what to do about Borg 2 though. It might be worth a little experimenting to see how a read-only Borg 2 repository works with borgmatic today—and whether borgmatic needs to make any changes to support such a scenario. It's possible that the feature described above could be documented as Borg 1 only.
An alternate approach would be not to add
--bypass-lockfunctionality directly, especially since its going away eventually. Instead, this ticket could be closed and #427 could be implemented instead to allow users to self-service extra flags.Thanks for taking time to write such a detailed explanation @witten !! But since this is no longer a beginner friendly good-first issue,I am not confident enough to take this issue right now as I have yet to get started on my gsoc proposal and time is ticking by. I will visit this issue again in some time and try to solve this. Thanks