mirror of
https://github.com/linuxserver/docker-jellyfin.git
synced 2025-10-26 18:53:39 +09:00
pin dep versions, log message about device perms
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
|
||||
# create directories
|
||||
mkdir -p \
|
||||
/config/{log,data/transcodes,cache} \
|
||||
/data \
|
||||
/transcode
|
||||
/config/{log,data/transcodes,cache} \
|
||||
/data \
|
||||
/transcode
|
||||
|
||||
# permissions
|
||||
chown abc:abc \
|
||||
/config \
|
||||
/config/* \
|
||||
/data \
|
||||
/config/data/transcodes \
|
||||
/transcode
|
||||
/config \
|
||||
/config/* \
|
||||
/data \
|
||||
/config/data/transcodes \
|
||||
/transcode
|
||||
if [ -n "$(ls -A /data 2>/dev/null)" ]; then
|
||||
chown abc:abc \
|
||||
/data/*
|
||||
/data/*
|
||||
fi
|
||||
|
||||
@@ -4,21 +4,24 @@ FILES=$(find /dev/dri /dev/dvb /dev/vchiq /dev/vc-mem /dev/video1? -type c -prin
|
||||
|
||||
for i in $FILES
|
||||
do
|
||||
VIDEO_GID=$(stat -c '%g' "$i")
|
||||
if ! id -G abc | grep -qw "$VIDEO_GID"; then
|
||||
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
|
||||
if [ -z "${VIDEO_NAME}" ]; then
|
||||
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
|
||||
groupadd "$VIDEO_NAME"
|
||||
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
|
||||
fi
|
||||
usermod -a -G "$VIDEO_NAME" abc
|
||||
fi
|
||||
VIDEO_GID=$(stat -c '%g' "$i")
|
||||
if ! id -G abc | grep -qw "$VIDEO_GID"; then
|
||||
VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}')
|
||||
if [ -z "${VIDEO_NAME}" ]; then
|
||||
VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)"
|
||||
groupadd "$VIDEO_NAME"
|
||||
groupmod -g "$VIDEO_GID" "$VIDEO_NAME"
|
||||
fi
|
||||
usermod -a -G "$VIDEO_NAME" abc
|
||||
if [ $(stat -c '%A' "${i}" | cut -b 8,9) != "rw" ]; then
|
||||
echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# openmax lib loading
|
||||
if [ -e "/opt/vc/lib" ] && [ ! -e "/etc/ld.so.conf.d/00-vmcs.conf" ]; then
|
||||
echo "[jellyfin-init] Pi Libs detected loading"
|
||||
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
|
||||
ldconfig
|
||||
echo "[jellyfin-init] Pi Libs detected loading"
|
||||
echo "/opt/vc/lib" > "/etc/ld.so.conf.d/00-vmcs.conf"
|
||||
ldconfig
|
||||
fi
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
export JELLYFIN_DATA_DIR="/config/data" \
|
||||
JELLYFIN_CONFIG_DIR="/config" \
|
||||
JELLYFIN_LOG_DIR="/config/log" \
|
||||
JELLYFIN_CACHE_DIR="/config/cache"
|
||||
export \
|
||||
JELLYFIN_DATA_DIR="/config/data" \
|
||||
JELLYFIN_CONFIG_DIR="/config" \
|
||||
JELLYFIN_LOG_DIR="/config/log" \
|
||||
JELLYFIN_CACHE_DIR="/config/cache"
|
||||
|
||||
if [ -n "${UMASK_SET}" ] && [ -z "${UMASK}" ]; then
|
||||
echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021"
|
||||
umask ${UMASK_SET}
|
||||
echo -e "You are using a legacy method of defining umask\nplease update your environment variable from UMASK_SET to UMASK\nto keep the functionality after July 2021"
|
||||
umask ${UMASK_SET}
|
||||
fi
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc /usr/bin/jellyfin \
|
||||
--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg \
|
||||
--webdir=/usr/share/jellyfin/web
|
||||
s6-setuidgid abc /usr/bin/jellyfin \
|
||||
--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg \
|
||||
--webdir=/usr/share/jellyfin/web
|
||||
|
||||
Reference in New Issue
Block a user