mirror of
https://github.com/linuxserver/docker-jellyfin.git
synced 2025-10-26 18:53:39 +09:00
initial loop tested version
This commit is contained in:
18
root/etc/cont-init.d/30-config
Normal file
18
root/etc/cont-init.d/30-config
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# create directories
|
||||
mkdir -p \
|
||||
/config/{log,data,cache} \
|
||||
/data \
|
||||
/transcode
|
||||
|
||||
# permissions
|
||||
chown abc:abc \
|
||||
/config \
|
||||
/config/* \
|
||||
/data \
|
||||
/transcode
|
||||
if [ -n "$(ls -A /data 2>/dev/null)" ]; then
|
||||
chown abc:abc \
|
||||
/data/*
|
||||
fi
|
||||
25
root/etc/cont-init.d/40-gid-video
Normal file
25
root/etc/cont-init.d/40-gid-video
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# Check for the existence of the Intel video device
|
||||
if [ -e /dev/dri ]; then
|
||||
VIDEO_GID=$(stat -c '%g' /dev/dri/* | grep -v '^0$' | head -n 1)
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if this GID matches the current abc user
|
||||
ABCGID=$(getent group abc | awk -F: '{print $3}')
|
||||
if [ "${ABCGID}" == "${VIDEO_GID}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if the GID is taken and swap to 65533
|
||||
CURRENT=$(getent group ${VIDEO_GID} | awk -F: '{print $1}')
|
||||
if [ -z "${CURRENT}" ] || [ "${CURRENT}" == 'video' ]; then
|
||||
groupmod -g ${VIDEO_GID} video
|
||||
usermod -a -G video abc
|
||||
else
|
||||
groupmod -g 65533 ${CURRENT}
|
||||
groupmod -g ${VIDEO_GID} video
|
||||
usermod -a -G video abc
|
||||
fi
|
||||
10
root/etc/services.d/jellyfin/run
Normal file
10
root/etc/services.d/jellyfin/run
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/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"
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc /usr/bin/jellyfin \
|
||||
--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
|
||||
Reference in New Issue
Block a user