mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Send and receive backup over network using QR code
This adds functionality to send and receive a backup over the network using a QR code. The sender or provider prepares the backup, sets up a server that waits for clients. It provides a ticket in the form of a QR code which contains connection and authentication information. The receiver uses the QR code to connect to the provider and fetches backup, restoring it locally.
This commit is contained in:
@@ -160,9 +160,9 @@ impl<'a> BlobObject<'a> {
|
||||
pub fn from_path(context: &'a Context, path: &Path) -> Result<BlobObject<'a>> {
|
||||
let rel_path = path
|
||||
.strip_prefix(context.get_blobdir())
|
||||
.context("wrong blobdir")?;
|
||||
.with_context(|| format!("wrong blobdir: {}", path.display()))?;
|
||||
if !BlobObject::is_acceptible_blob_name(rel_path) {
|
||||
return Err(format_err!("wrong name"));
|
||||
return Err(format_err!("bad blob name: {}", rel_path.display()));
|
||||
}
|
||||
let name = rel_path.to_str().context("wrong name")?;
|
||||
BlobObject::from_name(context, name.to_string())
|
||||
|
||||
Reference in New Issue
Block a user