Files
ProxmoxVE/install/wizarr-install.sh
T

86 lines
1.8 KiB
Bash
Raw Normal View History

2025-06-19 09:49:27 +02:00
#!/usr/bin/env bash
# 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
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
2025-10-07 21:40:31 +02:00
$STD apt install -y sqlite3
2025-06-19 09:49:27 +02:00
msg_ok "Installed Dependencies"
NODE_VERSION="22" setup_nodejs
2026-01-19 16:33:08 +01:00
2025-12-09 16:02:38 +01:00
fetch_and_deploy_gh_release "wizarr" "wizarrrr/wizarr" "tarball"
UV_PROJECT_DIR="/opt/wizarr" setup_uv
2025-06-19 09:49:27 +02:00
2025-10-07 21:40:31 +02:00
msg_info "Configure Wizarr"
2025-12-09 16:02:38 +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
2025-06-19 09:49:27 +02:00
mkdir -p ./.cache
cat <<EOF >/opt/wizarr/.env
FLASK_ENV=production
GUNICORN_WORKERS=4
2025-06-19 09:49:27 +02:00
APP_URL=http://${LOCAL_IP}
HOST=0.0.0.0
PORT=5690
2025-06-19 09:49:27 +02:00
DISABLE_BUILTIN_AUTH=false
LOG_LEVEL=INFO
APP_VERSION=$(get_latest_github_release "wizarrrr/wizarr")
2025-06-19 09:49:27 +02:00
EOF
cat <<EOF >/opt/wizarr/start.sh
#!/usr/bin/env bash
2025-09-10 10:21:52 -04:00
uv run --frozen gunicorn \
2025-06-19 09:49:27 +02:00
--config gunicorn.conf.py \
--preload \
--umask 007 \
run:app
EOF
chmod u+x /opt/wizarr/start.sh
2025-10-07 21:40:31 +02:00
msg_ok "Configure Wizarr"
2025-06-19 09:49:27 +02:00
2025-10-07 21:40:31 +02:00
msg_info "Creating Service"
2025-06-19 09:49:27 +02:00
cat <<EOF >/etc/systemd/system/wizarr.service
[Unit]
2025-10-07 21:40:31 +02:00
Description=Wizarr Service
2025-06-19 09:49:27 +02:00
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/wizarr
EnvironmentFile=/opt/wizarr/.env
ExecStart=/opt/wizarr/start.sh
Restart=always
RestartSec=10
KillMode=mixed
TimeoutStopSec=10
2025-06-19 09:49:27 +02:00
[Install]
WantedBy=multi-user.target
EOF
2025-10-07 21:40:31 +02:00
msg_ok "Created Service"
2025-06-19 09:49:27 +02:00
msg_info "Running DB upgrade"
export FLASK_SKIP_SCHEDULER=true
$STD /usr/local/bin/uv run --frozen flask db upgrade
msg_ok "DB upgrade complete"
systemctl enable -q --now wizarr
2025-06-19 09:49:27 +02:00
motd_ssh
customize
cleanup_lxc