From be8392acbc2ce6ba36abc52a9592fbfac8891d40 Mon Sep 17 00:00:00 2001 From: Lucas Zampieri Date: Wed, 23 Jul 2025 22:15:35 +0100 Subject: [PATCH 1/3] feat: Add Cleanuparr to arr stack Add support for Cleanuparr, a tool for automating the cleanup of unwanted or blocked files in Sonarr, Radarr, and supported download clients. - Native Linux installation using official binaries - Runs on port 11011 - Categorized under *Arr Suite - Standard arr resources: 2 CPU, 1GB RAM, 4GB disk Signed-off-by: Lucas Zampieri --- ct/cleanuparr.sh | 57 +++++++++++++++++++++++++ ct/headers/cleanuparr | 6 +++ frontend/public/json/cleanuparr.json | 33 +++++++++++++++ install/cleanuparr-install.sh | 62 ++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100755 ct/cleanuparr.sh create mode 100644 ct/headers/cleanuparr create mode 100644 frontend/public/json/cleanuparr.json create mode 100755 install/cleanuparr-install.sh diff --git a/ct/cleanuparr.sh b/ct/cleanuparr.sh new file mode 100755 index 00000000..05ef4ae0 --- /dev/null +++ b/ct/cleanuparr.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: community-scripts ORG +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/Cleanuparr/Cleanuparr + +APP="Cleanuparr" +var_tags="${var_tags:-arr}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -f /opt/cleanuparr/Cleanuparr ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Stopping ${APP}" + systemctl stop cleanuparr + msg_ok "Stopped ${APP}" + + msg_info "Updating ${APP}" + cd /opt/cleanuparr + RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') + curl -fsSLO "https://github.com/Cleanuparr/Cleanuparr/releases/download/v${RELEASE}/Cleanuparr-${RELEASE}-linux-amd64.zip" + unzip -oq "Cleanuparr-${RELEASE}-linux-amd64.zip" + rm -f "Cleanuparr-${RELEASE}-linux-amd64.zip" + chmod +x /opt/cleanuparr/Cleanuparr + msg_ok "Updated ${APP}" + + msg_info "Starting ${APP}" + systemctl start cleanuparr + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + 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 "${TAB}${GATEWAY}${BGN}http://${IP}:11011${CL}" \ No newline at end of file diff --git a/ct/headers/cleanuparr b/ct/headers/cleanuparr new file mode 100644 index 00000000..ef403c52 --- /dev/null +++ b/ct/headers/cleanuparr @@ -0,0 +1,6 @@ + ________ + / ____/ /__ ____ _____ __ ______ ____ _________ + / / / / _ \/ __ `/ __ \/ / / / __ \/ __ `/ ___/ ___/ +/ /___/ / __/ /_/ / / / / /_/ / /_/ / /_/ / / / / +\____/_/\___/\__,_/_/ /_/\__,_/ .___/\__,_/_/ /_/ + /_/ \ No newline at end of file diff --git a/frontend/public/json/cleanuparr.json b/frontend/public/json/cleanuparr.json new file mode 100644 index 00000000..0a17cf64 --- /dev/null +++ b/frontend/public/json/cleanuparr.json @@ -0,0 +1,33 @@ +{ + "name": "Cleanuparr", + "slug": "cleanuparr", + "categories": [14], + "date_created": "2025-07-23", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 11011, + "documentation": null, + "website": "https://github.com/Cleanuparr/Cleanuparr", + "logo": "https://raw.githubusercontent.com/Cleanuparr/Cleanuparr/main/src/Cleanuparr.Web/wwwroot/logo.png", + "config_path": "", + "description": "Cleanuparr is a tool for automating the cleanup of unwanted or blocked files in Sonarr, Radarr, and supported download clients like qBittorrent, Transmission, and Deluge. It removes incomplete, blocked, or malicious downloads and can trigger replacement searches to ensure your media library stays complete and up-to-date.", + "install_methods": [ + { + "type": "default", + "script": "ct/cleanuparr.sh", + "resources": { + "cpu": 2, + "ram": 1024, + "hdd": 4, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} \ No newline at end of file diff --git a/install/cleanuparr-install.sh b/install/cleanuparr-install.sh new file mode 100755 index 00000000..89ae2dd9 --- /dev/null +++ b/install/cleanuparr-install.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: community-scripts ORG +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/Cleanuparr/Cleanuparr + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc \ + unzip +msg_ok "Installed Dependencies" + +msg_info "Installing Cleanuparr" +RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') +mkdir -p /opt/cleanuparr +cd /opt/cleanuparr +curl -fsSLO "https://github.com/Cleanuparr/Cleanuparr/releases/download/v${RELEASE}/Cleanuparr-${RELEASE}-linux-amd64.zip" +unzip -q "Cleanuparr-${RELEASE}-linux-amd64.zip" +rm -f "Cleanuparr-${RELEASE}-linux-amd64.zip" +chmod +x /opt/cleanuparr/Cleanuparr +msg_ok "Installed Cleanuparr" + +msg_info "Creating Service" +cat </etc/systemd/system/cleanuparr.service +[Unit] +Description=Cleanuparr Daemon +After=syslog.target network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/cleanuparr +ExecStart=/opt/cleanuparr/Cleanuparr +Restart=on-failure +RestartSec=5 +Environment="PORT=11011" +Environment="CONFIG_DIR=/opt/cleanuparr/config" + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now cleanuparr +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" \ No newline at end of file From 259794f0a3e07ef40e8787f05fba055b9cd62cc9 Mon Sep 17 00:00:00 2001 From: Lucas Zampieri Date: Thu, 24 Jul 2025 10:21:24 +0100 Subject: [PATCH 2/3] Apply PR review suggestions - Remove explicit dependency installation - Use fetch_and_deploy_gh_release helper function - Add version checking before updates - Use direct curl command for release version checking Signed-off-by: Lucas Zampieri --- ct/cleanuparr.sh | 34 ++++++++++++++++++---------------- install/cleanuparr-install.sh | 16 +--------------- 2 files changed, 19 insertions(+), 31 deletions(-) diff --git a/ct/cleanuparr.sh b/ct/cleanuparr.sh index 05ef4ae0..6aea73e9 100755 --- a/ct/cleanuparr.sh +++ b/ct/cleanuparr.sh @@ -27,23 +27,25 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Stopping ${APP}" - systemctl stop cleanuparr - msg_ok "Stopped ${APP}" - msg_info "Updating ${APP}" - cd /opt/cleanuparr - RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') - curl -fsSLO "https://github.com/Cleanuparr/Cleanuparr/releases/download/v${RELEASE}/Cleanuparr-${RELEASE}-linux-amd64.zip" - unzip -oq "Cleanuparr-${RELEASE}-linux-amd64.zip" - rm -f "Cleanuparr-${RELEASE}-linux-amd64.zip" - chmod +x /opt/cleanuparr/Cleanuparr - msg_ok "Updated ${APP}" + RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - msg_info "Starting ${APP}" - systemctl start cleanuparr - msg_ok "Started ${APP}" - msg_ok "Updated Successfully" + if [[ "${RELEASE}" != "$(cat ~/.Cleanuparr 2>/dev/null)" ]] || [[ ! -f ~/.Cleanuparr ]]; then + msg_info "Stopping ${APP}" + systemctl stop cleanuparr + msg_ok "Stopped ${APP}" + + msg_info "Updating ${APP} to v${RELEASE}" + fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "$RELEASE" "/opt/cleanuparr" "*linux-amd64.zip" + msg_ok "Updated ${APP}" + + msg_info "Starting ${APP}" + systemctl start cleanuparr + msg_ok "Started ${APP}" + msg_ok "Updated Successfully" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi exit } @@ -54,4 +56,4 @@ 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 "${TAB}${GATEWAY}${BGN}http://${IP}:11011${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:11011${CL}" diff --git a/install/cleanuparr-install.sh b/install/cleanuparr-install.sh index 89ae2dd9..22dabb5c 100755 --- a/install/cleanuparr-install.sh +++ b/install/cleanuparr-install.sh @@ -13,22 +13,8 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y \ - curl \ - sudo \ - mc \ - unzip -msg_ok "Installed Dependencies" - msg_info "Installing Cleanuparr" -RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') -mkdir -p /opt/cleanuparr -cd /opt/cleanuparr -curl -fsSLO "https://github.com/Cleanuparr/Cleanuparr/releases/download/v${RELEASE}/Cleanuparr-${RELEASE}-linux-amd64.zip" -unzip -q "Cleanuparr-${RELEASE}-linux-amd64.zip" -rm -f "Cleanuparr-${RELEASE}-linux-amd64.zip" -chmod +x /opt/cleanuparr/Cleanuparr +fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "latest" "/opt/cleanuparr" "*linux-amd64.zip" msg_ok "Installed Cleanuparr" msg_info "Creating Service" From 8a84b80e513833035b492d2b66fb14b7e11f7b0c Mon Sep 17 00:00:00 2001 From: Lucas Zampieri Date: Thu, 24 Jul 2025 10:27:43 +0100 Subject: [PATCH 3/3] PR review v2 - Removed blank lines; - Added config path; - Removed messages already handled by the funcion; - Update link for VED; Signed-off-by: Lucas Zampieri --- ct/cleanuparr.sh | 4 +--- frontend/public/json/cleanuparr.json | 4 ++-- install/cleanuparr-install.sh | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ct/cleanuparr.sh b/ct/cleanuparr.sh index 6aea73e9..26ac3045 100755 --- a/ct/cleanuparr.sh +++ b/ct/cleanuparr.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: community-scripts ORG # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -29,13 +29,11 @@ function update_script() { fi RELEASE=$(curl -fsSL https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.Cleanuparr 2>/dev/null)" ]] || [[ ! -f ~/.Cleanuparr ]]; then msg_info "Stopping ${APP}" systemctl stop cleanuparr msg_ok "Stopped ${APP}" - msg_info "Updating ${APP} to v${RELEASE}" fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "$RELEASE" "/opt/cleanuparr" "*linux-amd64.zip" msg_ok "Updated ${APP}" diff --git a/frontend/public/json/cleanuparr.json b/frontend/public/json/cleanuparr.json index 0a17cf64..2d3590b4 100644 --- a/frontend/public/json/cleanuparr.json +++ b/frontend/public/json/cleanuparr.json @@ -10,7 +10,7 @@ "documentation": null, "website": "https://github.com/Cleanuparr/Cleanuparr", "logo": "https://raw.githubusercontent.com/Cleanuparr/Cleanuparr/main/src/Cleanuparr.Web/wwwroot/logo.png", - "config_path": "", + "config_path": "/opt/cleanuparr/config ", "description": "Cleanuparr is a tool for automating the cleanup of unwanted or blocked files in Sonarr, Radarr, and supported download clients like qBittorrent, Transmission, and Deluge. It removes incomplete, blocked, or malicious downloads and can trigger replacement searches to ensure your media library stays complete and up-to-date.", "install_methods": [ { @@ -30,4 +30,4 @@ "password": null }, "notes": [] -} \ No newline at end of file +} diff --git a/install/cleanuparr-install.sh b/install/cleanuparr-install.sh index 22dabb5c..45e3bc1d 100755 --- a/install/cleanuparr-install.sh +++ b/install/cleanuparr-install.sh @@ -13,7 +13,6 @@ setting_up_container network_check update_os -msg_info "Installing Cleanuparr" fetch_and_deploy_gh_release "Cleanuparr" "Cleanuparr/Cleanuparr" "prebuild" "latest" "/opt/cleanuparr" "*linux-amd64.zip" msg_ok "Installed Cleanuparr" @@ -45,4 +44,4 @@ customize msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean -msg_ok "Cleaned" \ No newline at end of file +msg_ok "Cleaned"