Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PlexDrive + Rclone Crypt + UnionFS Mount
[Unit]
Description=RClone Mount (crypt)
AssertPathIsDirectory=/mnt/decrypt
After=plexdrive.service
Requires=plexdrive.service
PartOf=plexdrive.service
[Service]
Type=simple
User=username
Group=username
ExecStart=/usr/bin/rclone mount --read-only --allow-non-empty --allow-other --buffer-size 500M -v --log-file=/home/hawk/scripts/logs/rclone_crypt.log GDCRYPT: /mnt/decrypt/
ExecStop=/bin/fusermount -uz /mnt/decrypt
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=default.target
#
# To monitor the PlexDrive activity use: sudo journalctl -f -u plexdrive
#
[Unit]
Description=Plexdrive
AssertPathIsDirectory=/mnt/plexdrive
After=network-online.target
[Service]
Type=simple
#
# uid & gid values are for the user that you want to run plexdrive, $id will give you the values for the logged in user
#
ExecStart=/opt/plexdrive/plexdrive -c /home/user/.plexdrive -v 2 -o allow_other --uid=1000 --gid=1000 /mnt/plexdrive
ExecStop=/bin/fusermount -uz /mnt/plexdrive
Restart=on-abort
RestartSec=30
StartLimitInterval=200
StartLimitBurst=5
[Install]
WantedBy=default.target
[Unit]
Description=UnionFS Mount (plexdrive)
AssertPathIsDirectory=/mnt/media
After=plexcrypt.service
Requires=plexcrypt.service
PartOf=plexcrypt.service
[Service]
Type=forking
User=user
Group=user
ExecStart=/bin/sh /home/user/scripts/unionfs.sh
ExecStop=/bin/fusermount -uz /mnt/media
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=default.target
[GDCRYPT]
type = crypt
remote = /plexmedia/plexdrive/plexmedia_crypt
filename_encryption = standard
password =XXXXXXXXXXXXXXXXXXXXXX
password2 = XXXXXXXXXXXXXXXXXXXX
# /plexmedia/plexdrive is the mount location for PLEXDRIVE
# and /plexmedia_crypt is the folder that contain the encrypted media on GD
#!/bin/sh
unionfs-fuse -o cow,allow_other,large_read,statfs_omit_ro,atomic_o_trunc,auto_cache,big_writes,default_permissions,splice_move,splice_read,nonempty -o uid=1000 -o gid=1000 /mnt/local=RW:/mnt/plexdrive/decrypt=RO /mnt/media
# udpated for the rclone crypt mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment