ProxmoxVED/install/fileflows-install.sh
2025-03-12 13:37:50 -04:00

95 lines
2.6 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: kkroboth
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://fileflows.com/
# Import Functions und Setup
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
# Installing Dependencies with the 3 core dependencies (curl;sudo;mc)
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
jq # Used for updating checking from json response
msg_ok "Installed Dependencies"
msg_info "Installing FFmpeg (Patience)"
wget -q https://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb
$STD dpkg -i deb-multimedia-keyring_2016.8.1_all.deb
cat <<EOF >/etc/apt/sources.list.d/backports.list
deb https://www.deb-multimedia.org bookworm main non-free
deb https://www.deb-multimedia.org bookworm-backports main
EOF
$STD apt update
DEBIAN_FRONTEND=noninteractive $STD apt-get install -t bookworm-backports ffmpeg -y
rm -rf /etc/apt/sources.list.d/backports.list deb-multimedia-keyring_2016.8.1_all.deb
$STD apt update
msg_ok "Installed FFmpeg"
msg_info "Setting Up Hardware Acceleration"
$STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
if [[ "$CTTYPE" == "0" ]]; then
chgrp video /dev/dri
chmod 755 /dev/dri
chmod 660 /dev/dri/*
$STD adduser $(id -u -n) video
$STD adduser $(id -u -n) render
fi
msg_ok "Set Up Hardware Acceleration"
msg_info "Installing ASP.NET Core Runtime"
wget -q https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$STD dpkg -i packages-microsoft-prod.deb
rm -rf packages-microsoft-prod.deb
$STD apt-get update
$STD apt-get install -y aspnetcore-runtime-8.0
msg_ok "Installed ASP.NET Core Runtime"
# Setup App
msg_info "Setup ${APPLICATION}"
temp_file=$(mktemp)
wget -q https://fileflows.com/downloads/zip -O $temp_file
unzip -q -d /opt/fileflows $temp_file
chmod +x /opt/fileflows/fileflows-systemd-entrypoint.sh
msg_ok "Setup ${APPLICATION}"
# Creating Service
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/fileflows.service
[Unit]
Description=${APPLICATION} Service
After=network.target
[Service]
WorkingDirectory=/opt/fileflows
ExecStart=/opt/fileflows/fileflows-systemd-entrypoint.sh
SyslogIdentifier=FileFlows
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now fileflows.service
msg_ok "Created Service"
motd_ssh
customize
# Cleanup
msg_info "Cleaning up"
rm -f $temp_file
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"