Compare commits

..
Author SHA1 Message Date
MickLesk 4371f9f6f8 cross-seed: reinstall when a Node.js upgrade broke better-sqlite3
The update moved Node from 24 to 26 and then ran cross-seed --version to
read the installed version, which failed on better-sqlite3 built for the
old ABI. The version now comes from package.json, and a cross-seed that no
longer starts is reinstalled at the same version.
2026-12-01 13:15:07 +01:00
3 changed files with 10 additions and 77 deletions

No files matched your search

+6 -1
View File
@@ -30,13 +30,18 @@ function update_script() {
ensure_dependencies build-essential
if command -v cross-seed &>/dev/null; then
current_version=$(cross-seed --version)
current_version=$(node -p "require('$(npm root -g)/cross-seed/package.json').version")
latest_version=$(npm show cross-seed version)
if [ "$current_version" != "$latest_version" ]; then
msg_info "Updating cross-seed from version v${current_version} to v${latest_version}"
$STD npm install -g cross-seed@latest
systemctl restart cross-seed
msg_ok "Updated successfully!"
elif ! cross-seed --version &>/dev/null; then
msg_info "Reinstalling cross-seed v${current_version} for Node.js $(node -v)"
$STD npm install -g "cross-seed@${current_version}"
systemctl restart cross-seed
msg_ok "Reinstalled cross-seed"
else
msg_ok "cross-seed is already at v${current_version}"
fi
+1 -45
View File
@@ -117,52 +117,9 @@ EOF
msg_ok "Compiled and Installed Comskip"
fi
if ! grep -qs -- "-Q celery,plugins" /opt/dispatcharr/start-celery.sh; then
msg_info "Migrating Celery Workers"
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
EOF
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
EOF
chmod +x /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
[Unit]
Description=Dispatcharr Celery DVR Worker
After=network.target redis-server.service
Requires=dispatcharr.service
[Service]
Type=simple
WorkingDirectory=/opt/dispatcharr
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
Restart=on-failure
RestartSec=10
User=root
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable -q --now dispatcharr-celery-dvr
systemctl restart dispatcharr-celery
msg_ok "Migrated Celery Workers"
fi
if check_for_gh_release "Dispatcharr" "Dispatcharr/Dispatcharr"; then
msg_info "Stopping Services"
systemctl stop dispatcharr-celery
systemctl stop dispatcharr-celery-dvr
systemctl stop dispatcharr-celerybeat
systemctl stop dispatcharr-daphne
systemctl stop dispatcharr
@@ -173,7 +130,7 @@ EOF
if [[ -f /opt/dispatcharr/start-gunicorn.sh ]]; then
rm -f /opt/dispatcharr/start-gunicorn.sh
fi
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
if [[ -f /opt/dispatcharr/.env ]]; then
set -o allexport
source /opt/dispatcharr/.env
@@ -256,7 +213,6 @@ EOF
msg_info "Starting Services"
systemctl start dispatcharr
systemctl start dispatcharr-celery
systemctl start dispatcharr-celery-dvr
systemctl start dispatcharr-celerybeat
systemctl start dispatcharr-daphne
msg_ok "Started Services"
+3 -31
View File
@@ -185,26 +185,16 @@ exec .venv/bin/uwsgi \\
EOF
chmod +x /opt/dispatcharr/start-uwsgi.sh
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
cat <<EOF >/opt/dispatcharr/start-celery.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
exec uv run celery -A dispatcharr worker -l info -c 4 -Q celery,recordings,dvr,default
EOF
chmod +x /opt/dispatcharr/start-celery.sh
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
EOF
chmod +x /opt/dispatcharr/start-celery-dvr.sh
cat <<EOF >/opt/dispatcharr/start-celerybeat.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
@@ -260,24 +250,6 @@ User=root
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
[Unit]
Description=Dispatcharr Celery DVR Worker
After=network.target redis-server.service
Requires=dispatcharr.service
[Service]
Type=simple
WorkingDirectory=/opt/dispatcharr
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
Restart=on-failure
RestartSec=10
User=root
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/dispatcharr-celerybeat.service
[Unit]
Description=Dispatcharr Celery Beat Scheduler
@@ -313,7 +285,7 @@ User=root
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celery-dvr dispatcharr-celerybeat dispatcharr-daphne
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celerybeat dispatcharr-daphne
msg_ok "Created Services"
motd_ssh