Skip to content
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

Restore from Encryptic backup fail #90

Closed
dayfuaim opened this issue Apr 11, 2019 · 10 comments
Closed

Restore from Encryptic backup fail #90

dayfuaim opened this issue Apr 11, 2019 · 10 comments
Labels
bug Something isn't working critical extremely high priority

Comments

@dayfuaim
Copy link

dayfuaim commented Apr 11, 2019

I use https://unstable.encryptic.org in many browsers (Brave, Chrome, Vivaldi, Opera), so I have made Brave the main one and did "Backup everything".

Then I've created the same identity (d3) in Vivaldi (same name and key).
Then I tried to "Restore from backup" (Encryptic-backup-d3.zip).
Nothing happens in interface.
I got in console:
Снимок экрана 2019-04-11 в 14 12 29
(many lines of such)
I clicked "Close", but "All Notes" are empty. Even after refresh and closing the tab and enter the site again.
Application DBs (in my case that's lav-d3, lav-default and notes-db) are empty.

This has place also at https://app.encryptic.org and in standalone app.
I use Mac OSX 10.10.5, but I think that it's not about the OS.

@fbicknel
Copy link

fbicknel commented Apr 28, 2019

Same here chrome+Ubuntu -> chrome+Mac OSx

Encryptic v0.0.4

@daed
Copy link
Member

daed commented May 1, 2019

Can replicate. I'm looking at it.

@daed
Copy link
Member

daed commented May 1, 2019

The most immediate issue is that the wrong part of the path is being used as the key to determine which files are which. I've found and fixed that issue. However, any notes I import are blank.

I think there's something else going on with the import. I wrote a command line decryption script to test exported notes and they're looking fine, but if I import the exported notes and then export them a second time, they come back looking like:

{"title":"","content":"","tags":[]}

Which is definitely wrong, and definitely would explain what I'm seeing.

@daed daed added bug Something isn't working critical extremely high priority labels May 2, 2019
@johnblommers
Copy link

Perhaps somebody can write a clear HOWTO that goes step by step over how a user with a working encrypted Dropbox-synced Encryptic installation can back up necessary information, move it to another computer, and configure Encryptic there with the same identity, key and access to Dropbox. Essentially you now have two computers in sync with encrypted dropbox data shared.

I cannot figure out how to do it. Nothing works. I'm using Macintosh computers. And I suspect this issue might be closed in part with the requested HOWTO.

@daed daed mentioned this issue Jun 13, 2019
@daed
Copy link
Member

daed commented Jun 13, 2019

Okay, some significant progress. At modules/Module.js:305:

        await this.decryptModel(model);
        await this.saveModel({model, dontValidate: options.dontValidate});

We were decrypting the model and then not following that up with the decrypted model. After that I was able to see the imported backup mesages fine in the log. There's still something I'm missing here that is causing the model to not save properly, but at least it's progress. I hope to have more in a few days.

@johnblommers Once I get this sorted, I'll put together a HOWTO on the "correct" way to restore your backup. I think this will go a long way toward fixing the dropbox issues as well as they both use the saveModelObject() function.

@dayfuaim
Copy link
Author

dayfuaim commented Jun 14, 2019

@daed I looked yesterday into the components/ImportExport/Import.js and found out that following makes tags and notebooks (at least) import correctly (Import.js:480):

            if (path.length === 4) {

(all paths in archive start with 'Encryptic-backups/').

Also Import.js:493:

                const _opt = {zip, profileId, data, name: file.name}
                this.importNote(_opt);

makes note have title during import (I think because of model is immutable object).

Hope this will help.

UPDATE (I think it's very important):
Import.js:492:

            if (userDir === 'notes') {
                const _opt = {zip, profileId, data, name: file.name}
                this.importNote(_opt);
            }
            else if (userDir === 'files') {
                this.importFile({profileId, data});
            }

After these changes restore from Encryptic backup went well (as it should be). :)
Verified in Brave (Chromium-based) & Firefox.

@daed
Copy link
Member

daed commented Jun 26, 2019

I think that last bit was the one I was missing. It looks like it worked with my test backup.

@daed
Copy link
Member

daed commented Jun 26, 2019

@dayfuaim are the notes you import persisting after you close/reopen the browser window? Mine went empty. It's like it's rendering them, but they're not properly being saved.

@daed
Copy link
Member

daed commented Jun 26, 2019

I think I fixed that too. Should be in latest push (and also on unstable.encryptic.org). That was one of the major issues, so I'll put together a release soon.

I haven't tested if this fixes Dropbox yet. I'm expecting that to have a particular set of steps that have to be performed to work correctly. I'm going to test that and then put together a HOWTO.

@dayfuaim
Copy link
Author

dayfuaim commented Jun 26, 2019

@dayfuaim are the notes you import persisting after you close/reopen the browser window?

Yes.
I have verified it in several browsers (Brave, Firefox, Opera...).

The only thing is wrong (IMHO): after import I see notification "Import is successful... . Reloading the window." but no reloading happens.

The rest is very good. Dropbox, RemoteStorage, import – everything works (https://unstable.encryptic.org/ and locally built version). Thank you @daed 👍

I think I should close this now.

@dayfuaim dayfuaim closed this as completed Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical extremely high priority
Projects
None yet
Development

No branches or pull requests

4 participants