harababurel / harababurel/gcsf

Docker and encrypted file/filename with eCryptfs error

Open
#38 2 comments 0 reactions 1 assignee Claimed by @harababurel View on GitHub
Dominant language
Rust
Stars
2.4k
Forks
98
PR merge metrics
No merged PRs in 30d

Description

First, thank you very much for this awesome project. I don't know if it's a Docker mounting error or a gcsf error with encrypted filenames. Don't blame me for doing crazy stuff here :D

I use a Docker container with gcsf installed and mount a host directory into the container. Then I mount the google drive folder via gcsf like described in the docs. I can create successfully an encrypted folder (e.g. `ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGy83GFz4yGEAiKGAxkyBL4k--`) and it is synced to Google Drive.

But I can't create an encrypted file (e.g. `ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--`). If I use `touch test.txt` I get the error `touch: cannot touch 'test.txt': Function not implemented`. `vim` can't also create/write the file. Any idea if it is gcsf related or not? Maybe someone can test it without Docker?

I can't see any special in the gcsf logs:

```
DEBUG gcsf::gcsf::filesystem > Could not perform sync: Not enough time has passed since last sync. Will do nothing.
DEBUG fuse::request > RELEASEDIR(1002) ino 0x0000000000000008, fh 0, flags 0x18800, release flags 0x0, lock owner 0
DEBUG fuse::request > LOOKUP(1003) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--"
DEBUG fuse::request > MKNOD(1004) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--", mode 0o100644, rdev 0
DEBUG fuse::request > LOOKUP(1005) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--"
DEBUG fuse::request > LOOKUP(1006) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--"
DEBUG fuse::request > MKNOD(1007) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--", mode 0o100644, rdev 0
DEBUG fuse::request > LOOKUP(1008) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGFZOUXF5.ijMuVpWlW9cgCE--"
DEBUG fuse::request > LOOKUP(1009) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGeE4I73bXfaSp04mOrrYE2U--"
DEBUG fuse::request > LOOKUP(1010) parent 0x0000000000000008, name "ECRYPTFS_FNEK_ENCRYPTED.FWajKz29vL--AkZjsw01mylGaO1nGCzLS3XGeE4I73bXfaSp04mOrrYE2U--"
```
## Docker
The Dockerfile looks like:

```
FROM base/archlinux

RUN pacman -Sy --noconfirm pkg-config rust gcc fuse2 \
&& mkdir -p /opt \
&& cargo -v install --root /opt gcsf \
&& echo "user_allow_other" >> /etc/fuse.conf \
&& pacman -Rs --noconfirm rust gcc \
&& pacman -Scc --noconfirm
ENTRYPOINT ["/opt/bin/gcsf"]
```

The special Docker mount options is `--mount=type=bind,source="$HOME/data/googledrive",target="$HOME/data/googledrive",bind-propagation=shared --device=/dev/fuse`. The `bind-propagation=shared` option must be used, otherwise I don't see the mounted files from fuse inside the Docker container on my host system.

## Resources
- [Arch Linux eCryptfs](https://wiki.archlinux.org/index.php/ECryptfs#Manual_setup)
- [Docker bind](https://docs.docker.com/storage/bind-mounts/#configure-bind-propagation)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.