From 5e865278e9553019a7f178b17d9011b82cbd8915 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:29:31 +0200 Subject: [PATCH] addons: Filebrowser & Filebrowser-Quantum get warning if host install (#13639) * fix(filebrowser-quantum): warn when addon is run directly on Proxmox host Detect /etc/pve and show a clear warning with link to the recommended LXC installer. User must explicitly confirm to continue on the host, addressing the size calculation and indexing issues reported in gtsteffaniak/filebrowser#1893. Closes #13636 * fix(filebrowser): improve host warning text and add to filebrowser addon - Clarify that passthrough drives are not visible on the Proxmox host - Mention incorrect disk usage stats and incomplete file browsing - Add same warning to filebrowser (non-quantum) addon which also serves from / - Reduce verbosity, remove redundant phrasing * fix(filebrowser): fix misleading host warning wording Remove reference to a non-existent dedicated LXC installer. The addons should simply be run inside an LXC or VM instead. --- tools/addon/filebrowser-quantum.sh | 15 +++++++++++++++ tools/addon/filebrowser.sh | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tools/addon/filebrowser-quantum.sh b/tools/addon/filebrowser-quantum.sh index 9f50e5f4c..66fdb3455 100644 --- a/tools/addon/filebrowser-quantum.sh +++ b/tools/addon/filebrowser-quantum.sh @@ -43,6 +43,21 @@ IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n [[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}') [[ -z "$IP" ]] && IP="127.0.0.1" +# Proxmox Host Warning +if [[ -d "/etc/pve" ]]; then + echo -e "${RD}⚠️ Warning: Running this addon directly on the Proxmox host is not recommended!${CL}" + echo -e "${YW} Only the boot disk will be visible — passthrough drives will not be indexed.${CL}" + echo -e "${YW} This causes incorrect disk usage stats and incomplete file browsing.${CL}" + echo -e "${YW} Run this addon inside an LXC or VM instead and mount your drives there.${CL}" + echo "" + echo -n "Continue anyway on the Proxmox host? (y/N): " + read -r host_confirm + if [[ ! "${host_confirm,,}" =~ ^(y|yes)$ ]]; then + echo -e "${YW}Aborted.${CL}" + exit 0 + fi +fi + # OS Detection if [[ -f "/etc/alpine-release" ]]; then OS="Alpine" diff --git a/tools/addon/filebrowser.sh b/tools/addon/filebrowser.sh index 93ad3db64..a7db5f122 100644 --- a/tools/addon/filebrowser.sh +++ b/tools/addon/filebrowser.sh @@ -41,6 +41,21 @@ IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2}' | cut -d/ -f1 | head -n [[ -z "$IP" ]] && IP=$(hostname -I | awk '{print $1}') [[ -z "$IP" ]] && IP="127.0.0.1" +# Proxmox Host Warning +if [[ -d "/etc/pve" ]]; then + echo -e "${RD}⚠️ Warning: Running this addon directly on the Proxmox host is not recommended!${CL}" + echo -e "${YW} Only the boot disk will be visible — passthrough drives will not be indexed.${CL}" + echo -e "${YW} This causes incorrect disk usage stats and incomplete file browsing.${CL}" + echo -e "${YW} Run this addon inside an LXC or VM instead and mount your drives there.${CL}" + echo "" + echo -n "Continue anyway on the Proxmox host? (y/N): " + read -r host_confirm + if [[ ! "${host_confirm,,}" =~ ^(y|yes)$ ]]; then + echo -e "${YW}Aborted.${CL}" + exit 0 + fi +fi + # Detect OS if [[ -f "/etc/alpine-release" ]]; then OS="Alpine"