-
-
Notifications
You must be signed in to change notification settings - Fork 764
borg2: fix rclone repo URLs borg displays #8446
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
Comments
There are multiple issues here:
|
I see these ways to clean this up:
|
@ncw ^^ |
Related: #8372 (URLs with relative paths) |
% borg repo-info Location: rclone://None/./pcloud:justtesting ...
…up#8446 % borg repo-info Location: rclone:///./pcloud:justtesting
So algorithm to get the rclone remote from borg URL would be
So remove the There are other forms of rclone remote that could be in use, probably That starts to make things a bit untidy though
I think my preference would be not to munge the rclone remote as this could confuse users when they are using the rclone docs - they would have to translate to borg style. So I think this is probably a more natural syntax (and is what restic uses)
You'd prefix with
Does it need to be valid URL syntax? |
@ncw Thanks for the feedback. OK, looks like we need to specialcase rclone "URLs" in borg and borgstore at some places so we can use |
Location.canonical_path: some fixes, see #8446
Standardizing on URL format would be nice for consistency in the borg interface. I don't think it'd be too difficult for users to read a |
@AfroThundr3007730 yeah, that was my initial idea also, but if something doesn't fit too well in that scheme://server/path pattern, it gets rather ugly (and might be not a valid URL then anyway). That's already a problem for our sftp and ssh URLs that need the concept of a relative path (which URLs do not have in their full form). And it's even more a problem for more complex stuff as rclone does it (see the rclone docs about how such a remote spec can be built). |
Oh I use rclone to sync all my repos to Wasabi. I'm thinking we can make the conversion work where the remote would occupy the authority portion of the URL.
Reversing that into a rclone remote just means dropping the scheme and replacing the first slash with a colon. I think this would work even with a more complex remote specification like The authority section of the URL, normally in the form While it may not strictly follow the URL syntax, rclone encodes the authority information elsewhere in the config (or environment) anyway, leaving us with just the remote name, which frees us to reuse the authority section to hold it. Borg doesn't have to worry about things like a port number in this case, or anything else with colons in the authority section, so no ambiguity would arise here. We could even simplify the conversion to just prepending the scheme and leaving the remote specification unmodified:
In these latter cases, particularly for S3-like remotes, the bucket looks like it's part of the authority section, but we could do away with interpreting it like a normal URL anyway. The Though I prefer the first method, I can see how it'd be more complex to implement properly. |
@AfroThundr3007730 what i mean is that: https://rclone.org/docs/#syntax-of-remote-paths There can be quite complex things like:
So guess it would be way easier to just prefix that with |
I see that the connection strings syntax gets quite complex. The prefix solution makes more sense now. |
As found by @bjo81:
Similar:
borg 2.0.0b11
The text was updated successfully, but these errors were encountered: