From acf970cd099dea27a5f0ccb7704091d46a9ed938 Mon Sep 17 00:00:00 2001 From: kilhaasi Date: Tue, 27 Nov 2018 12:39:19 +0100 Subject: [PATCH] Update --- Dockerfile | 4 ++-- docker-compose.yml | 9 ++++++++- root/etc/fuse.conf | 9 +++++++++ root/etc/services.d/gocryptfs/run | 11 +++++------ root/etc/services.d/plexdrive/run | 15 +++++++-------- 5 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 root/etc/fuse.conf diff --git a/Dockerfile b/Dockerfile index 748e831..dbd7097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM linuxserver/plex -COPY root / +FROM plexinc/pms-docker RUN apt update && apt install -y cron unionfs-fuse +COPY root / ENTRYPOINT ["/init"] diff --git a/docker-compose.yml b/docker-compose.yml index ff8915c..3b0dffc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: plex: - build: ./ +# build: ./ image: kilhaasi/pms container_name: pms volumes: @@ -19,3 +19,10 @@ services: - PLEX_CLAIM=claim-z3PqezuUozjYLvv7LakC ports: - 32400:32400 + devices: + - /dev/fuse + privileged: true + cap_add: + - MKNOD + - SYS_ADMIN + diff --git a/root/etc/fuse.conf b/root/etc/fuse.conf new file mode 100644 index 0000000..5f628f7 --- /dev/null +++ b/root/etc/fuse.conf @@ -0,0 +1,9 @@ +# /etc/fuse.conf - Configuration file for Filesystem in Userspace (FUSE) + +# Set the maximum number of FUSE mounts allowed to non-root users. +# The default is 1000. +#mount_max = 1000 + +# Allow non-root users to specify the allow_other or allow_root mount options. +user_allow_other + diff --git a/root/etc/services.d/gocryptfs/run b/root/etc/services.d/gocryptfs/run index 1b75b10..9f53604 100644 --- a/root/etc/services.d/gocryptfs/run +++ b/root/etc/services.d/gocryptfs/run @@ -1,16 +1,15 @@ #!/usr/bin/with-contenv bash -while [ ! -f "/mnt/G-Cache/Video/gocryptfs.conf" ] +while [ ! -f "/encrypted/Video/gocryptfs.conf" ] do echo "Waiting for gocryptfs.conf to appear..." sleep 1 done -mkdir -pv /mnt/Video /crypt/output /crypt/input /Video +mkdir -pv /Video +chmod 777 /Video + +s6-setuidgid plex gocryptfs -passfile /config/enc-pwd /encrypted/Video/ /Video -gocryptfs -passfile /root/enc-pwd /mnt/G-Cache/Video/ /mnt/Video -cp /mnt/G-Cache/Video/gocryptfs.conf /crypt/output -gocryptfs -passfile /root/enc-pwd /crypt/output /crypt/input -unionfs -o cow /crypt/input=RW:/mnt/Video=RO /Video until false do diff --git a/root/etc/services.d/plexdrive/run b/root/etc/services.d/plexdrive/run index 88caf98..a80c113 100755 --- a/root/etc/services.d/plexdrive/run +++ b/root/etc/services.d/plexdrive/run @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash -while [ ! -f "/root/.plexdrive/config.json" ] || [ ! -f "/root/.plexdrive/token.json" ] +while [ ! -f "/config/config.json" ] || [ ! -f "/config/token.json" ] do echo "Waiting for plexdrive configuration files ..." sleep 30 @@ -10,11 +10,10 @@ umask 022 IFS=" " read -r -a RUN_ARRAY <<< "$RUN_OPTS" -#mount_command="plexdrive mount -c /config/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M --uid=$PUID --gid=$PGID -o allow_other /encrypted ${RUN_ARRAY[@]}" -plexdrive mount -c /root/.plexdrive/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M -o allow_other /mnt/G-Cache ${RUN_ARRAY[@]} +mount_command="plexdrive mount -c /config/ --cache-file=/cache/cache.bolt -v 3 --umask=0777 --chunk-size=100M --uid=$PLEX_UID --gid=$PLEX_GID -o allow_other /encrypted ${RUN_ARRAY[@]}" -#echo "Executing => $mount_command" -#mkdir /encrypted /decrypted -#chmod 777 /encrypted /decrypted -#exec \ - s6-setuidgid abc $mount_command +echo "Executing => $mount_command" +mkdir /encrypted /decrypted +chmod 777 /encrypted /decrypted +exec \ + s6-setuidgid plex $mount_command