[BETA] Mostly automated ACD, Rclone, crypt, Plex, nzbget, PP Scripts

Hi everyone,

I recently finished my Plex web install and since I enjoy automating things I thought I'd script the entire process.

It's still a work in progress, but for now it will Use rclone crypt to mount and encrypt/decrypt your (unlimited) Amazon Drive storage on the fly.

It's written in bash and heavily commented in order to make the scripts usable and relatively easy to understand.

These scripts will install and configure:

  • Plex
    • IP:32400/web
  • PlexPy
    • localhost:8181
  • PlexRequests
    • localhost:3000
  • NZBget
    • localhost:6789
  • SickRage
    • localhost:8081
  • CouchPotato
    • localhost:5050
  • Mylar
    • localhost:8090
  • nzbToMedia Post-Processing
  • rclone + crypt + Amazon Drive

UPDATE
I just wanted to say that I just completed the wiki and this project is now in what I'd call a working beta state!

I've tested all of the scripts and wiki guides on a brand new Linode Ubuntu 16.04 without error. I'd love for others to do the same.

Now that the basic documentation is done I'll start looking at adding additional software options and trying to automate even more of the process.

If anyone ever has any suggestions or recommendations I'd be happy to hear them either here, via email, or on github.

HUGE thanks to @ncw for all the hard work on rclone!

6 Likes

:grinning:
I was just trying to collect all the info from different forums, before going ahead but this script sounds fantastic to me.
Iā€™m just interested in the 3 first scripts (using google drive instead of ACD), as iā€™m not using this machine to download anything, at least at this moment.
Thanks!!

Cool!

The documentation is still much more sparse that Iā€™d like so if you come across something that needs more info feel free to let me know.

Awesome job mate! On my side I added ruTorrent, HeadPhones, Jackett and Emby/SubSonic. rClone + ACD is really a must!

Yeah, rutorrent and headphones are on my ToDo list.

Eventually Iā€™d love to add things like Sonarr, Jackett, Emby, Kodi, etc. So that people can just run the scripts for the software they want and itā€™ll all be configured to work together.

1 Like

great job with the scripts.

Hey Chris,
I just wanted to say ā€œthanksā€ for taking the time to post your scripts.
A lot of us folks arent savvy to the various ins and outs. Myself, I finally got my setup working through trial and error over a month.
I would have loved these scripts like 2 months ago.
Thanks a lot for sharing and building the community.
Wish there were more ppl like you, keep it up.

Thanks!

I do this sort of stuff for a living, but Iā€™m relying on open source tools created by others - all Iā€™m doing is documenting the stringing together. (Seriously, without Rclone, this wouldnā€™t exist). Glad to help though!

Chris,
Apologies in advance for these basic questions.
As I mentioned my setup is already up and runningā€¦ but as we all know, thereā€™s always some crash or disaster or VPS migrationā€¦ so a set of scripts such as yours that can stream line the entire ā€œresetā€ process is AWESOME.
Anyhow I thought I would load a blank VPS and see how they rollā€¦ now on to cringe-worthy basic questions.

  • I extracted your scriptsā€¦ then I chmod +x to allow them to be executedā€¦
  • you said that they need to be run under rootā€¦ instead of the normal ā€˜sudoā€™ stuffā€¦ so i googled how to open a root account as they are closed by default near as I can tell under 16.04 desktop. And set up root accessā€¦ then SU to rootā€¦ everything is good so far. :wink: I edited the ā€œvars-exampleā€ file to reflect most of my settings. then I copied that file over to the /var directory.
  1. was I supposed to rename vars.example to maybe ā€œvarsā€
  2. was the above file vars or vars.example supposed to be just dumped into the /var directory? not a subdirectory or anything in there?
  3. inside the vars.example file, it asks for a user name and password. Is that my ā€˜rootā€™ information it is looking for? or my normal sudo user ā€œplexā€?
  4. at some point, it will get to a point where it will sayā€¦ ā€œdid you upload your SSH keys to the remote serverā€ā€¦ forgive my ignoranceā€¦ but can you advise of the steps to do so?
  5. looking inside the 00-setup.sh file itself line 3 (i think) reads ā€œsource varsā€ ā€¦ is that a configurable section that is asking for the directory path to the vars-example file ie: /var/vars.example ?

