Creating N8Flix: Part II - The Processing Server
In my previous post Creating N8Flix: A Netflix Clone with Plex, I discussed the benefits and costs of creating your Netflix clone using Plex Media Server. If you haven't already, I strongly suggest you skim that over before diving deeper.
In this rundown we will cover the setup involved in creating a media processing server in the cloud. Also covered is the post is the process of encrypting and moving media to Amazon Cloud Drive.
- 100% unreliant on your ISP.
- Totally in the cloud. No hardware to maintain.
- Fully automated downloading of media. Set it and forget it.
- The down/uploading of media does not impact Plex playback.
- Ephemeral and reproducible. It can be torn down/rebuilt with ease.
- Virtually no impact on your broadband data caps.
- Minimal interfaces for requesting new media.
- Fully encrypted data. Only you know what you have.
- Easy process management leveraging Docker.
What We're Building
- A globally accessible media management and processing server:
- You have created and registered your SSH key with Scaleway
- You know how to ssh into a remote machine
- You have already created a small VPS
- Again, I recommend using Scaleway VPSes.
- Specifically a server with the following options:
- Docker preinstalled
- 150GB additional hd space
- 8GB minimum RAM
- Provision as you see in the example Scaleway VC1L below
Before you start
I encourage you all to read this post completely before attempting to run any commands. Get a good understanding before you take the plunge.
Install all the things!
Now to run some commands to get your VPS ready for action.
Part 1: Initialization
Start by connecting to your VPS
ssh -i ~/.ssh/id_rsa -L 53682:localhost:53682 root@<vps.ip.address>
The IP can be found in your Scaleway dashboard as seen below.
Once you have successfully connected to your VPS via ssh clone the script repo from Github
cd / && git clone https://github.com/n8io/processing-server.git && cd processing-server
Next you will need to initialize your environment with the following command:
# Setup ./init.sh
If you are well versed in this install, now is the time to go and tweak the default settings in your
~/.bashrc. Typically the defaults are fine as is.
Continue on with the following command.
# Apply . ~/.bashrc
You will be prompted some questions about your given Amazon Cloud Drive setup. Read carefully and provide the appropriate values (e.g. '/encrypted'). For clarity, we assume you named your ACD drive
encrypted. Also, remember in the first post where I said you would need Private Internet Access creds? Enter them when prompted. These are necessary to properly mask your processing server's internet traffic.
Part 2: Updating the server
Now to kick it all off...
You will notice a bunch of crap fly across your screen as your server grabs the latest updates from Santa's toy bag. Be patient, it should take ~2-5 minutes.
During these updates, expect to see a horrendously pink screen.
It states some insecurity information about ENCFS in which your only option is "OK". Read if you like.
Enter and continue.
Part 3: Encrypt all the things!
After updates have completed and the extra volume has been created you will be prompted to setup some encryption.
When prompted to choose a configuration, simply hit
Now you will be asked to create an encryption password. This should be a strong password containing special characters, numbers, upper and lowercase and longer than 16 characters. If you're lazy and want something you can copy and paste, click here to generate a random password.
You will need to paste that password in three times. Yes three times. It is vital that you save off this encryption password.
After successfully pasting in the password the third time you will have setup all your encryption stuffs.
Part 4: Give your VPS access to your Amazon Cloud Drive
Next you will be asked a series of questions in regards to your Amazon Cloud Drive.
Provide the following info when prompted:
Now this part gets a little tricky. So pay careful attention. Do not close the terminal you have open to your VPS.
Open your web browser to http://127.0.0.1:53682/auth
This will present a screen asking for your Amazon login. This is needed to grant access to your VPS securely. Once you enter your credentials successfully, return to your terminal. There you should see you it captured your access token.
Part 5: Starting services
Now hurry up and wait. You should notice a bunch of stuff downloading. It is pulling images for all the media management services that you will use. Be patient, should take ~5-10 minutes.
Part 6: Housekeeping
At this point you should have successfully ran through the setup and you should see a summary. Read it thoroughly as it may save you some troubleshooting time later. The key takeaway is that you need to save off a few very important items:
- Your encryption password
- Your encryption key file
- Your rclong config file
You can get the contents of these items file by issuing the following commands:
cat /.encfs cat /encfs.xml cat /root/.rclone.conf
Copy and Paste the output somewhere safe. Your Plex server will need this information later on.
If everything is up and running as expected, you should be able to visit each url of the services listed.
OK. You're almost ready to start downloading media.
Stay tuned for the next post covering Processing Server - Service Configuration.
¹ The author of this post is not responsible for or recommending any illegal activities that readers might attempt as a result. This is simply an educational and theoretical exercise.