Setting up Remotes

rclone – Setting up your remotes and encryption.

rclone is the workhorse behind your server. This is what will automatically encrypt and upload your media to your online storage.

Here’s how to install it;

Fetch and unpack

curl -O
cd rclone-*-linux-amd64

Copy binary file

sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone

Install manpage

sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb

We’re going to encrypt everything before we upload it so this adds another layer to the process. How this works is you create remotes to your cloud storage, then we create an encrypted remote on top of the normal remote. These encrypted remotes, one for TV and one for movies are the ones we’ll be using for uploading. We’ll then be creating two more remotes afterwards to decrypt the plexdrive mounts. So 5 in total.

To run it, rclone config. Select N for a new remote, and just name it ‘gd’ then select 7 for GD. This is the underlying remote we’ll use for our crypts. Follow this link to create a client ID and secret, and use them for the next two prompts in the rclone config. After this, select N, and then copy the link provided and use it in your browser. Verify your google account and paste the code returned, then Y for ‘yes this is ok’ and you have your first remote!

Next we’re going to setup two encrypted remotes. Login to GD and create two folders, tv-gd and m-gd.

Run rclone config again, N for new remote, then set the name as tv-gd, and 5 for a crypt. Next enter gd:/tv-gd, and 2 for standard filenames. Create or generate password and an optional salt, make sure you keep these somewhere safe, as they’re required to access the decrypted data. Select Y for ‘yes this is ok’. Then you can do the same for the second one, using the name m-gd, and the remote gd:/m-gd. There’s our two encrypted remotes setup. Note their names and the folders they’re linked to, IE tv-gd is linked to gd:/tv-gd etc.

Let’s also setup both of our remotes for decrypting your plexdrive. It’s also worth clarifying that instead of mounting and decrypting your files straight from google drive, we’re instead going to be mounting it like this.

google drive -> plexdrive -> rclone -> plex. So plexdrive mounts your entire drive, including your encrypted folders. You then create two new rclone mounts that will read these ‘local’ encrypted folders and re-mount and decrypt them to the folder plex reads.

Run rclone config again, N for new remote, name it dec-tv, select 5 for a crypt, for path enter /mnt/plexdrive/tv-gd, and 2 for standard filenames. Now for the password and salt, select Y to use existing, and use the same password and salt you used for the tv-gd crypt we created above. Then select Y to create the remote. Repeat for the movies, using the name dec-m, path /mnt/plexdrive/m-gd, and use the password and salt from the m-gd crypt.