Iā€™m sure there will be more questions :slight_smile: thanks for helping me play around with your scripts

Hi,
Thatā€™s exactly my reasoning here. My old local NAS setup recently died and I couldnā€™t remember how I originally set it up years ago.

  1. just rename vars.example to vars
  2. donā€™t move it to another directory
  3. for now the scripts use a single user for all applications. This may change in the future but I was going for quick and easy first. Whatever username you list in vars will be created and all services installed by these scripts will be run by that user at boot.
  4. The text echoed by the script tells you a command to run from your local machine to do this. Iā€™m on my phone now or Iā€™d provide better details, sorry.
  5. sure, you could point it to any file, I just keep everything in the repo by default.
1 Like

Well, i have been playing with your scripts with 2 systems, one local, one remote.
I have one question in setup.h script, the lines bellow:

Allow SSH

ufw allow ssh
ufw default allow outgoing
ufw default deny incoming

Enable Firewall

ufw --force enable

after forcing firewall, no more access to SSH. :frowning: so, probably i have to reboot the VPS to begin again the installationā€¦ because there is no other way to connect to it.

What is the purpose of this?
Is it unsafe if i donā€™t use this part of the script and keep SSH as it is?

I've been working on the Wiki and have the first section done, hopefully it explains everything better.

Ok.
Now iā€™m having issues with auto mount rclone.

If i run the generated script rcloneMount.sh manually it runs and works OK.
But when trying to start with:

systemctl start rcloneMount.service it fails.

ā€œJob for rcloneMount.service failed because the control process exited with error code. See ā€œsystemctl status rcloneMount.serviceā€ and ā€œjournalctl -xeā€ for details.ā€

I guess it is something related to permissions.
I have copied my rclone.conf from other machine, thatā€™s the only difference from your procedure.
Can you help on this?

I copy my config file around too so thatā€™s not it.

Typically itā€™s a mount issue, try running:
sudo umount ALL
sudo umount AMZe
sudo systemctl stop rcloneMount
sudo systemctl start rcloneMount

For the rclone one, to use it with google drive, it would just be a case of changing the values before you run it?

I havenā€™t used rclone with anything other than ACD so I donā€™t know for sure, but I imagine it should work fine if you use your Google Drive remotes (and make sure any of the flags used are available for both ACD and Google Drive).

Iā€™m just trying to get it to mount on boot, and having problems getting it to work.

My problems came because network was not available. I solved introducing ā€œsleep 20sā€ in my script just before mounting and now everything works!

1 Like

Thatā€™s good to know, thanks.

1 Like

Hey Chris,
Just firing a quick question at you regarding 00-setup.sh
I just picked a new dedicated machine from JoesDataCenter and there is apparently no ā€˜panelā€™ like I had on ChicagoVPS where i could manually reboot, install new OSs etc etc. So when I would break something on ChicagoVPS I could easily just reinstall Ubuntuā€¦ now with my new VPS Iā€™ll be stuck with Issue Tickets to tech support if I lock myself out.

On to my questionā€¦

On a brand new ā€˜headlessā€™ VPS if I run your 00-setup.sh like as the 1st thing on the headless VPSā€¦ everything should go fine til I get to the SSH part. (I was looking at the code tis all). Now this is the section that is a bit concerning as it states that once I reboot, I wonā€™t be able to login as root anymore.

Can I assume that I can still SU root as needed?

Assuming that is yesā€¦ there is a section of code that asks if you have pushed your ssh keys and it will likely display
ā€œssh-copy-id $username@$ipaddrā€

Can I assume that the script stops at this pointā€¦ and you want the user to crack a new Terminal open and copy/paste the above into the new terminal ā€¦ and that will ā€˜pushā€™ the keys where ever they need to go? :slight_smile:

Yes I know this seems basic hehā€¦ Iā€™m just not looking forward to enabling the firewall, then removing external root access, then pulling my ssh access, and then clicking ā€˜rebootā€™ on a headless VPSā€¦ as staring at a blank screen is less entertaining then watching Plex.

Thanks for entertaining my basic tier inquiry.