Skip to content

Commit

Permalink
Adding an option for remote webdav backend mount path (#211)
Browse files Browse the repository at this point in the history
* Adding an option for remote webdav backend mount path

* Linting

---------

Co-authored-by: gonimoro <>
  • Loading branch information
gonimoro authored Sep 20, 2024
1 parent 3473906 commit 0f42313
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions webdav-rclone-sidecar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Using environment:
* WEBDAV\_PWD: WebDAV password
* WEBDAV\_TOKEN: WebDAV OIDC token
* WEBDAV\_VENDOR: WebDAV vendor (default: *other*)
* REMOTE\_PATH: remote mount path on webdav backend (default: */*)
* MOUNT\_OPTS: space separated additional arguments for *rclone mount* command
* MOUNT\_PATH: mount path (default: */mnt*)
* MOUNT\_WAIT: wait time for mountpoint in /proc/mounts (default: *20*)
Expand Down
4 changes: 3 additions & 1 deletion webdav-rclone-sidecar/mount.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Needs to be run as root!

MOUNT_OPTS=${MOUNT_OPTS:-}
# backend remote path mount
REMOTE_PATH=${REMOTE_PATH:-/}
# where to mount
MOUNT_PATH=${MOUNT_PATH:-/mnt/}
MOUNT_WAIT=${MOUNT_WAIT:-20}
Expand Down Expand Up @@ -50,4 +52,4 @@ rclone config create --non-interactive webdav-fs webdav "${args[@]}" "$@"
# vfs-cache-mode: random access and cache
IFS=" " read -r -a mount_opts <<<"$MOUNT_OPTS"
mount_opts+=("--vfs-cache-mode=$VFS_CACHE_MODE")
rclone mount webdav-fs:/ "$MOUNT_PATH" --allow-non-empty --allow-other --uid="$JOVYAN_UID" --gid="$JOVYAN_GRP" "${mount_opts[@]}"
rclone mount webdav-fs:"$REMOTE_PATH" "$MOUNT_PATH" --allow-non-empty --allow-other --uid="$JOVYAN_UID" --gid="$JOVYAN_GRP" "${mount_opts[@]}"

0 comments on commit 0f42313

Please sign in to comment.