From 5a7ed724df5678b4768da5349a1f395896d817f4 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 7 Jul 2025 09:37:47 +0200 Subject: [PATCH] Update filebrowser.sh --- tools/addon/filebrowser.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/addon/filebrowser.sh b/tools/addon/filebrowser.sh index 29015d31..b648c155 100644 --- a/tools/addon/filebrowser.sh +++ b/tools/addon/filebrowser.sh @@ -88,7 +88,7 @@ if [ -f "$INSTALL_PATH" ]; then read -r -p "Would you like to update ${APP}? (y/N): " update_prompt if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Updating ${APP}" - curl -fsSL https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null + curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null chmod +x "$INSTALL_PATH" msg_ok "Updated ${APP}" exit 0 @@ -106,7 +106,7 @@ read -r -p "Would you like to install ${APP}? (y/n): " install_prompt if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Installing ${APP} on ${OS}" $PKG_MANAGER wget tar curl &>/dev/null - curl -fsSL https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null + curl -fsSL "https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz" | tar -xzv -C /usr/local/bin &>/dev/null chmod +x "$INSTALL_PATH" msg_ok "Installed ${APP}" @@ -119,22 +119,17 @@ if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then chmod 644 "$DB_PATH" msg_ok "Directory created successfully" + cd /usr/local/community-scripts + filebrowser config init &>/dev/null + filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null + filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null + read -r -p "Would you like to use No Authentication? (y/N): " auth_prompt if [[ "${auth_prompt,,}" =~ ^(y|yes)$ ]]; then msg_info "Configuring No Authentication" - cd /usr/local/community-scripts - filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null - filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null - filebrowser config init --auth.method=noauth &>/dev/null filebrowser config set --auth.method=noauth &>/dev/null - filebrowser users add ID 1 --perm.admin &>/dev/null msg_ok "No Authentication configured" else - msg_info "Setting up default authentication" - cd /usr/local/community-scripts - filebrowser config init -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null - filebrowser config set -a '0.0.0.0' -p "$PORT" -d "$DB_PATH" &>/dev/null - filebrowser users add admin helper-scripts.com --perm.admin --database "$DB_PATH" &>/dev/null msg_ok "Default authentication configured (admin:helper-scripts.com)" fi @@ -149,8 +144,8 @@ After=network-online.target User=root WorkingDirectory=/usr/local/community-scripts ExecStartPre=/bin/touch /usr/local/community-scripts/filebrowser.db -ExecStartPre=/usr/local/bin/filebrowser config set -a "0.0.0.0" -p 9000 -d /usr/local/community-scripts/filebrowser.db -ExecStart=/usr/local/bin/filebrowser -r / -d /usr/local/community-scripts/filebrowser.db -p 9000 +ExecStartPre=/usr/local/bin/filebrowser config set -a "0.0.0.0" -p ${PORT} -d /usr/local/community-scripts/filebrowser.db +ExecStart=/usr/local/bin/filebrowser -r / -d /usr/local/community-scripts/filebrowser.db -p ${PORT} Restart=always [Install]