A docker-compose file with
- madslundt/cloud-media-scripts Rclone, PlexDrive, UnionFS
- Plex
- RuTorrent
- Portainer
- Sonarr
- Radarr
- Jackett
This project is currently not in a fully working state. I have plans to either resume this, or implement it in another form. It can serve as a base for your needs, but you have to dive in and configure it properly. This repository will stay up, and you're more than welcome to make pull requests. I have thought about a modular implementation, but it needs to be properly planned out. I would advise taking inspiration from projects like cloudbox as it serves as a base for other highly used projects. Though i would advise against Plexguide, as it's a mess.
What things you need to install the software and how to install them
fuser
$ sudo apt install fuser
docker
$ sudo apt update
$ sudo apt install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt update
$ sudo apt install docker-ce
$ sudo usermod -aG docker $USER
docker-compose
$ sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
After the docker image has been setup and running, Rclone and Plexdrive need to be configured.
Setup Rclone run docker exec -ti <DOCKER_CONTAINER> rclone_setup
3 remotes are needed when using encryption:
- First one is for the Google drive connection
- Second one is for the Google drive on-the-fly encryption/decryption
- Third and last one is for the local encryption/decryption
- Endpoint to your cloud storage.
- Create new remote [Press N]
- Give it a name example gd
- Choose Google Drive [Press 8]
- If you have a client id paste it here or leave it blank
- Choose headless machine [Press N]
- Open the url in your browser and enter the verification code
- Encryption and decryption for your cloud storage.
- Create new remote [Press N]
- Give it the same name as specified in the environment variable
RCLONE_CLOUD_ENDPOINT
but without colon (:) (default gd-crypt) - Choose Encrypt/Decrypt a remote [Press 5]
- Enter the name of the endpoint created in cloud-storage appended with a colon (:) and the subfolder on your cloud. Example
gd:/Media
or justgd:
if you have your files in root in the cloud. - Choose how to encrypt filenames. I prefer option 2 Encrypt the filenames
- Choose to either generate your own or random password. I prefer to enter my own.
- Choose to enter pass phrase for the salt or leave it blank. I prefer to enter my own.
- Encryption and decryption for your local storage.
- Create new remote [Press N]
- Give it the same name as specified in the environment variable
RCLONE_LOCAL_ENDPOINT
but without colon (:) (default local-crypt) - Choose Encrypt/Decrypt a remote [Press 5]
- Enter the encrypted folder: /cloud-encrypt. If you are using subdirectory append it to it. Example /cloud-encrypt/Media
- Choose the same filename encrypted as you did with the cloud storage.
- Enter the same password as you did with the cloud storage.
- Enter the same pass phrase as you did with the cloud storage.
1 remote is needed to connect rclone to Google drive:
- Endpoint to your cloud storage.
- Create new remote [Press N]
- Give it the same name as specified in the environment variable
RCLONE_CLOUD_ENDPOINT
but without the colon (:) - Choose Google Drive [Press 7]
- If you have a client id paste it here or leave it blank
- Choose headless machine [Press N]
- Open the url in your browser and enter the verification code
Rclone documentation if needed click here
Setup Plexdrive to the cloud. Run the command docker exec -ti <DOCKER_CONTAINER> plexdrive_setup
Plexdrive documentation if needed click here
Upload local files to cloud run: docker exec <DOCKER_CONTAINER> cloudupload
Remove local files run docker exec <DOCKER_CONTAINER> rmlocal
Check if everything is running docker exec <DOCKER_CONTAINER> check
Empty trash on Plex Media Server but only if mount is up docker exec <DOCKER_CONTAINER> emptytrash
cloudupload
and rmlocal
can be ran with arguments. All arguments are passed to rclone.
For example it is possible to run docker exec <DOCKER_CONTAINER> cloudupload -v
to get verbose on the rclone operations in cloudupload.
Setup cron jobs to upload and remove local files:
@daily docker exec <DOCKER_CONTAINER> cloudupload
@weekly docker exec <DOCKER_CONTAINER> rmlocal
Make an SSH tunnel to your server
ssh username@ip -L 8888:localhost:32400
Go to http://localhost:8888
to claim and setup your libraries.
Point sonarr & radarr to /unionfs/<directory>