diff --git a/ct/profilarr.sh b/ct/profilarr.sh index 7bf0582b2..562827a7a 100644 --- a/ct/profilarr.sh +++ b/ct/profilarr.sh @@ -8,7 +8,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV APP="Profilarr" var_tags="${var_tags:-arr;radarr;sonarr;config}" var_cpu="${var_cpu:-2}" -var_ram="${var_ram:-2048}" +var_ram="${var_ram:-4096}" var_disk="${var_disk:-8}" var_os="${var_os:-debian}" var_version="${var_version:-13}" @@ -29,43 +29,70 @@ function update_script() { exit fi + if [[ -d /opt/profilarr/backend ]]; then + msg_error "Profilarr v1 detected!" + echo -e "\nProfilarr v2 is a complete rewrite and is NOT compatible with v1." + echo -e "There is no migration path. Please create a new LXC container for v2.\n" + exit + fi + if check_for_gh_release "profilarr" "Dictionarry-Hub/profilarr"; then msg_info "Stopping Service" systemctl stop profilarr msg_ok "Stopped Service" - msg_info "Backing up Data" - if [[ -d /config ]]; then - cp -r /config /opt/profilarr_config_backup - fi - msg_ok "Backed up Data" - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "profilarr" "Dictionarry-Hub/profilarr" "tarball" + PROFILARR_VERSION=$(curl -fsSL "https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest" | grep '"tag_name"' | sed 's/.*"v\([^"]*\)".*/\1/') - msg_info "Installing Python Dependencies" - cd /opt/profilarr/backend - $STD uv venv --clear /opt/profilarr/backend/.venv - sed 's/==/>=/g' requirements.txt >requirements-relaxed.txt - $STD uv pip install --python /opt/profilarr/backend/.venv/bin/python -r requirements-relaxed.txt - rm -f requirements-relaxed.txt - msg_ok "Installed Python Dependencies" + msg_info "Building Profilarr v${PROFILARR_VERSION} (Patience)" + cd /opt/profilarr + ARCH=$(uname -m) + cat >src/lib/shared/build.ts <=/g' requirements.txt >requirements-relaxed.txt -$STD uv pip install --python /opt/profilarr/backend/.venv/bin/python -r requirements-relaxed.txt -rm -f requirements-relaxed.txt -msg_ok "Installed Python Dependencies" +msg_info "Building Profilarr v${PROFILARR_VERSION} (Patience)" +cd /opt/profilarr +cat >src/lib/shared/build.ts </etc/systemd/system/profilarr.service [Unit] -Description=Profilarr - Configuration Management Platform for Radarr/Sonarr +Description=Profilarr - Configuration Management for Radarr/Sonarr After=network.target [Service] Type=simple -User=root -WorkingDirectory=/opt/profilarr/backend -Environment="PATH=/opt/profilarr/backend/.venv/bin:/usr/local/bin:/usr/bin:/bin" -Environment="PYTHONPATH=/opt/profilarr/backend" -ExecStart=/opt/profilarr/backend/.venv/bin/gunicorn --bind 0.0.0.0:6868 --timeout 600 app.main:create_app() -Restart=on-failure +WorkingDirectory=/opt/profilarr/app +Environment="PORT=6868" +Environment="HOST=0.0.0.0" +Environment="APP_BASE_PATH=/var/lib/profilarr" +Environment="DENO_SQLITE_PATH=${SQLITE_PATH}" +ExecStart=/opt/profilarr/app/profilarr +Restart=always RestartSec=5 [Install]