From 03ccc58e811dd9319fde00db48a5a7469e5ba85d Mon Sep 17 00:00:00 2001 From: kilhaasi <34743687+kilhaasi@users.noreply.github.com> Date: Thu, 26 Mar 2020 22:01:59 +0100 Subject: [PATCH 1/2] Create History.txt --- History.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 History.txt diff --git a/History.txt b/History.txt new file mode 100644 index 0000000..b469766 --- /dev/null +++ b/History.txt @@ -0,0 +1 @@ +2020-03-26 - Updated to latest plex server version From c5a6f4126716817e764788ab656cbc8db36df5b6 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sat, 2 May 2020 22:16:43 +0200 Subject: [PATCH 2/2] Added local unencrypted repository --- History.txt | 1 + root/etc/services.d/gocryptfs/run | 24 ++++++++++++++++++------ root/root/bin/backup-pms | 1 + 3 files changed, 20 insertions(+), 6 deletions(-) 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 +