-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
crypt: support timestamped filenames from --b2-versions (attempt 2) #5205
Conversation
I'm not sure what that Race test failure is about, seems like a flaky test? It passed the first time around. |
Most prominent flaky tests: cmd/mount cmd/cmount TestMaxTransfer/Cautious |
@ncw can give good suggestions about adding integration tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding this rather difficult to review...
Can you swap the order of the commits please? So the first commit is b2: factor version handling into lib/version
and the second is crypt: support timestamped filenames from --b2-versions
Let me know if you need help with this. (I would git reset HEAD~2
then commit the b2 + lib/versions changes then the crypt changes in two separate commits).
Thanks
You're right, that makes much more sense. I was mostly concerned with preserving @wlritchi's commit, before I realized that there's a co-authoring feature. This should now be easier to review and still preserve authorship. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is looking very nice.
Thanks for swizzling the commits and well done for figuring out the co-author feature.
I put a very small number of comments inline for you to look at.
I don't think this feature can ever clash with standard name encryption (as - isn't valid base32) or no name encryption. However it could clash with obfuscation...
Not sure what to do about that. Nothing probably as I think it is very unlikely.
@@ -172,11 +172,6 @@ the file instead of hiding it. | |||
Old versions of files, where available, are visible using the | |||
`--b2-versions` flag. | |||
|
|||
**NB** Note that `--b2-versions` does not work with crypt at the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature should probably get a mention in the docs but not here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what you mean. Since this is merely a bugfix for B2 users, the removal of this notice seems appropriate? Where else might I change the docs?
Standardizes the filename version tagging so that it can be used by any backend.
With the file version format standardized in lib/version, `crypt` can now treat the version strings separately from the encrypted/decrypted file names. This allows --b2-versions to work with `crypt`. Fixes #1627 Co-authored-by: Luc Ritchie <luc.ritchie@gmail.com>
I've made the requested changes to the tests, and also added a few more test cases. Something I noticed is that the version adding is really awkward on obfuscated file names (e.g. |
Thank you - this looks great now, I will merge it in a moment.
Yes you are right - the namespace for obfuscated names and versions overlaps which is annoying but I don't think we can do anything sensible about it. Thank you for taking this up and finishing it. |
What is the purpose of this change?
Continues #4024.
Fixes #1627
I refactored the versioning code into its own package
lib/version
, including the filename versioning tests inbackend/b2
.While
rclone --b2-versions ls TestCryptB2:
would now correctly list all file versions in plaintext,rclone --b2-versions copy TestCryptB2:testfile-v(...).txt tmp/
wouldn't work. That turned out to be due toencryptFileName
not dealing with the versioned filenames, yetdecryptFileName
does, so I've also fixed that.I'd also like to add some integration tests to check the interaction between
crypt
andb2
- particularly for thecopy
issue I ran across - but I'm not sure how to go about it.Was the change discussed in an issue or in the forum before?
Yes, in the previous PR.
Checklist
crypt
andb2
with--b2-versions
is probably something we want.