Compare commits

..

3 Commits

Author SHA1 Message Date
MickLesk af111bf419 Refactor nginx management to use helper
Replace direct nginx systemctl/ln calls with the `nginx_enable_site` helper function across multiple update scripts. Also use `get_php_fpm_socket` in paymenter.sh for dynamic PHP socket path instead of hardcoded version string.
2026-07-28 15:02:51 +02:00
MickLesk b7688ff97a Standardize nginx setup in install scripts
Refactors many install scripts to use the shared `nginx_enable_site` helper instead of manual symlink/default-site/reload sequences, making webserver setup more consistent and less error-prone. It also replaces hardcoded PHP-FPM socket paths with `get_php_fpm_socket` (including templated substitutions where needed) across nginx and caddy configs to improve compatibility with varying PHP versions and socket locations.
2026-07-28 14:57:58 +02:00
MickLesk f862ce0c13 Add nginx site helper and PHP socket resolver
Introduce `get_php_fpm_socket` to reliably resolve the active PHP-FPM Unix socket, preferring the configured PHP version and falling back to the highest running socket under `/run/php`. Add `nginx_enable_site` to safely enable a site by removing defaults, linking configs, testing `nginx -t`, enabling the service, and restarting through the existing safe restart path.
2026-07-28 14:55:52 +02:00
8 changed files with 138 additions and 231 deletions
-11
View File
@@ -514,22 +514,11 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 🐞 Bug Fixes
- npmplus: Remove duplicate msg_info for container recreation [@MickLesk](https://github.com/MickLesk) ([#16122](https://github.com/community-scripts/ProxmoxVE/pull/16122))
- fix Node.js version drift [@asylumexp](https://github.com/asylumexp) ([#16111](https://github.com/community-scripts/ProxmoxVE/pull/16111))
- UmlautAdaptarr: use the Debian 13 Microsoft repo with its 2025 signing key [@angusmaul](https://github.com/angusmaul) ([#16077](https://github.com/community-scripts/ProxmoxVE/pull/16077))
- fix(bazarr): store data in /var/lib/bazarr instead of inside /opt/bazarr [@angusmaul](https://github.com/angusmaul) ([#16098](https://github.com/community-scripts/ProxmoxVE/pull/16098))
- Cloudflare-DDNS: store API token in a 600 env file and build the binary at install time [@angusmaul](https://github.com/angusmaul) ([#16100](https://github.com/community-scripts/ProxmoxVE/pull/16100))
- #### ✨ New Features
- tools.func: add nginx site helper and PHP socket resolver [@MickLesk](https://github.com/MickLesk) ([#16118](https://github.com/community-scripts/ProxmoxVE/pull/16118))
### 💾 Core
- #### 🐞 Bug Fixes
- core: fix read prompt input directly from /dev/tty [@MickLesk](https://github.com/MickLesk) ([#16126](https://github.com/community-scripts/ProxmoxVE/pull/16126))
### 🧰 Tools
- actual-budget-prometheus-exporter ([#16109](https://github.com/community-scripts/ProxmoxVE/pull/16109))
-147
View File
@@ -1,147 +0,0 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner | Co-Author: vhsdream
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://droppedneedle.com/ | Github: https://github.com/DroppedNeedle/DroppedNeedle
APP="DroppedNeedle"
var_tags="${var_tags:-arr;media}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/droppedneedle && ! -d /opt/musicseerr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
MIGRATING=false
[[ -d /opt/musicseerr ]] && MIGRATING=true
if [[ "$MIGRATING" == "true" ]] || check_for_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle"; then
if [[ "$MIGRATING" == "true" ]]; then
msg_warn "Migrating Musicseerr to DroppedNeedle"
msg_info "Stopping Musicseerr Service"
systemctl disable -q --now musicseerr
msg_ok "Stopped Musicseerr Service"
DATA_DIR="/opt/musicseerr/backend"
else
msg_info "Stopping Service"
systemctl stop droppedneedle
msg_ok "Stopped Service"
DATA_DIR="/opt/droppedneedle/backend"
fi
create_backup "$DATA_DIR/config" "$DATA_DIR/cache"
PYTHON_VERSION="3.13" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Building Frontend"
cd /opt/droppedneedle/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
rm -rf node_modules build
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Updating Application"
mkdir -p /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
$STD uv venv --clear /opt/droppedneedle/venv
$STD uv pip install -r /opt/droppedneedle/backend/requirements.txt --python=/opt/droppedneedle/venv/bin/python
rm -rf /opt/droppedneedle/backend/static
cp -r /opt/droppedneedle/frontend/build /opt/droppedneedle/backend/static
msg_ok "Updated Application"
restore_backup
if [[ "$MIGRATING" == "true" ]]; then
msg_info "Migrating Musicseerr Data"
rm -rf /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
cp -a /opt/musicseerr/backend/config /opt/droppedneedle/backend/config
cp -a /opt/musicseerr/backend/cache /opt/droppedneedle/backend/cache
msg_ok "Migrated Musicseerr Data"
msg_info "Replacing systemd Service"
cat <<EOF >/etc/systemd/system/droppedneedle.service
[Unit]
Description=DroppedNeedle Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=PORT=8688
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8688 --loop uvloop --http httptools --workers 1
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
rm -f /etc/systemd/system/musicseerr.service
msg_ok "Replaced systemd Service"
elif ! grep -q 'SLSKD' /etc/systemd/system/droppedneedle.service; then
sed -i '\|=8688$|a# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>' /etc/systemd/system/droppedneedle.service
fi
systemctl daemon-reload
if [[ "$MIGRATING" == "true" ]]; then
msg_info "Enabling DroppedNeedle Service"
systemctl enable -q --now droppedneedle
msg_ok "Enabled DroppedNeedle Service"
sed -i 's/musicseerr/droppedneedle/g' /bin/update
rm -rf /opt/musicseerr
msg_info "Waiting up to 1min for backend to boot and retrieve Admin Username"
for i in {1..30}; do
username=$(/opt/droppedneedle/venv/bin/python -c 'import sqlite3; conn = sqlite3.connect("/opt/droppedneedle/backend/cache/library.db"); c = conn.cursor(); c.execute("SELECT username FROM auth_users WHERE role=\"admin\""); admin=c.fetchone(); print(admin[0]) if (admin and admin[0]) else None' 2>/dev/null || true)
if [[ -n "$username" ]]; then
break
fi
sleep 2
done
if [[ -n "$username" ]]; then
msg_ok "Admin Username retrieved (Admin Username is: ${username})"
else
msg_warn "Failed to retrieve Admin Username. The backend might still be starting."
fi
msg_ok "Migrated successfully!"
else
msg_info "Starting Service"
systemctl start droppedneedle
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:8688${CL}"
-6
View File
@@ -1,6 +0,0 @@
____ ___ __ ____
/ __ \_________ ____ ____ ___ ____/ / | / /__ ___ ____/ / /__
/ / / / ___/ __ \/ __ \/ __ \/ _ \/ __ / |/ / _ \/ _ \/ __ / / _ \
/ /_/ / / / /_/ / /_/ / /_/ / __/ /_/ / /| / __/ __/ /_/ / / __/
/_____/_/ \____/ .___/ .___/\___/\__,_/_/ |_/\___/\___/\__,_/_/\___/
/_/ /_/
+74 -6
View File
@@ -1,17 +1,85 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner | Co-Author: vhsdream
# Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://musicseerr.com/ | Github: https://github.com/HabiRabbu/Musicseerr
APP="MusicSeerr"
var_tags="${var_tags:-arr;media}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
msg_error "This script is no longer available."
msg_warn "MusicSeerr has been renamed to DroppedNeedle."
msg_warn "Run the DroppedNeedle script to migrate an existing installation:"
echo 'bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/droppedneedle.sh)"'
exit 1
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/musicseerr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "musicseerr" "HabiRabbu/Musicseerr"; then
msg_info "Stopping Service"
systemctl stop musicseerr
msg_ok "Stopped Service"
msg_info "Backing up Data"
cp -a /opt/musicseerr/backend/config /opt/musicseerr_config_backup
cp -a /opt/musicseerr/backend/cache /opt/musicseerr_cache_backup
msg_ok "Backed up Data"
PYTHON_VERSION="3.13" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "musicseerr" "HabiRabbu/Musicseerr" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Building Frontend"
cd /opt/musicseerr/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
rm -rf node_modules build
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Updating Application"
mkdir -p /opt/musicseerr/backend/config /opt/musicseerr/backend/cache
$STD uv venv --clear /opt/musicseerr/venv
$STD uv pip install -r /opt/musicseerr/backend/requirements.txt --python=/opt/musicseerr/venv/bin/python
rm -rf /opt/musicseerr/backend/static
cp -r /opt/musicseerr/frontend/build /opt/musicseerr/backend/static
msg_ok "Updated Application"
msg_info "Restoring Data"
rm -rf /opt/musicseerr/backend/config /opt/musicseerr/backend/cache
cp -a /opt/musicseerr_config_backup/. /opt/musicseerr/backend/config/
cp -a /opt/musicseerr_cache_backup/. /opt/musicseerr/backend/cache/
rm -rf /opt/musicseerr_config_backup /opt/musicseerr_cache_backup
msg_ok "Restored Data"
msg_info "Starting Service"
systemctl start musicseerr
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:8688${CL}"
+4
View File
@@ -21,6 +21,8 @@ color
catch_errors
function update_script() {
header_info "$APP"
msg_info "Updating Alpine OS"
$STD apk -U upgrade
msg_ok "System updated"
@@ -28,8 +30,10 @@ function update_script() {
msg_info "Pulling latest NPMplus container image"
cd /opt
$STD docker compose pull
msg_info "Recreating container"
$STD docker compose up -d
msg_ok "Updated NPMplus container"
msg_ok "Updated successfully!"
exit
}
-60
View File
@@ -1,60 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner | Co-Author: vhsdream
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://droppedneedle.com/ | Github: https://github.com/DroppedNeedle/DroppedNeedle
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PYTHON_VERSION="3.13" setup_uv
fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Building Frontend"
cd /opt/droppedneedle/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Setting up Application"
mkdir -p /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
$STD uv venv /opt/droppedneedle/venv
$STD uv pip install -r /opt/droppedneedle/backend/requirements.txt --python=/opt/droppedneedle/venv/bin/python
rm -rf /opt/droppedneedle/backend/static
cp -r /opt/droppedneedle/frontend/build /opt/droppedneedle/backend/static
msg_ok "Set up Application"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/droppedneedle.service
[Unit]
Description=DroppedNeedle Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=PORT=8688
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8688 --loop uvloop --http httptools --workers 1
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now droppedneedle
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: michelroegl-brunner
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://musicseerr.com/ | Github: https://github.com/HabiRabbu/Musicseerr
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PYTHON_VERSION="3.13" setup_uv
fetch_and_deploy_gh_release "musicseerr" "HabiRabbu/Musicseerr" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Building Frontend"
cd /opt/musicseerr/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Setting up Application"
mkdir -p /opt/musicseerr/backend/config /opt/musicseerr/backend/cache
$STD uv venv /opt/musicseerr/venv
$STD uv pip install -r /opt/musicseerr/backend/requirements.txt --python=/opt/musicseerr/venv/bin/python
rm -rf /opt/musicseerr/backend/static
cp -r /opt/musicseerr/frontend/build /opt/musicseerr/backend/static
msg_ok "Set up Application"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/musicseerr.service
[Unit]
Description=MusicSeerr Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/musicseerr/backend
Environment=ROOT_APP_DIR=/opt/musicseerr/backend
Environment=PORT=8688
ExecStart=/opt/musicseerr/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8688 --loop uvloop --http httptools --workers 1
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now musicseerr
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+1 -1
View File
@@ -5337,7 +5337,7 @@ EOF
local response=""
local read_rc
read -t 60 -r response </dev/tty
read -t 60 -r response
read_rc=$?
if [[ $read_rc -eq 0 ]]; then
case "${response:-1}" in