From a9fcf80b36c9fefb55a8625b739a68cd766291b0 Mon Sep 17 00:00:00 2001 From: GoldenSpring Date: Thu, 25 Dec 2025 21:12:03 +0300 Subject: [PATCH] started building the script --- ct/sonobarr.sh | 62 +++++++++++++++++++++++++++++++++++++ install/sonobarr-install.sh | 43 +++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 ct/sonobarr.sh create mode 100644 install/sonobarr-install.sh diff --git a/ct/sonobarr.sh b/ct/sonobarr.sh new file mode 100644 index 000000000..ff3938aa1 --- /dev/null +++ b/ct/sonobarr.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 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:-pastebin;storage}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +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 [[ ! -f "/opt/sonobarr" ]]; then + msg_error "No sonobarr Installation Found!" + exit + fi + + if check_for_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr"; then + msg_info "Stopping sonobarr" + systemctl stop sonobarr + msg_ok "Stopped sonobarr" + + msg_info "Creating Backup" + tar -czf "/opt/sonobarr_backup_$(date +%F).tar.gz" "/opt/sonobarr/upload" + msg_ok "Backup Created" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball" + + msg_info "Updating sonobarr" + cd /opt/sonobarr + msg_ok "Updated sonobarr" + + msg_info "Starting sonobarr" + systemctl start sonobarr + msg_ok "Started sonobarr" + msg_ok "Update sonobarr" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}rustypaste setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}" diff --git a/install/sonobarr-install.sh b/install/sonobarr-install.sh new file mode 100644 index 000000000..3480a8f21 --- /dev/null +++ b/install/sonobarr-install.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 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 + +setup_python +fetch_and_deploy_gh_release "sonobarr" "Dodelidoo-Labs/sonobarr" "tarball" + +msg_info "Setting up sonobarr" +cd /opt/sonobarr +pip install --no-cache-dir -r requirements.txt +msg_ok "Set up sonobarr" + +msg_info "Creating Service" +cat </etc/systemd/system/sonobarr +[Unit] +Description=sonobarr Service +After=network.target + +[Service] +WorkingDirectory=/opt/sonobarr +ExecStart=/bin/bash -c 'gunicorn src.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