From 6d0d72bef5b4c09af0a51340a301280c64a9e173 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 8 Jun 2026 03:46:21 +0000 Subject: [PATCH] additional_directories.sh: create host mount-point dirs for nested mounts When a user's FileBrowser directory lives inside an existing bind-mount (e.g. /srv/data/users/alice), Docker needs an empty directory at the host-side equivalent path before it can overlay an inner bind-mount on top of the outer one. Without it the inner mount silently fails and the extra folder never appears. Now creates the mount-point directory on the host automatically before adding the compose entry, with a visible note so the user knows a dir was created. https://claude.ai/code/session_014CCYqVwW6d6f5dw1qRokYt --- tools/additional_directories.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/additional_directories.sh b/tools/additional_directories.sh index be5ae32..a6bd51d 100644 --- a/tools/additional_directories.sh +++ b/tools/additional_directories.sh @@ -255,6 +255,24 @@ do_add() { continue fi + # The container path may land inside an existing bind-mount (e.g. /srv/data/...). + # Docker needs an empty mount-point directory to already exist on the host at that + # location before it can overlay the inner mount on top of the outer one. + # Derive the host equivalent: strip /srv/data prefix → prepend FB_PATH. + local _mount_point_host="" + if [[ "$_container_path" == /srv/data/* ]]; then + _mount_point_host="$_fb_path/${_container_path#/srv/data/}" + elif [[ "$_container_path" == /srv/* ]]; then + # Legacy layout: /srv IS the bind mount + _mount_point_host="$_fb_path/${_container_path#/srv/}" + fi + + if [[ -n "$_mount_point_host" && ! -d "$_mount_point_host" ]]; then + mkdir -p "$_mount_point_host" \ + && echo " ${DIM}Created mount point: $_mount_point_host${R}" \ + || { errmsg "Could not create mount point '$_mount_point_host' — check permissions."; continue; } + fi + add_volume_entry "$_host_path" "$_container_path" && _changed=true || true done