mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-03 09:52:50 +00:00
Filebrowser-Quantum: change initial config to newer default (#8497)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: Author: MickLesk
|
# Author: MickLesk
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
|
|
||||||
function header_info() {
|
function header_info() {
|
||||||
@@ -53,20 +53,9 @@ fi
|
|||||||
|
|
||||||
header_info
|
header_info
|
||||||
|
|
||||||
function msg_info() {
|
function msg_info() { echo -e "${INFO} ${YW}$1...${CL}"; }
|
||||||
local msg="$1"
|
function msg_ok() { echo -e "${CM} ${GN}$1${CL}"; }
|
||||||
echo -e "${INFO} ${YW}${msg}...${CL}"
|
function msg_error() { echo -e "${CROSS} ${RD}$1${CL}"; }
|
||||||
}
|
|
||||||
|
|
||||||
function msg_ok() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -e "${CM} ${GN}${msg}${CL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function msg_error() {
|
|
||||||
local msg="$1"
|
|
||||||
echo -e "${CROSS} ${RD}${msg}${CL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Detect legacy FileBrowser installation
|
# Detect legacy FileBrowser installation
|
||||||
LEGACY_DB="/usr/local/community-scripts/filebrowser.db"
|
LEGACY_DB="/usr/local/community-scripts/filebrowser.db"
|
||||||
@@ -96,7 +85,7 @@ if [[ -f "$LEGACY_DB" || -f "$LEGACY_BIN" && ! -f "$CONFIG_PATH" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check existing installation
|
# Existing installation
|
||||||
if [[ -f "$INSTALL_PATH" ]]; then
|
if [[ -f "$INSTALL_PATH" ]]; then
|
||||||
echo -e "${YW}⚠️ ${APP} is already installed.${CL}"
|
echo -e "${YW}⚠️ ${APP} is already installed.${CL}"
|
||||||
echo -n "Uninstall ${APP}? (y/N): "
|
echo -n "Uninstall ${APP}? (y/N): "
|
||||||
@@ -120,18 +109,8 @@ fi
|
|||||||
read -r update_prompt
|
read -r update_prompt
|
||||||
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
if [[ "${update_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||||
msg_info "Updating ${APP}"
|
msg_info "Updating ${APP}"
|
||||||
tmp="${INSTALL_PATH}.tmp.$$"
|
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$INSTALL_PATH"
|
||||||
if ! curl -fSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$tmp"; then
|
chmod +x "$INSTALL_PATH"
|
||||||
msg_error "Download failed"
|
|
||||||
rm -f "$tmp"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
chmod 0755 "$tmp"
|
|
||||||
if ! mv -f "$tmp" "$INSTALL_PATH"; then
|
|
||||||
msg_error "Install failed (cannot move into $INSTALL_PATH)"
|
|
||||||
rm -f "$tmp"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
msg_ok "Updated ${APP}"
|
msg_ok "Updated ${APP}"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
@@ -147,7 +126,11 @@ PORT=${PORT:-$DEFAULT_PORT}
|
|||||||
|
|
||||||
echo -n "Install ${APP}? (y/n): "
|
echo -n "Install ${APP}? (y/n): "
|
||||||
read -r install_prompt
|
read -r install_prompt
|
||||||
if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
if ! [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||||
|
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Installing ${APP} on ${OS}"
|
msg_info "Installing ${APP} on ${OS}"
|
||||||
$PKG_MANAGER curl ffmpeg &>/dev/null
|
$PKG_MANAGER curl ffmpeg &>/dev/null
|
||||||
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$INSTALL_PATH"
|
curl -fsSL https://github.com/gtsteffaniak/filebrowser/releases/latest/download/linux-amd64-filebrowser -o "$INSTALL_PATH"
|
||||||
@@ -163,23 +146,26 @@ if [[ "${install_prompt,,}" =~ ^(y|yes)$ ]]; then
|
|||||||
echo -n "Use No Authentication? (y/N): "
|
echo -n "Use No Authentication? (y/N): "
|
||||||
read -r noauth_prompt
|
read -r noauth_prompt
|
||||||
|
|
||||||
|
# === YAML CONFIG GENERATION ===
|
||||||
if [[ "${noauth_prompt,,}" =~ ^(y|yes)$ ]]; then
|
if [[ "${noauth_prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||||
cat <<EOF >"$CONFIG_PATH"
|
cat <<EOF >"$CONFIG_PATH"
|
||||||
server:
|
server:
|
||||||
port: $PORT
|
port: $PORT
|
||||||
sources:
|
sources:
|
||||||
- path: "$SRC_DIR"
|
- path: "$SRC_DIR"
|
||||||
|
name: "RootFS"
|
||||||
config:
|
config:
|
||||||
|
denyByDefault: false
|
||||||
disableIndexing: false
|
disableIndexing: false
|
||||||
indexingIntervalMinutes: 240
|
indexingIntervalMinutes: 240
|
||||||
exclude:
|
conditionals:
|
||||||
folderPaths:
|
rules:
|
||||||
- "/proc"
|
- neverWatchPath: "/proc"
|
||||||
- "/sys"
|
- neverWatchPath: "/sys"
|
||||||
- "/dev"
|
- neverWatchPath: "/dev"
|
||||||
- "/run"
|
- neverWatchPath: "/run"
|
||||||
- "/tmp"
|
- neverWatchPath: "/tmp"
|
||||||
- "/lost+found"
|
- neverWatchPath: "/lost+found"
|
||||||
auth:
|
auth:
|
||||||
methods:
|
methods:
|
||||||
noauth: true
|
noauth: true
|
||||||
@@ -191,17 +177,19 @@ server:
|
|||||||
port: $PORT
|
port: $PORT
|
||||||
sources:
|
sources:
|
||||||
- path: "$SRC_DIR"
|
- path: "$SRC_DIR"
|
||||||
|
name: "RootFS"
|
||||||
config:
|
config:
|
||||||
|
denyByDefault: false
|
||||||
disableIndexing: false
|
disableIndexing: false
|
||||||
indexingIntervalMinutes: 240
|
indexingIntervalMinutes: 240
|
||||||
exclude:
|
conditionals:
|
||||||
folderPaths:
|
rules:
|
||||||
- "/proc"
|
- neverWatchPath: "/proc"
|
||||||
- "/sys"
|
- neverWatchPath: "/sys"
|
||||||
- "/dev"
|
- neverWatchPath: "/dev"
|
||||||
- "/run"
|
- neverWatchPath: "/run"
|
||||||
- "/tmp"
|
- neverWatchPath: "/tmp"
|
||||||
- "/lost+found"
|
- neverWatchPath: "/lost+found"
|
||||||
auth:
|
auth:
|
||||||
adminUsername: admin
|
adminUsername: admin
|
||||||
adminPassword: helper-scripts.com
|
adminPassword: helper-scripts.com
|
||||||
@@ -210,7 +198,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Creating service"
|
msg_info "Creating service"
|
||||||
|
|
||||||
if [[ "$OS" == "Debian" ]]; then
|
if [[ "$OS" == "Debian" ]]; then
|
||||||
cat <<EOF >"$SERVICE_PATH"
|
cat <<EOF >"$SERVICE_PATH"
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -248,7 +235,3 @@ EOF
|
|||||||
|
|
||||||
msg_ok "Service created successfully"
|
msg_ok "Service created successfully"
|
||||||
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}"
|
echo -e "${CM} ${GN}${APP} is reachable at: ${BL}http://$IP:$PORT${CL}"
|
||||||
else
|
|
||||||
echo -e "${YW}⚠️ Installation skipped. Exiting.${CL}"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user