diff --git a/ct/headers/suggestarr b/ct/headers/suggestarr new file mode 100644 index 00000000000..75278876d06 --- /dev/null +++ b/ct/headers/suggestarr @@ -0,0 +1,6 @@ + _____ __ ___ + / ___/__ ______ _____ ____ _____/ /_/ | __________ + \__ \/ / / / __ `/ __ `/ _ \/ ___/ __/ /| | / ___/ ___/ + ___/ / /_/ / /_/ / /_/ / __(__ ) /_/ ___ |/ / / / +/____/\__,_/\__, /\__, /\___/____/\__/_/ |_/_/ /_/ + /____//____/ diff --git a/ct/suggestarr.sh b/ct/suggestarr.sh new file mode 100644 index 00000000000..485b83b3356 --- /dev/null +++ b/ct/suggestarr.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# Engine comes from community-scripts/core; this repo only ships the scripts. +# A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core), +# so a fork or branch of core can be tested without editing this file. +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/giuseppe99barchetta/SuggestArr + +APP="SuggestArr" +var_tags="${var_tags:-arr;media}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +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/suggestarr ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "suggestarr" "giuseppe99barchetta/SuggestArr"; then + msg_info "Stopping Service" + systemctl stop suggestarr + msg_ok "Stopped Service" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "suggestarr" "giuseppe99barchetta/SuggestArr" "tarball" + + msg_info "Building Frontend" + cd /opt/suggestarr/client + $STD npm install + $STD npm run build + mkdir -p /opt/suggestarr/static + cp -r /opt/suggestarr/client/dist/* /opt/suggestarr/static/ + cp -r /opt/suggestarr/client/node_modules/swagger-ui-dist /opt/suggestarr/static/swagger-ui + msg_ok "Built Frontend" + + msg_info "Updating Python Environment" + cd /opt/suggestarr + $STD uv venv --python 3.12 /opt/suggestarr/.venv + $STD uv pip install --python /opt/suggestarr/.venv -r /opt/suggestarr/api_service/requirements.txt + msg_ok "Updated Python Environment" + + msg_info "Starting Service" + systemctl start suggestarr + 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}:5000${CL}" diff --git a/install/suggestarr-install.sh b/install/suggestarr-install.sh new file mode 100644 index 00000000000..ccc8de8d1c0 --- /dev/null +++ b/install/suggestarr-install.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/giuseppe99barchetta/SuggestArr + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y build-essential +msg_ok "Installed Dependencies" + +UV_PYTHON="3.12" setup_uv +NODE_VERSION="22" setup_nodejs + +fetch_and_deploy_gh_release "suggestarr" "giuseppe99barchetta/SuggestArr" "tarball" + +msg_info "Building Frontend" +cd /opt/suggestarr/client +$STD npm install +$STD npm run build +mkdir -p /opt/suggestarr/static +cp -r /opt/suggestarr/client/dist/* /opt/suggestarr/static/ +cp -r /opt/suggestarr/client/node_modules/swagger-ui-dist /opt/suggestarr/static/swagger-ui +msg_ok "Built Frontend" + +msg_info "Setting up Python Environment" +cd /opt/suggestarr +$STD uv venv --python 3.12 /opt/suggestarr/.venv +$STD uv pip install --python /opt/suggestarr/.venv -r /opt/suggestarr/api_service/requirements.txt +msg_ok "Set up Python Environment" + +msg_info "Configuring SuggestArr" +mkdir -p /opt/suggestarr_data +cat </opt/suggestarr.env +SUGGESTARR_PORT=5000 +LOG_LEVEL=info +CONFIG_DIR=/opt/suggestarr_data +EOF +chmod 600 /opt/suggestarr.env +msg_ok "Configured SuggestArr" + +msg_info "Creating Service" +cat </etc/systemd/system/suggestarr.service +[Unit] +Description=SuggestArr +Wants=network-online.target +After=network-online.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/suggestarr +EnvironmentFile=/opt/suggestarr.env +ExecStart=/opt/suggestarr/.venv/bin/uvicorn api_service.app:asgi_app --host 0.0.0.0 --port 5000 --log-level info +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now suggestarr +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc