-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: new backup transfer method #3489
Conversation
@@ -222,7 +222,7 @@ impl<'a> BlobObject<'a> { | |||
/// to be lowercase. | |||
pub fn suffix(&self) -> Option<&str> { | |||
let ext = self.name.rsplit('.').next(); | |||
if ext == Some(&self.name) { | |||
if ext == Some(self.name.as_str()) { |
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 had to make these changes because things would suddenly not compile anymore otherwise, not sure what happened there, seems like a compiler issue 🤷
In which direction does this go? only "scan to import" for now? |
bd5156e
to
73d10d4
Compare
cc4b9bd
to
33e9aeb
Compare
33e9aeb
to
634f4c2
Compare
8a66efb
to
a8c2a31
Compare
|
* The path must exist and being accessible at least until the other device has received all data. | ||
* The folder is not cleaned up by the backup send; | ||
* a temporary directory seems to be good place therefore. |
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 a UI developer, but this seems a bit awkward and something that the core could all handle internally?
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 don't have strong opinions in either direction @r10s what do you think?
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.
in general, it is nicer if the UI would not need to take care about such details.
but not sure how easy it really is for the core to really fulfill the requirements. so, as a pragmatic approach, i am also fine with leaving things up to the UIs for now, where we can more safely pass a directly that is really handled by the OS.
* The path must exist and being accessible at least until the other device has received all data. | ||
* The folder is not cleaned up by the backup send; | ||
* a temporary directory seems to be good place therefore. | ||
* @param passphrase Used to at-rest-encrypt the backuped database in `folder` before sending, |
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.
* @param passphrase Used to at-rest-encrypt the backuped database in `folder` before sending, | |
* @param passphrase Used to at-rest-encrypt the backup in `folder` before sending, |
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.
no this is correct, only the database is encrypted
* similar to dc_imex(). | ||
* The same passphrase must be given to dc_receive_backup() on the other device. | ||
* If NULL or empty string is given, the sent backup is not encrypted at rest. | ||
* The transport of the backup is always encrypted additionally. |
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.
If the transport is encrypted why is this passphrase still needed? Would be nice if this described what it is protecting against as well.
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 passphrase is there to encrypt the sql database. It is the same as the existing other backup methods. I personally would love to drop it, but didn't want to open that can of worms.
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.
cc @r10s
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.
yeah, i'd also better leave that can of worms closed, at least for now :)
|
||
|
||
/** | ||
* Waits for the sending to finish and frees the backup sender object. |
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.
Is thee a way to abort the sending?
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.
Or resume any time later (incl. never)?
* but on a device that has scanned the QR code generated by dc_backup_sender_qr(). | ||
* | ||
* While dc_receive_backup() returns immediately, the started job may take a while; | ||
* you can stop it using dc_stop_ongoing_process(). |
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.
An ongoing process is IIRC a global modal that can not be dismissed. I guess this is normally done from the "create account" screen or similar so that is what is desired?
@link2xt no it is not optional, those stores are just for experimentation. RocksDB is the only supported DB in iroh atm |
a8c2a31
to
edeb36d
Compare
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.
foo-shm
and foo-wal
are checked in accidentally i think.
CI isn't happy yet, but i think this is probably mostly fine
ups, fixed |
5da980e
to
9701078
Compare
83b2453
to
1fd4e8e
Compare
iroh requires rust |
closing, this is superseded by #4007 |
Idea: use p2p based transfer methods to move backups from one device to the other.
Implementation: Use iroh a new implementation of IPFS to build
iroh-share
, a simple protocol that moves data from device a to device b.Local Testing
Using the new commands
send-backup
andreceive-backup <Ticket>
you can test this on a local machine or between two machines running therepl
example.Current Restrictions
TODOs
Before Merging
iroh-share
Future
iroh-share
s hole punching so it does not need to be on the same network anymore