From c65bd939eb0722538e6d252a89f2cd7a3da17917 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 15 Feb 2024 07:32:28 -0500 Subject: [PATCH] Update homeassistant-core.sh fixes https://github.com/tteck/Proxmox/issues/2501 --- ct/homeassistant-core.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ct/homeassistant-core.sh b/ct/homeassistant-core.sh index b6567eb8..dbbfa463 100644 --- a/ct/homeassistant-core.sh +++ b/ct/homeassistant-core.sh @@ -107,12 +107,23 @@ function update_script() { exit fi if [ "$UPD" == "3" ]; then + read -r -p "Would you like to use No Authentication? " prompt msg_info "Installing FileBrowser" RELEASE=$(curl -fsSL https://api.github.com/repos/filebrowser/filebrowser/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g' | sed 's/tag_name: //g') - curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/v2.23.0/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null - filebrowser config init -a '0.0.0.0' &>/dev/null - filebrowser config set -a '0.0.0.0' &>/dev/null - filebrowser users add admin changeme --perm.admin &>/dev/null + curl -fsSL https://github.com/filebrowser/filebrowser/releases/download/$RELEASE/linux-amd64-filebrowser.tar.gz | tar -xzv -C /usr/local/bin &>/dev/null + + if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + filebrowser config init -a '0.0.0.0' &>/dev/null + filebrowser config set -a '0.0.0.0' &>/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 + else + filebrowser config init -a '0.0.0.0' &>/dev/null + filebrowser config set -a '0.0.0.0' &>/dev/null + filebrowser users add admin changeme --perm.admin &>/dev/null + fi + fi msg_ok "Installed FileBrowser" msg_info "Creating Service"