equalitie / ouisync-app

GNU General Public License v3.0
65 stars 7 forks source link

Feature request: Access/mount files without duplication #423

Open Juul opened 1 month ago

Juul commented 1 month ago

Currently my only option for accessing files on android seems to be by opening them directly from the ouisync app or selecting "Download". The download feature, while a nice option, will of course result in having two copies of the same data on the filesystem. There is also no "Download" feature for directories. Thus if I'm syncing a repo with many files that I intend to use on android, e.g. an audiobook with per-chapter files, then getting those files into the target directory for the audio book reader app to use is a very tedious process that results in storing everything twice.

In the linux cli the directories are auto-mounted. It would be very nice if the android app also auto-mounted all of the files in some default (but configurable) location. I'm not sure how difficult this is but it is one of two features that would really expand ouisync's use cases.

Have you considered adding a mode where ouisync stores the files as actual files and then keeps the metadata and indexes as separate files in e.g. a special .ouisync dir inside each repo? I know the "store everything as a big encrypted ouisync blob" mode would still be needed since you can't have peers that store the data without the encryption key otherwise and I realize that having two storage modes would be potentially problematic for a couple of reasons, one being simply feature creep and another being the difficulty of communicating to the user what the difference is between "encrypt repo locally" or "don't encrypt repo locally" and even worse you might want to have a flag for the repo creator that toggles between "allow unencrypted local storage by all peers" and "disallow unencrypted local storage by all peers" which is yet another complication to communicate to users.

It would be so cool though if I could use ouisync to back up my photos, contacts and Signal backup from my phone to a server and keep the storage automatically encrypted on the server, while also syncing locally to my laptop.

Maybe the solution is to implement the two storage modes, "store as encrypted blob" and "store as normal files" in the core ouisync codebase and then have two different Android apps, the normal ouisync and another "ouibackup" app that's specifically meant for keeping existing folders on a device synced. Same ouisync codebase but two different GUIs for different use-cases. The linux cli could of course be made capable of both modes of operation since you can expect a lot more from cli users.

Juul commented 1 month ago

Spent some more time thinking about this and chatting with jnny and changed this issue quite a bit since yesterday in case you already read it before my edits :)

Juul commented 1 month ago

I wonder if the repos could be "mounted" on Android by making them available through the Storage Access Framework. Maybe the CIFS (Samba) Document Provider which is open source and on android has code that could be borrowed? This could be used to create a storage area that shows up just like an SD card in Android file browsers

madadam commented 1 month ago

This should indeed be possible using the storage access framework and we've already talked about it in the team, just haven't put it into our roadmap. Personally I'd love to implement this as it's one of the few missing features preventing me from dogfooding Ouisync myself.