rclone-webui-react icon indicating copy to clipboard operation
rclone-webui-react copied to clipboard

persistant mountpoint

Open SJ50 opened this issue 3 years ago • 3 comments

I am trying webui in docker and created mount point and it got mounted successfully. I can access files from host as well. I like to know that how can I make mount point created via webui persistant so it can servive reboot.

SJ50 avatar May 21 '21 11:05 SJ50

You only need to put the rclone mount commando in the "command" section in docker-compose or docker run. In that line you can also boot the web-gui.

queltosh avatar Aug 20 '21 08:08 queltosh

I achieved this by overriding the docker entrypoint with a bash script (e.g. bootstrap.sh). The benefit is that I can mount multiple remotes and do cleanup when it's down. One issue is that such mounts are not shown in web gui.

#!/bin/sh

cleanup() {
  fusermount -uzq /data/onedrive
  fusermount -uzq /data/gdrive
  fusermount -uzq /data/adrive
}

trap 'true' SIGTERM

cleanup
rclone mount onedrive: /data/onedrive --vfs-cache-mode writes --daemon
rclone mount gdrive: /data/gdrive --vfs-cache-mode writes --daemon
rclone mount adrive: /data/adrive --vfs-cache-mode writes --daemon
rclone rcd --cache-dir /cache --rc-web-gui --rc-addr :5572 --rc-web-gui-no-open-browser --rc-web-gui-update &

wait $!

cleanup
version: '2'

services:
  rclone:
    image: rclone/rclone:latest
    container_name: rclone
    restart: unless-stopped
    environment:
      RCLONE_RC_USER: admin
      RCLONE_RC_PASS: admin
    volumes:
      - ./config:/config/rclone
      - ./cache:/cache
      - ./data:/data:shared
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
    network_mode: bridge
    ports:
      - 5572:5572
    user: 1000:1000
    cap_add:
      - SYS_ADMIN
    devices:
      - /dev/fuse:/dev/fuse
    security_opt:
      - apparmor:unconfined
    entrypoint: /config/rclone/bootstrap.sh

sjtuross avatar Feb 26 '22 07:02 sjtuross

type rclone rc

this will print out the manual to use rc.

from there you can figure out that you could mount drives like this after launching rcd first:

windows: rclone rc mount/mount fs=suchremote: mountPoint=X: vfsOpt="{"""CacheMode""":2}" mountOpt="{"""AllowOther""":true}" --user youruser --pass yourpassword

linux: rclone rc mount/mount fs=suchremote: mountPoint=/mnt/x vfsOpt='{"CacheMode":2}' mountOpt='{"AllowOther":true}' --user youruser --pass yourpassword

so in essence just chain these rc commands after launching rcd and you are good to go and all the mounts are running within the rcd process.

GottZ avatar Jan 17 '23 11:01 GottZ