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

Sync conflits support for --reversewrite [PATCH] #665

Open
axet opened this issue Jul 9, 2023 · 1 comment
Open

Sync conflits support for --reversewrite [PATCH] #665

axet opened this issue Jul 9, 2023 · 1 comment

Comments

@axet
Copy link

axet commented Jul 9, 2023

Hello!

Using encfs with --reversewrite allows to two way sync files online. This mode also benefits from filesystems with compression support (since encrypted files can not be compressed due to entropy == 1) since files stays on drive not encrypted!

But here a two issues with --reversewrite and online syncing:

  1. files in cloud does not have ".encfs6.xml" config file. Adding it to the cloud, prevent it synching back with Input Output error since this file does not have a valid fileencrypted file name. Would be nice to have option allow overwriting ".encfs6.xml" using reverse encrypted folder in reversewrite mode.

  2. files changed on two machines can produce conflict files. Most syncing software rename those files with name template like this "original name (1)" or "original name (sync conflict 1.2.2022)". Basically adds a suffix to the name. Having option to allow such files created and automatically show those files under decrypted folder would make much easier to solving sync conflicts. Right now such files producing Input Output errors.

Thanks for amazing and inspiring project!

@axet
Copy link
Author

axet commented Jul 9, 2023

I prepared two patches.

  1. First patch showing '.encfs6.xml' in --reverse and --reversewrite modes which allows to sync this file back and forth from mounted folder (encrypted). Changing file in encrypted folder change it in local filesystem. It is working, but code can be more optimized:
  1. Second patch supports for handling sync conflicts. It doing that by adding "[encfs-corrupted]" to the file names.

Corruptions comes from incorrect file name during sync. For example when sync app create duplicate files in your encrypted (--reversewrite) or normal encfs mount directory with suffix to the file name. Corresponding file in the encfs mount (encrypted or decrypted depending or --reverse option) will add "[encfs-corrupted]" to the name. For example:

normal (forward) mode you have one file:

  • "R0RAqRPCUeoDefTmslDhg4,g"

encfs mounted directory showing it as:

  • "hello.txt"

sync created a second duplicate file with syncing issues (and original file):

  • "R0RAqRPCUeoDefTmslDhg4,g"
  • "R0RAqRPCUeoDefTmslDhg4,g (sync conflict 09-07-2023 axet-laptop)"

encfs mounted directory showing it as:

  • "hello.txt"
  • "hello.txt [encfs-corrupted] (sync conflict 09-07-2023 axet-laptop)"

And same goes for --reverse and --reversewrite options. Original directory showing:

  • "hello.txt"

Encfs encrypted folder:

  • "R0RAqRPCUeoDefTmslDhg4,g"

After sync issues, encrypted folder will be:

  • "R0RAqRPCUeoDefTmslDhg4,g"
  • "R0RAqRPCUeoDefTmslDhg4,g (sync conflict 09-07-2023 axet-laptop)"

And local filesystem folder will look like:

  • "hello.txt"
  • "hello.txt [encfs-corrupted] (sync conflict 09-07-2023 axet-laptop)"

Patch is here (code can be cleaned up):

@axet axet changed the title Sync conflits support for --reversewrite Sync conflits support for --reversewrite [PATCH] Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant