mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-10 01:43:49 -04:00
simplify config, precreate symlinks
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Jellyfin - Docker mod for rffmpeg support with OPTIONAL Wake On LAN (WOL) Support
|
# rffmpeg - Docker mod for Jellyfin
|
||||||
|
|
||||||
This mod adds rffmpeg to Linuxserver.io's Jellyfin https://github.com/linuxserver/docker-jellyfin.
|
This mod adds rffmpeg to Linuxserver.io's Jellyfin https://github.com/linuxserver/docker-jellyfin.
|
||||||
|
|
||||||
@@ -17,9 +17,11 @@ You can specify the remote SSH username and host using ENV, note currently only
|
|||||||
* RFFMPEG_HOST= remote server name or IP
|
* RFFMPEG_HOST= remote server name or IP
|
||||||
|
|
||||||
You also need to ensure that /cache inside the container is exported on the host so it can be mapped on the remote host. Eg for docker compose.
|
You also need to ensure that /cache inside the container is exported on the host so it can be mapped on the remote host. Eg for docker compose.
|
||||||
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
- "Your jellyfin config dir":/config
|
- "Your jellyfin config dir":/config
|
||||||
- "Your jellyfin config dir"/cache:/cache
|
- "Your jellyfin config dir"/cache:/cache
|
||||||
|
```
|
||||||
See https://github.com/joshuaboniface/rffmpeg/blob/master/SETUP.md NFS setup for more details
|
See https://github.com/joshuaboniface/rffmpeg/blob/master/SETUP.md NFS setup for more details
|
||||||
|
|
||||||
EXAMPLE Docker-Compose file with WOL support via API:
|
EXAMPLE Docker-Compose file with WOL support via API:
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
# Configuration file for rffmpeg
|
||||||
|
#
|
||||||
|
# Copy this sample to /etc/rffmpeg/rffmpeg.yml and replace the various attributes
|
||||||
|
# with the values for your environment. For more details please see the README.
|
||||||
|
#
|
||||||
|
# Any commented value represents the default. Uncomment and alter as required.
|
||||||
|
|
||||||
|
rffmpeg:
|
||||||
|
# Logging configuration
|
||||||
|
logging:
|
||||||
|
# Enable or disable file logging.
|
||||||
|
#log_to_file: true
|
||||||
|
|
||||||
|
# Log messages to this file.
|
||||||
|
# Ensure the user running rffmpeg can write to this directory.
|
||||||
|
#logfile: "/var/log/jellyfin/rffmpeg.log"
|
||||||
|
|
||||||
|
# Show debugging messages
|
||||||
|
#debug: false
|
||||||
|
|
||||||
|
# Directory configuration
|
||||||
|
directories:
|
||||||
|
# Persistent directory to store state database.
|
||||||
|
#state: "/var/lib/rffmpeg"
|
||||||
|
|
||||||
|
# Temporary directory to store SSH persistence sockets.
|
||||||
|
#persist: "/run/shm"
|
||||||
|
|
||||||
|
# The user who should own the state directory and database.
|
||||||
|
# This should normally be the user who normally runs rffmpeg commands (i.e. the media
|
||||||
|
# server service user).
|
||||||
|
#owner: jellyfin
|
||||||
|
|
||||||
|
# The group who should own the state directory and database (an administrative group).
|
||||||
|
# Use this group to control who is able to run "rffmpeg" management commands; users in
|
||||||
|
# this group will have unlimited access to the tool to add/remove hosts, view status, etc.
|
||||||
|
#group: sudo
|
||||||
|
|
||||||
|
# Remote (SSH) configuration
|
||||||
|
remote:
|
||||||
|
# The remote SSH user to connect as.
|
||||||
|
#user: jellyfin
|
||||||
|
|
||||||
|
# How long to persist SSH sessions; 0 to disable SSH persistence.
|
||||||
|
#persist: 300
|
||||||
|
|
||||||
|
# A YAML list of additional SSH arguments (e.g. private keys).
|
||||||
|
# One entry line per space-separated argument element.
|
||||||
|
#args:
|
||||||
|
# - "-i"
|
||||||
|
# - "/var/lib/jellyfin/id_rsa"
|
||||||
|
|
||||||
|
# Remote command configuration
|
||||||
|
commands:
|
||||||
|
# The path (either full or in $PATH) to the default SSH binary.
|
||||||
|
#ssh: "/usr/bin/ssh"
|
||||||
|
|
||||||
|
# A YAML list of prefixes to the ffmpeg command (e.g. sudo, nice, etc.).
|
||||||
|
# One entry line per space-separated command element.
|
||||||
|
#pre:
|
||||||
|
# - ""
|
||||||
|
|
||||||
|
# The (remote) ffmpeg and ffprobe command binary paths.
|
||||||
|
#ffmpeg: "/usr/lib/jellyfin-ffmpeg/ffmpeg"
|
||||||
|
#ffprobe: "/usr/lib/jellyfin-ffmpeg/ffprobe"
|
||||||
|
|
||||||
|
# Optional local fallback ffmpeg and ffprobe binary paths, if different from the above.
|
||||||
|
#fallback_ffmpeg: "/usr/lib/jellyfin-ffmpeg/ffmpeg"
|
||||||
|
#fallback_ffprobe: "/usr/lib/jellyfin-ffmpeg/ffprobe"
|
||||||
@@ -1,54 +1,32 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
#Install dependancies
|
#Install dependancies
|
||||||
apt install -y python3-click python3-yaml openssh-client
|
apt-get install -y --no-install-recommends \
|
||||||
|
iputils-ping \
|
||||||
|
openssh-client \
|
||||||
|
python3-click \
|
||||||
|
python3-yaml \
|
||||||
|
wakeonlan
|
||||||
|
|
||||||
#Grab Config
|
#Grab Config
|
||||||
mkdir -p /etc/rffmpeg
|
mkdir -p \
|
||||||
mkdir -p /config/rffmpeg/.ssh
|
/etc/rffmpeg \
|
||||||
|
/config/rffmpeg/.ssh
|
||||||
touch /config/rffmpeg/.ssh/id_rsa
|
touch /config/rffmpeg/.ssh/id_rsa
|
||||||
chmod 600 /config/rffmpeg/.ssh/id_rsa
|
chmod 600 /config/rffmpeg/.ssh/id_rsa
|
||||||
if [ -f /config/rffmpeg/rffmpeg.yml ]; then
|
if [ -f /config/rffmpeg/rffmpeg.yml ]; then
|
||||||
echo "**** rffmpeg.yml already present ****"
|
echo "**** rffmpeg.yml already present ****"
|
||||||
else
|
else
|
||||||
echo "**** Grabbing rffmpeg.yml from upstream ****"
|
echo "**** Creating rffmpeg.yml from sample ****"
|
||||||
curl -L -o /config/rffmpeg/rffmpeg.yml https://raw.githubusercontent.com/joshuaboniface/rffmpeg/master/rffmpeg.yml.sample
|
cp /defaults/rffmpeg.yml.sample /config/rffmpeg/rffmpeg.yml
|
||||||
fi
|
fi
|
||||||
ln -s /config/rffmpeg/rffmpeg.yml /etc/rffmpeg/rffmpeg.yml
|
|
||||||
|
|
||||||
#Grab rffmpeg
|
#Grab rffmpeg
|
||||||
mkdir -p /usr/local/bin/
|
mkdir -p /usr/local/bin/
|
||||||
echo "**** Grabbing rffmpeg from upstream ****"
|
echo "**** Grabbing rffmpeg from upstream ****"
|
||||||
if [ -f /usr/local/bin/rffmpeg ]; then
|
rm -rf /usr/local/bin/rffmpeg
|
||||||
rm /usr/local/bin/rffmpeg
|
|
||||||
fi
|
|
||||||
curl -L -o /usr/local/bin/rffmpeg https://raw.githubusercontent.com/joshuaboniface/rffmpeg/master/rffmpeg
|
curl -L -o /usr/local/bin/rffmpeg https://raw.githubusercontent.com/joshuaboniface/rffmpeg/master/rffmpeg
|
||||||
chmod +x /usr/local/bin/rffmpeg
|
chmod +x /usr/local/bin/rffmpeg
|
||||||
ln -s /usr/local/bin/rffmpeg /usr/local/bin/ffprobe
|
|
||||||
ln -s /usr/local/bin/rffmpeg /usr/local/bin/ffmpeg
|
|
||||||
|
|
||||||
#WOL Support
|
|
||||||
if [ $RFFMPEG_WOL = "native" ] && [ ! -f /usr/local/bin/wol_rffmpeg/wol ]
|
|
||||||
then
|
|
||||||
echo "**** Adding WOL Support ****"
|
|
||||||
apt install -y wakeonlan iputils-ping
|
|
||||||
mkdir -p /usr/local/bin/wol_rffmpeg
|
|
||||||
curl -L -o /usr/local/bin/wol_rffmpeg/wol https://raw.githubusercontent.com/junkman690/docker-mods/jellyfin-rffmpeg/wol
|
|
||||||
chmod +x /usr/local/bin/wol_rffmpeg/wol
|
|
||||||
ln -s /usr/local/bin/wol_rffmpeg/wol /usr/local/bin/wol_rffmpeg/ffmpeg
|
|
||||||
ln -s /usr/local/bin/wol_rffmpeg/wol /usr/local/bin/wol_rffmpeg/ffprobe
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $RFFMPEG_WOL = "api" ] && [ ! -f /usr/local/bin/wol_rffmpeg/wol ]
|
|
||||||
then
|
|
||||||
echo "**** Adding WOL Support ****"
|
|
||||||
apt install -y iputils-ping
|
|
||||||
mkdir -p /usr/local/bin/wol_rffmpeg
|
|
||||||
curl -L -o /usr/local/bin/wol_rffmpeg/wol https://raw.githubusercontent.com/junkman690/docker-mods/jellyfin-rffmpeg/wol
|
|
||||||
chmod +x /usr/local/bin/wol_rffmpeg/wol
|
|
||||||
ln -s /usr/local/bin/wol_rffmpeg/wol /usr/local/bin/wol_rffmpeg/ffmpeg
|
|
||||||
ln -s /usr/local/bin/wol_rffmpeg/wol /usr/local/bin/wol_rffmpeg/ffprobe
|
|
||||||
fi
|
|
||||||
|
|
||||||
##Update rffmpeg.yml
|
##Update rffmpeg.yml
|
||||||
sed -i 's~#persist: "/run/shm"~persist: "/dev/shm"~' /config/rffmpeg/rffmpeg.yml
|
sed -i 's~#persist: "/run/shm"~persist: "/dev/shm"~' /config/rffmpeg/rffmpeg.yml
|
||||||
@@ -60,9 +38,8 @@ sed -i 's~#group: sudo~group: abc~' /config/rffmpeg/rffmpeg.yml
|
|||||||
sed -i 's~#args:~args:~' /config/rffmpeg/rffmpeg.yml
|
sed -i 's~#args:~args:~' /config/rffmpeg/rffmpeg.yml
|
||||||
sed -i 's~# - "-i"~ - "-i"~' /config/rffmpeg/rffmpeg.yml
|
sed -i 's~# - "-i"~ - "-i"~' /config/rffmpeg/rffmpeg.yml
|
||||||
sed -i 's~# - "/var/lib/jellyfin/id_rsa"~ - "/config/rffmpeg/.ssh/id_rsa"~' /config/rffmpeg/rffmpeg.yml
|
sed -i 's~# - "/var/lib/jellyfin/id_rsa"~ - "/config/rffmpeg/.ssh/id_rsa"~' /config/rffmpeg/rffmpeg.yml
|
||||||
if [ ! -z "$RFFMPEG_USER" ]
|
if [ ! -z "$RFFMPEG_USER" ]; then
|
||||||
then
|
sed -i "s~#user: jellyfin~user: $RFFMPEG_USER~" /config/rffmpeg/rffmpeg.yml
|
||||||
sed -i "s~#user: jellyfin~user: $RFFMPEG_USER~" /config/rffmpeg/rffmpeg.yml
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Fix permissions
|
#Fix permissions
|
||||||
@@ -75,12 +52,7 @@ else
|
|||||||
echo "**** Initialize database ****"
|
echo "**** Initialize database ****"
|
||||||
/usr/local/bin/rffmpeg init --yes
|
/usr/local/bin/rffmpeg init --yes
|
||||||
#Add host
|
#Add host
|
||||||
if [ ! -z "$RFFMPEG_HOST" ]
|
if [ ! -z "$RFFMPEG_HOST" ]; then
|
||||||
then
|
|
||||||
s6-setuidgid abc /usr/local/bin/rffmpeg add --weight 1 $RFFMPEG_HOST
|
s6-setuidgid abc /usr/local/bin/rffmpeg add --weight 1 $RFFMPEG_HOST
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
/config/rffmpeg/rffmpeg.yml
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
rffmpeg
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
rffmpeg
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
wol
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
wol
|
||||||
Regular → Executable
Reference in New Issue
Block a user