rfjakob / gocryptfs

Encrypted overlay filesystem written in Go
https://nuetzlich.net/gocryptfs/
MIT License
3.4k stars 244 forks source link

Feature request: export files directly to disk (without FUSE mount) #817

Open resolritter opened 6 months ago

resolritter commented 6 months ago

Description

A new feature which allows users to export files from a gocryptfs volume directly to disk. The end goal is to make it possible to access the files without FUSE mounting the volume. The feature could work as follows:

gocryptfs -export /volume /destination

After running the command and inputting the password, /destination would contain a copy of all the files decrypted from /volume, i.e. an export of all the files within /volume. As a future improvement, the -exclude flag (from -reverse) could also be implemented to limit which paths get exported.

Why

It is useful for situations where FUSE mounting capabilities are not available, such as in non-rooted Android devices.

rfjakob commented 6 months ago

This can export single files: https://github.com/slackner/gocryptfs-inspect

resolritter commented 5 months ago

Hi @rfjakob, thank you for making me aware of that project. Still, while useful, exporting single files is not good enough for the use cases I had in mind.

On another note, prior to creating this thread I found some old comments at https://github.com/rfjakob/gocryptfs/issues/175#issuecomment-346932583 and https://github.com/rfjakob/gocryptfs/issues/175#issuecomment-346936254

You mean instead of

User request -> FUSE -> go-fuse -> gocryptfs -> ext4

you want

User request -> [some go code] -> gocryptfs -> ext4

?

Could work, actually. The package is not exported right now, but you can call into https://github.com/rfjakob/gocryptfs/blob/master/internal/fusefrontend/fs.go

I've made a note of these comments in case I try to implement this ticket in the future. If you have anything else to add, please do.