scripts: FileBrowser volumes controller-managed, remove drive auto-discovery
- docker-setup.sh install_filebrowser(): removed /mnt/* auto-discovery; FileBrowser now installed with no drive volumes. Initial config.yaml written with /srv fallback. Controller's SyncFileBrowserMounts() takes over on first startup and manages volumes/config going forward. - Added ./config.yaml bind mount to initial docker-compose.yml so FileBrowser starts correctly before controller syncs. - Fixed ((step_num++)) → step_num=$(( step_num + 1 )) to prevent set -euo pipefail trap when var starts at 0 (same class of bug as the found_mounts fix in the previous commit). - scripts/README.md: step 7 updated to reflect controller-managed volumes. - CHANGELOG.md: added entry for all scripts changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -69,7 +69,7 @@ The script runs these steps in order:
|
||||
| 4b | `install_cloudflare_tunnel()` | Deploy Cloudflare Tunnel (optional, only if tunnel token provided in wizard). |
|
||||
| 5 | `generate_self_signed_cert()` | Generate self-signed CA + wildcard cert (optional, if `--self-signed-cert` flag set). |
|
||||
| 6 | `run_config_wizard()` | Interactive wizard or Hub download. Generates `controller.yaml` with customer settings. |
|
||||
| 7 | `install_filebrowser()` | Deploy FileBrowser Quantum with auto-discovered drive mounts (optional). |
|
||||
| 7 | `install_filebrowser()` | Deploy FileBrowser Quantum with no drive volumes (optional). Drive volumes are managed by the controller via `SyncFileBrowserMounts()` after storage is registered. |
|
||||
| 8 | `install_controller()` | Deploy felhom-controller (privileged container with system access). |
|
||||
| 9 | `install_tools_and_configure()` | Install ctop, lazydocker, Docker shell aliases. |
|
||||
|
||||
|
||||
+52
-33
@@ -1268,43 +1268,18 @@ install_filebrowser() {
|
||||
|
||||
# Calculate step number dynamically
|
||||
local step_num=5
|
||||
[[ "$SELF_SIGNED_CERT" == true ]] && ((step_num++))
|
||||
[[ -n "${CF_TUNNEL_TOKEN:-}" ]] && ((step_num++))
|
||||
[[ "$SELF_SIGNED_CERT" == true ]] && step_num=$(( step_num + 1 ))
|
||||
[[ -n "${CF_TUNNEL_TOKEN:-}" ]] && step_num=$(( step_num + 1 ))
|
||||
log_step "${step_num}/$(get_total_steps) - Installing FileBrowser Quantum..."
|
||||
|
||||
# Discover drive mounts for FileBrowser volumes
|
||||
local volume_lines=""
|
||||
local mount_comment=""
|
||||
local found_mounts=0
|
||||
|
||||
# Scan /mnt/ for existing mount points (e.g., /mnt/hdd_1, /mnt/sys_drive)
|
||||
if [[ -d /mnt ]]; then
|
||||
for mp in /mnt/*/; do
|
||||
[[ ! -d "$mp" ]] && continue
|
||||
local name
|
||||
name=$(basename "$mp")
|
||||
# Skip hidden dirs and raw mount dirs
|
||||
[[ "$name" == .* ]] && continue
|
||||
[[ "$name" == .felhom-raw ]] && continue
|
||||
volume_lines+=" - \"${mp%/}:/srv/${name}\""$'\n'
|
||||
mount_comment+=" # ${mp%/} → /srv/${name}"$'\n'
|
||||
found_mounts=$(( found_mounts + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
# Note: system_data_path is now configured via the web setup wizard,
|
||||
# FileBrowser mounts will be synced by the controller after setup completes.
|
||||
|
||||
if [[ $found_mounts -eq 0 ]]; then
|
||||
log_warn "No mount points found in /mnt/ — FileBrowser will have no drive volumes."
|
||||
log_warn "Drives can be attached later via the controller dashboard."
|
||||
fi
|
||||
# Note: FileBrowser drive volumes are managed entirely by the controller.
|
||||
# SyncFileBrowserMounts() runs on controller startup and regenerates
|
||||
# docker-compose.yml + config.yaml whenever storage paths are added/removed.
|
||||
# docker-setup.sh writes an empty initial config; the controller takes over immediately.
|
||||
|
||||
if [[ "$DRY_RUN" == true ]]; then
|
||||
echo -e "${CYAN}[DRY-RUN]${NC} Would install FileBrowser Quantum at files.${BASE_DOMAIN}"
|
||||
if [[ $found_mounts -gt 0 ]]; then
|
||||
echo -e "${CYAN}[DRY-RUN]${NC} Would mount ${found_mounts} drive(s)"
|
||||
fi
|
||||
echo -e "${CYAN}[DRY-RUN]${NC} Drive volumes managed by controller (empty on initial install)"
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -1331,7 +1306,9 @@ services:
|
||||
- TZ=Europe/Budapest
|
||||
volumes:
|
||||
- filebrowser_data:/home/filebrowser/data
|
||||
${volume_lines} networks:
|
||||
- ./config.yaml:/home/filebrowser/config.yaml:ro
|
||||
# Storage volumes are auto-managed by felhom-controller (SyncFileBrowserMounts)
|
||||
networks:
|
||||
- traefik-public
|
||||
deploy:
|
||||
resources:
|
||||
@@ -1360,6 +1337,48 @@ networks:
|
||||
external: true
|
||||
EOF
|
||||
|
||||
# Create initial config.yaml (no storage sources — controller syncs on startup)
|
||||
cat > "${FILEBROWSER_DIR}/config.yaml" << 'CONFIGEOF'
|
||||
# FileBrowser Quantum — managed by felhom-controller
|
||||
# WARNING: This file is auto-generated. Manual edits will be overwritten.
|
||||
|
||||
server:
|
||||
port: 80
|
||||
baseURL: "/"
|
||||
database: "/home/filebrowser/data/database.db"
|
||||
logging:
|
||||
- levels: "info|warning|error"
|
||||
sources:
|
||||
- path: "/srv"
|
||||
userDefaults:
|
||||
stickySidebar: true
|
||||
darkMode: true
|
||||
viewMode: "normal"
|
||||
showHidden: false
|
||||
dateFormat: false
|
||||
gallerySize: 3
|
||||
themeColor: "var(--blue)"
|
||||
preview:
|
||||
disableHideSidebar: false
|
||||
highQuality: true
|
||||
image: true
|
||||
video: true
|
||||
motionVideoPreview: true
|
||||
office: true
|
||||
popup: true
|
||||
autoplayMedia: true
|
||||
folder: true
|
||||
permissions:
|
||||
api: false
|
||||
admin: false
|
||||
modify: false
|
||||
share: false
|
||||
realtime: false
|
||||
delete: false
|
||||
create: false
|
||||
download: true
|
||||
CONFIGEOF
|
||||
|
||||
# Create .felhom.yml metadata
|
||||
cat > "${FILEBROWSER_DIR}/.felhom.yml" << 'METAEOF'
|
||||
display_name: Filebrowser
|
||||
|
||||
Reference in New Issue
Block a user