Skip to content

yuri-becker/seafile-mount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPL 3 License Docker GitHub


seafile-mount

Mount your Seafile libraries, but containerized.

About

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.

Drawbacks

Your host system needs to have Fuse installed and the container needs to be run with --privileged.

Running it

Example

Command line

docker run --privileged \
--env-file ./.env \
--mount type=bind,source=/home/yuri/seafile-mount,target=/seafile,bind-propagation=rshared \
-it seafile-mount

docker-compose.yml

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

Environment Variables

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.

Acquiring a Token

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.