diff --git a/History.txt b/History.txt index b469766..9562200 100644 --- a/History.txt +++ b/History.txt @@ -1 +1,2 @@ +2020-05-02 - Added local unencrypted repository 2020-03-26 - Updated to latest plex server version diff --git a/root/etc/services.d/gocryptfs/run b/root/etc/services.d/gocryptfs/run index 248367a..0a2936e 100644 --- a/root/etc/services.d/gocryptfs/run +++ b/root/etc/services.d/gocryptfs/run @@ -1,19 +1,31 @@ #!/usr/bin/with-contenv bash -mkdir /encrypted +mkdir /mnt/plexdrv_encrypted rm -Rf ~/.cache -rclone mount --daemon --allow-other --vfs-cache-mode minimal --no-modtime --write-back-cache gcache:/ /encrypted --log-file /tmp/rclone.log --log-level DEBUG -while [ ! -f "/encrypted/gocryptfs.conf" ] +rclone mount --daemon --allow-other --vfs-cache-mode minimal --no-modtime --write-back-cache gcache:/ /mnt/plexdrv_encrypted --log-file /tmp/rclone.log --log-level DEBUG + +while [ ! -f "/mnt/plexdrv_encrypted/gocryptfs.conf" ] do echo "Waiting for gocryptfs.conf to appear..." sleep 1 done -mkdir -pv /Video -chmod 777 /Video +mkdir -pv /mnt/plexdrv_video /Video +chmod 777 /mnt/plexdrv_video /Video -s6-setuidgid plex gocryptfs -passfile /etc/plexdrv/enc-pwd /encrypted/ /Video +s6-setuidgid plex gocryptfs -passfile /etc/plexdrv/enc-pwd /mnt/plexdrv_encrypted/ /mnt/plexdrv_video +if [ -f /mnt/local_mirror/Video/gocryptfs.conf ] +then + echo "local plexdrive mirror found" + mkdir -pv /mnt/mirror_decrypted + chmod 777 /mnt/mirror_decrypted /mnt/local_mirror + s6-setuidgid plex gocryptfs -passfile /etc/plexdrv/enc-pwd /mnt/local_mirror/Video /mnt/mirror_decrypted + s6-setuidgid plex unionfs-fuse /mnt/video:/mnt/mirror_decrypted=RO:/mnt/plexdrv_video=RO /Video +else + s6-setuidgid plex unionfs-fuse /mnt/video:/mnt/plexdrv_video=RO /Video +fi +# Keep running so this script is recognised as running service until false do true diff --git a/root/root/bin/backup-pms b/root/root/bin/backup-pms index 5a8a11b..d7d21e9 100755 --- a/root/root/bin/backup-pms +++ b/root/root/bin/backup-pms @@ -5,3 +5,4 @@ cd /config tar -cvzf /pms.tar.gz Library rclone move /pms.tar.gz $BACKUP --verbose --transfers 4 --checkers 20 --stats 10s +