2023-03-22 20:48:20 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 tteck
|
2023-03-22 20:48:20 -04:00
|
|
|
# Author: tteck (tteckster)
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://home.tdarr.io/
|
2023-03-22 20:48:20 -04:00
|
|
|
|
2025-03-24 14:20:56 +01:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2023-03-22 20:48:20 -04:00
|
|
|
color
|
|
|
|
|
verb_ip6
|
|
|
|
|
catch_errors
|
|
|
|
|
setting_up_container
|
|
|
|
|
network_check
|
|
|
|
|
update_os
|
|
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
2025-10-09 19:43:23 +02:00
|
|
|
$STD apt install -y handbrake-cli
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
|
2025-08-19 21:55:42 +02:00
|
|
|
msg_info "Installing Tdarr"
|
|
|
|
|
mkdir -p /opt/tdarr
|
|
|
|
|
cd /opt/tdarr
|
|
|
|
|
RELEASE=$(curl -fsSL https://f000.backblazeb2.com/file/tdarrs/versions.json | grep -oP '(?<="Tdarr_Updater": ")[^"]+' | grep linux_x64 | head -n 1)
|
|
|
|
|
curl -fsSL "$RELEASE" -o Tdarr_Updater.zip
|
|
|
|
|
$STD unzip Tdarr_Updater.zip
|
|
|
|
|
chmod +x Tdarr_Updater
|
|
|
|
|
$STD ./Tdarr_Updater
|
2025-11-22 17:27:13 +01:00
|
|
|
rm -rf /opt/tdarr/Tdarr_Updater.zip
|
2025-08-19 21:55:42 +02:00
|
|
|
msg_ok "Installed Tdarr"
|
|
|
|
|
|
use setup_hwaccel for robust hardware acceleration (#10054)
* fix(jellyfin): use setup_hwaccel for robust hardware acceleration
Replaces manual hardware acceleration setup with the centralized
setup_hwaccel function from tools.func.
This fixes the installation failure in privileged containers where
/dev/dri does not exist (e.g., when no GPU is passed through).
The setup_hwaccel function includes:
- Proper error handling for missing /dev/dri
- GPU vendor detection (Intel, AMD, NVIDIA)
- Graceful fallback when no GPU is available
Fixes: Installation fails with 'chgrp: cannot access /dev/dri'
when creating privileged containers without GPU passthrough.
* refactor(hwaccel): standardize hardware acceleration across all install scripts
Migrated all install scripts to use the centralized setup_hwaccel function:
- plex-install.sh
- emby-install.sh
- ersatztv-install.sh
- frigate-install.sh
- tdarr-install.sh
- unmanic-install.sh
- channels-install.sh
- ollama-install.sh
- immich-install.sh (added error handling)
Enhanced setup_hwaccel function in tools.func:
- Added -d /dev/dri check before setting permissions
- Added error handling (2>/dev/null || true) for all /dev/dri operations
- Added adduser error handling for video/render groups
- No longer fails if no GPU is detected (graceful skip)
- Added intel-media-va-driver for newer Intel GPUs
- Improved AMD APU support with firmware packages
- Better NVIDIA handling (warning instead of failure)
This fixes installation failures in privileged containers without GPU
passthrough, where /dev/dri does not exist.
Supports: Ubuntu, Debian 12 (Bookworm), Debian 13 (Trixie)
GPU Support: Intel, AMD, NVIDIA (manual driver)
* refactor(hwaccel): complete migration for all GPU apps
Migrated remaining GPU apps to setup_hwaccel:
- fileflows-install.sh
- openwebui-install.sh (added setup_hwaccel - was missing)
- tunarr-install.sh
Also fixed tools/pve/hw-acceleration.sh:
- Added error handling for /dev/dri operations
- Added chmod 660 /dev/dri/* that was missing
- Added error suppression for adduser commands
All 13 GPU apps (var_gpu=yes) now use centralized setup_hwaccel:
jellyfin, plex, emby, ersatztv, frigate, tdarr, unmanic,
channels, ollama, immich, fileflows, openwebui, tunarr
* feat(hwaccel): complete Intel non-free driver support and GID sync
Enhanced setup_hwaccel function:
- Auto-detect Intel GPU generation (Gen 9+ for non-free drivers)
- Debian 12 (Bookworm): Add non-free repo + intel-media-va-driver-non-free
- Debian 13 (Trixie): Add non-free repo + libvpl2 + mesa-opencl-icd
- Ubuntu: Use ubuntu repos with intel-media-va-driver
- Fallback to open drivers if non-free fails
- GID sync for video/render groups (moved from install scripts)
OpenWebUI: Added Intel oneAPI support when installing Ollama
- Intel Level Zero GPU support
- Intel oneAPI Base Toolkit
- Same setup as standalone Ollama install
Cleanup:
- Removed duplicate GID sync from tdarr-install.sh
- Removed duplicate GID sync from unmanic-install.sh
* fix(ersatztv): remove duplicate HW acceleration code
Removed manual Intel HW acceleration setup that remained after
setup_hwaccel migration. The non-free driver prompt is no longer
needed as setup_hwaccel auto-detects Intel GPU generation.
2025-12-17 14:37:31 +01:00
|
|
|
setup_hwaccel
|
2024-04-30 05:48:46 -04:00
|
|
|
|
2025-10-09 19:43:23 +02:00
|
|
|
msg_info "Creating Service"
|
2025-08-19 21:55:42 +02:00
|
|
|
cat <<EOF >/etc/systemd/system/tdarr-server.service
|
|
|
|
|
[Unit]
|
2023-03-22 20:48:20 -04:00
|
|
|
Description=Tdarr Server Daemon
|
|
|
|
|
After=network.target
|
|
|
|
|
# Enable if using ZFS, edit and enable if other FS mounting is required to access directory
|
|
|
|
|
#Requires=zfs-mount.service
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
User=root
|
|
|
|
|
Group=root
|
|
|
|
|
Type=simple
|
|
|
|
|
WorkingDirectory=/opt/tdarr/Tdarr_Server
|
2025-08-19 21:55:42 +02:00
|
|
|
ExecStartPre=/opt/tdarr/Tdarr_Updater
|
2023-03-22 20:48:20 -04:00
|
|
|
ExecStart=/opt/tdarr/Tdarr_Server/Tdarr_Server
|
|
|
|
|
TimeoutStopSec=20
|
|
|
|
|
KillMode=process
|
|
|
|
|
Restart=on-failure
|
|
|
|
|
|
|
|
|
|
[Install]
|
2025-08-19 21:55:42 +02:00
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
EOF
|
2023-03-22 20:48:20 -04:00
|
|
|
|
2025-08-19 21:55:42 +02:00
|
|
|
cat <<EOF >/etc/systemd/system/tdarr-node.service
|
|
|
|
|
[Unit]
|
2023-03-22 20:48:20 -04:00
|
|
|
Description=Tdarr Node Daemon
|
|
|
|
|
After=network.target
|
|
|
|
|
Requires=tdarr-server.service
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
User=root
|
|
|
|
|
Group=root
|
|
|
|
|
Type=simple
|
|
|
|
|
WorkingDirectory=/opt/tdarr/Tdarr_Node
|
|
|
|
|
ExecStart=/opt/tdarr/Tdarr_Node/Tdarr_Node
|
|
|
|
|
TimeoutStopSec=20
|
|
|
|
|
KillMode=process
|
|
|
|
|
Restart=on-failure
|
|
|
|
|
|
|
|
|
|
[Install]
|
2025-08-19 21:55:42 +02:00
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
EOF
|
|
|
|
|
systemctl enable --now -q tdarr-server tdarr-node
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 07:39:30 -04:00
|
|
|
customize
|
2025-11-22 17:27:13 +01:00
|
|
|
cleanup_lxc
|