diff --git a/Dockerfile b/Dockerfile index b666e2c..748e831 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM linuxserver/plex COPY root / -RUN apt update && apt install -y cron +RUN apt update && apt install -y cron unionfs-fuse ENTRYPOINT ["/init"] diff --git a/docker-compose.yml b/docker-compose.yml index 4b64c83..ff8915c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,13 +4,14 @@ services: build: ./ image: kilhaasi/pms container_name: pms -# depends_on: -# - plexdrv volumes: - /Video:/Video:shared - /Transcode:/Transcode - /Docker/Plex-Video/plex_cfg:/config - - ./.rclone.conf:/root/.rclone.conf + - /Docker/Plex-Video/.rclone.conf:/root/.rclone.conf + - /Docker/Plex-Video/plexdrv-cfg:/root/.plexdrive + - /Docker/Plex-Video/enc-pwd:/root/enc-pwd + - /Docker/Plex-Video/cache:/cache environment: - TZ=DE - BACKUP=gdrive:/Backup/Plex-Dev diff --git a/root/etc/services.d/gocryptfs/run b/root/etc/services.d/gocryptfs/run new file mode 100644 index 0000000..1b75b10 --- /dev/null +++ b/root/etc/services.d/gocryptfs/run @@ -0,0 +1,19 @@ +#!/usr/bin/with-contenv bash +while [ ! -f "/mnt/G-Cache/Video/gocryptfs.conf" ] +do + echo "Waiting for gocryptfs.conf to appear..." + sleep 1 +done + +mkdir -pv /mnt/Video /crypt/output /crypt/input /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 + true + sleep 1 +done diff --git a/root/etc/services.d/plexdrive/run b/root/etc/services.d/plexdrive/run new file mode 100755 index 0000000..88caf98 --- /dev/null +++ b/root/etc/services.d/plexdrive/run @@ -0,0 +1,20 @@ +#!/usr/bin/with-contenv bash + +while [ ! -f "/root/.plexdrive/config.json" ] || [ ! -f "/root/.plexdrive/token.json" ] +do + echo "Waiting for plexdrive configuration files ..." + sleep 30 +done + +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[@]} + +#echo "Executing => $mount_command" +#mkdir /encrypted /decrypted +#chmod 777 /encrypted /decrypted +#exec \ + s6-setuidgid abc $mount_command diff --git a/root/usr/bin/gocryptfs b/root/usr/bin/gocryptfs new file mode 100755 index 0000000..4d6c579 Binary files /dev/null and b/root/usr/bin/gocryptfs differ diff --git a/root/usr/bin/plexdrive b/root/usr/bin/plexdrive new file mode 100755 index 0000000..5ea997e Binary files /dev/null and b/root/usr/bin/plexdrive differ