From c6ce72cefdf2de89aff919cb384590e446754a13 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 28 Jul 2026 14:12:37 -0400 Subject: [PATCH] Migrate Musicseerr to DroppedNeedle (#15751) --- ct/droppedneedle.sh | 147 +++++++++++++++++++++++++++++++ ct/musicseerr.sh | 80 ++--------------- install/droppedneedle-install.sh | 60 +++++++++++++ install/musicseerr-install.sh | 59 ------------- 4 files changed, 213 insertions(+), 133 deletions(-) create mode 100644 ct/droppedneedle.sh create mode 100644 install/droppedneedle-install.sh delete mode 100644 install/musicseerr-install.sh diff --git a/ct/droppedneedle.sh b/ct/droppedneedle.sh new file mode 100644 index 000000000..05d8efd33 --- /dev/null +++ b/ct/droppedneedle.sh @@ -0,0 +1,147 @@ +#!/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 </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= +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=' /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}" diff --git a/ct/musicseerr.sh b/ct/musicseerr.sh index f7aa74e6d..4473bd14a 100644 --- a/ct/musicseerr.sh +++ b/ct/musicseerr.sh @@ -1,85 +1,17 @@ #!/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 +# Author: michelroegl-brunner | Co-Author: vhsdream # 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 -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}" +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 diff --git a/install/droppedneedle-install.sh b/install/droppedneedle-install.sh new file mode 100644 index 000000000..666cb4a3d --- /dev/null +++ b/install/droppedneedle-install.sh @@ -0,0 +1,60 @@ +#!/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 </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= +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 diff --git a/install/musicseerr-install.sh b/install/musicseerr-install.sh deleted file mode 100644 index efa222571..000000000 --- a/install/musicseerr-install.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/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 </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