diff --git a/ct/sonobarr.sh b/ct/sonobarr.sh new file mode 100644 index 000000000..b8279a24d --- /dev/null +++ b/ct/sonobarr.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: GoldenSpringness +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/Dodelidoo-Labs/sonobarr + +APP="sonobarr" +var_tags="${var_tags:-storage}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-20}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +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/sonobarr" ]]; then + msg_error "No sonobarr Installation Found!" + exit + fi + + PYTHON_VERSION="3.12" setup_uv + + if check_for_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr"; then + msg_info "Stopping Service" + systemctl stop sonobarr + msg_ok "Stopped Service" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball" + + msg_info "Updating sonobarr" + $STD uv venv -c /opt/sonobarr/venv + $STD source /opt/sonobarr/venv/bin/activate + $STD uv pip install --no-cache-dir -r /opt/sonobarr/requirements.txt + sed -i "/release_version/s/=.*/=$(cat ~/.sonobarr)/" /etc/sonobarr/.env + msg_ok "Updated sonobarr" + + msg_info "Starting Service" + systemctl start sonobarr + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}sonobarr setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5000${CL}" diff --git a/frontend/public/json/sonobarr.json b/frontend/public/json/sonobarr.json new file mode 100644 index 000000000..965d6aee0 --- /dev/null +++ b/frontend/public/json/sonobarr.json @@ -0,0 +1,40 @@ +{ + "name": "Sonobarr", + "slug": "sonobarr", + "categories": [ + 14 + ], + "date_created": "2026-01-21", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 5000, + "documentation": "https://github.com/Dodelidoo-Labs/sonobarr", + "config_path": "/etc/sonobarr/.env", + "website": "https://github.com/Dodelidoo-Labs/sonobarr", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/sonobarr.webp", + "description": "Sonobarr marries your existing Lidarr library with Last.fm’s discovery graph to surface artists you'll actually like. It runs as a Flask + Socket.IO application, ships with a polished Bootstrap UI, and includes admin tooling so folks can share a single instance safely.", + "install_methods": [ + { + "type": "default", + "script": "ct/sonobarr.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 20, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Default generated admin password is in the env file (sonobarr_superadmin_password)", + "type": "info" + } + ] +} diff --git a/install/sonobarr-install.sh b/install/sonobarr-install.sh new file mode 100644 index 000000000..ee0ab0b36 --- /dev/null +++ b/install/sonobarr-install.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: GoldenSpringness +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/Dodelidoo-Labs/sonobarr + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball" +PYTHON_VERSION="3.12" setup_uv + +msg_info "Setting up sonobarr" +source /opt/sonobarr/venv/bin/activate +$STD uv pip install --no-cache-dir -r /opt/sonobarr/requirements.txt +mkdir -p /etc/sonobarr +mv /opt/sonobarr/.sample-env /etc/sonobarr/.env +sed -i "s/^secret_key=.*/secret_key=$(openssl rand -hex 16)/" /etc/sonobarr/.env +sed -i "s/^sonobarr_superadmin_password=.*/sonobarr_superadmin_password=$(openssl rand -hex 16)/" /etc/sonobarr/.env +echo "release_version=$(cat ~/.sonobarr)" >>/etc/sonobarr/.env +echo "sonobarr_config_dir=/etc/sonobarr" >>/etc/sonobarr.env +msg_ok "Set up sonobarr" + +msg_info "Creating Service" +cat </etc/systemd/system/sonobarr.service +[Unit] +Description=sonobarr Service +After=network.target + +[Service] +WorkingDirectory=/opt/sonobarr/src +EnvironmentFile=/etc/sonobarr/.env +Environment="PATH=/opt/sonobarr/venv/bin" +ExecStart=/bin/bash -c 'gunicorn Sonobarr:app -c ../gunicorn_config.py' +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now sonobarr +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc