Files
ProxmoxVE/ct/wizarr.sh
T

89 lines
2.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2025-06-19 09:49:27 +02:00
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2026 community-scripts ORG
2025-06-19 09:49:27 +02:00
# Author: vhsdream
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/wizarrrr/wizarr
APP="Wizarr"
var_tags="${var_tags:-media;arr}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
2025-10-07 21:40:31 +02:00
var_version="${var_version:-13}"
2026-06-12 00:16:15 +10:00
var_arm64="${var_arm64:-yes}"
2025-06-19 09:49:27 +02:00
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/wizarr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
setup_uv
if check_for_gh_release "wizarr" "wizarrrr/wizarr"; then
2025-10-07 21:40:31 +02:00
msg_info "Stopping Service"
2025-06-19 09:49:27 +02:00
systemctl stop wizarr
2025-10-07 21:40:31 +02:00
msg_ok "Stopped Service"
2025-06-19 09:49:27 +02:00
msg_info "Creating Backup"
BACKUP_FILE="/opt/wizarr_backup_$(date +%F).tar.gz"
$STD tar -czf "$BACKUP_FILE" /opt/wizarr/{.env,start.sh} /opt/wizarr/database/ &>/dev/null
2025-09-10 10:21:52 -04:00
rm -rf /opt/wizarr/migrations/versions/*
2025-06-19 09:49:27 +02:00
msg_ok "Backup Created"
2026-01-07 08:49:12 +01:00
fetch_and_deploy_gh_release "wizarr" "wizarrrr/wizarr" "tarball"
2025-06-19 09:49:27 +02:00
2025-10-07 21:40:31 +02:00
msg_info "Updating Wizarr"
2026-01-06 13:45:03 +01:00
cd /opt/wizarr
2025-09-10 10:21:52 -04:00
$STD /usr/local/bin/uv sync --frozen
$STD /usr/local/bin/uv run --frozen pybabel compile -d app/translations
2025-06-19 09:49:27 +02:00
$STD npm --prefix app/static install
$STD npm --prefix app/static run build:css
mkdir -p ./.cache
$STD tar -xf "$BACKUP_FILE" --directory=/
if grep -q 'workers' /opt/wizarr/start.sh; then
sed -i 's/--workers 4//' /opt/wizarr/start.sh
fi
if ! grep -qE 'FLASK|WORKERS|VERSION' /opt/wizarr/.env; then
{
echo "FLASK_ENV=production"
echo "GUNICORN_WORKERS=4"
echo "APP_VERSION=$(sed 's/^20/v&/' ~/.wizarr)"
} >>/opt/wizarr/.env
else
sed -i "s/_VERSION=v.*$/_VERSION=v$(cat ~/.wizarr)/" /opt/wizarr/.env
2025-09-10 10:21:52 -04:00
fi
rm -rf "$BACKUP_FILE"
export FLASK_SKIP_SCHEDULER=true
$STD /usr/local/bin/uv run --frozen flask db upgrade
2025-10-07 21:40:31 +02:00
msg_ok "Updated Wizarr"
2025-06-19 09:49:27 +02:00
2025-10-07 21:40:31 +02:00
msg_info "Starting Service"
2025-06-19 09:49:27 +02:00
systemctl start wizarr
2025-10-07 21:40:31 +02:00
msg_ok "Started Service"
msg_ok "Updated successfully!"
2025-06-19 09:49:27 +02:00
fi
exit
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
2025-06-19 09:49:27 +02:00
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}:5690${CL}"