Mount your Seafile libraries, but containerized.
This docker image mounts a Seafile user's library using the seadrive client, which streams a filesystem instead of syncing.
Using Seadrive containerized has several advantages (probably – in my case, it was just an infrastructural requirement).
Image supports x86_64 and arm64 because that's what Seadrive is available for. Albeit, the arm64 Debian repository for Seadrive didn't receive the latest patches, but still works.
Your host system needs to have Fuse installed and the container needs to be
run with --privileged
.
- Configure using environment variables.
- Give extended privileges (Engine, Compose)
- Bind mount
/seafile
with typebind
and bind-propagationrshared
. - Image is just called
seafile-mount
docker run --privileged \
--env-file ./.env \
--mount type=bind,source=/home/yuri/seafile-mount,target=/seafile,bind-propagation=rshared \
-it seafile-mount
version: "3"
services:
seadrive:
container_name: seadrive
image: yuribecker/seafile-mount:latest
environment:
- SEAFILE_MOUNT_SERVER=https://seadrive.example.org
- SEAFILE_MOUNT_USERNAME=username@example.org
- SEAFILE_MOUNT_TOKEN=TOKEN
privileged: true
volumes:
- type: bind
bind:
propagation: rshared
source: /home/yuri/seafile-mount
target: /seafile
Name | Description | Default |
---|---|---|
SEAFILE_MOUNT_SERVER | URL of your server (including https://) | required |
SEAFILE_MOUNT_USERNAME | Username (email) of the user | required |
SEAFILE_MOUNT_TOKEN | Token for the user, see Acquiring a Token | required |
SEAFILE_MOUNT_IS_PRO | Is server Professional Edition? (true /false ) |
false |
SEAFILE_MOUNT_CLIENT_NAME | Name for how this client should show up in Seafile's admin panel | Seafile Docker Mount |
SEAFILE_MOUNT_CACHE_SIZE_LIMIT | Size limit for the cache | 10GB |
SEAFILE_MOUNT_CLEAN_CACHE_INTERVAL | Interval for cache cleaning in minutes | 10 |
SEAFILE_MOUNT_FUSE_OPTS | FUSE mount options | allow_root,auto_unmount |
SEAFILE_MOUNT_ALLOW_OTHER | Shortcut for SEAFILE_MOUNT_FUSE_OPTS=allow_other,auto_unmount (set to yes ) |
optional |
See
the official documentation
for more info about these options.
"Info" in this case means there isn't much info in the official documentation anyway.
As shown in the official documentation, request a token from your Seafile instance's API.
curl --url https://YOUR_SEAFILE_INSTANCE/api2/auth-token/ \
--header 'content-type: application/x-www-form-urlencoded' \
--data-urlencode "username=EMAIL" \
--data-urlencode "password=PASSWORD"
Note that it doesn't work with a Token extracted from a browser session.