Script to install Sonarr, Radarr, Lidarr, Sabnzbd, and Plex in iocage jail

Status
Not open for further replies.

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I wrote this script as a learning experience to allow me to quickly install these apps in an iocage jail so I could experiment with the apps and not disturb my working ones. Originally I wrote it with installing mono 5.12 from ports. Now that mono version 5.10.1.47_3 is available, the apps can update automatically and it's faster to install from pkg as opposed to ports. I decided to adjust the script to install everything from the pkg commands. It installs all the apps in a single jail after the mono-config file has all it's options set, with the data going into /mnt/<YourPool>/apps/<AppData>.
Thanks to @Pentaflake and @danb35 for their resources I learned a lot from studying their contributions.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
Hi @NasKar

Once again thank you for making this script, I`ll be trying to use this system.
Just a quick one though, is there any way to install plex using a different network adapter within the script. Previously, I used that other script that did the plex apps without Plex, and I use different network cards to stop any network congestion on a single card when I'm doing heavy downloading etc.

So far my solution is to edit this script and edit out all but the plex details and change the details, and the same again without plex to make the 2 jails. Plex & Plexapps
Would I get perm issues doing this? or would the settings in sonarr/radarr for editing perms solve this anyway?

Another question I have, I tried running this in a test run, and it doesn't seem to like using my Datasets, over the directories (I`ve tried commenting out the make directory segment)
But it still has problems. Any suggestions? I`m not very good with scripting, so any answer would need to be basic.
Thanks in advance.

Sorry, whilst going through the configs, I`ve got another question too.
This section of the config

: ${lidarr_enable="NO"}
: ${lidarr_user:="media"}
: ${lidarr_group:="media"}
: ${lidarr_data_dir:="/config/lidarrdata"}

lidarr_data_dir should this read lidarr_data rather than lidarrdata? which was what was defined in the install script? (Assuming i set lidarr_data there) ?

Once again, thanks.
Max
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Hadn't noticed this earlier--cool. Thanks for the work on it. Something to consider--when I did the Nextcloud script, I deliberately didn't put the config file in the repo. That way, a user could do git pull to get the most up-to-date script without their config file causing a conflict.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Hadn't noticed this earlier--cool. Thanks for the work on it. Something to consider--when I did the Nextcloud script, I deliberately didn't put the config file in the repo. That way, a user could do git pull to get the most up-to-date script without their config file causing a conflict.
You were my inspiration for learning how to create these scripts. Thanks for your work.
I originally thought you had done that to protect the personal info in the config files, but I see your point. New to git so I'll have to research how to remove that file and then add it to the .gitignore.

I've had some trouble testing this script as it doesn't like having multiple version with the same port on my machine. I created a virtualbox on my Windows 10 PC and was able to test my standalone plex install script but for some reason with this script I can't get the apps to start. Must have something to do with the virtual box as it works on my freenas system. I was reading about doing a VM on the freenas box to accomplish a test environment.

I have 16 gigs of RAM should I allocate 8 GIG for the VM and 500 megs storage? Thanks for your advise.


Hi @NasKar

Once again thank you for making this script, I`ll be trying to use this system.
Just a quick one though, is there any way to install plex using a different network adapter within the script. Previously, I used that other script that did the plex apps without Plex, and I use different network cards to stop any network congestion on a single card when I'm doing heavy downloading etc.

So far my solution is to edit this script and edit out all but the plex details and change the details, and the same again without plex to make the 2 jails. Plex & Plexapps
Would I get perm issues doing this? or would the settings in sonarr/radarr for editing perms solve this anyway?

Another question I have, I tried running this in a test run, and it doesn't seem to like using my Datasets, over the directories (I`ve tried commenting out the make directory segment)
But it still has problems. Any suggestions? I`m not very good with scripting, so any answer would need to be basic.
Thanks in advance.

Sorry, whilst going through the configs, I`ve got another question too.
This section of the config

: ${lidarr_enable="NO"}
: ${lidarr_user:="media"}
: ${lidarr_group:="media"}
: ${lidarr_data_dir:="/config/lidarrdata"}

lidarr_data_dir should this read lidarr_data rather than lidarrdata? which was what was defined in the install script? (Assuming i set lidarr_data there) ?

Once again, thanks.
Max
Max your are correct it should be lidarr_data I will fix it tonight when I get home. Good pickup.
I don't thinks you can have a different network adapter for different services in a jail but you could use my script that just installs plex and define a different network adapter in the config before installing and comment out the plex part of the install from the script that installs the other apps. My standalone plex app makes the user plex part of the media group to allow access. I have sonar and radarr to do 660 file mask and 770 folder mask with user media and group media. Check to make sure the owner of your media files is media:media and the permissions allow user and group access.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I was also wondering--you talk about a torrent path, but I don't see a torrent client installed--did I miss it?
I don't do torrents but I kept it in the script to mount the data directory in case someone wants to add that. Couldn't get the firewall kill switch working so just don't use torrents.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
I was also wondering--you talk about a torrent path, but I don't see a torrent client installed--did I miss it?
The torrent path from what I can tell is for the sabnzdb, albeit not a "torrent" system, but it uses the directories in that script.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
Brilliant, thankyou.
One other pickup, which seems to be an issue.

You were my inspiration for learning how to create these scripts. Thanks for your work.
I originally thought you had done that to protect the personal info in the config files, but I see your point. New to git so I'll have to research how to remove that file and then add it to the .gitignore.

I've had some trouble testing this script as it doesn't like having multiple version with the same port on my machine. I created a virtualbox on my Windows 10 PC and was able to test my standalone plex install script but for some reason with this script I can't get the apps to start. Must have something to do with the virtual box as it works on my freenas system. I was reading about doing a VM on the freenas box to accomplish a test environment.

I have 16 gigs of RAM should I allocate 8 GIG for the VM and 500 megs storage? Thanks for your advise.



Max your are correct it should be lidarr_data I will fix it tonight when I get home. Good pickup.
I don't thinks you can have a different network adapter for different services in a jail but you could use my script that just installs plex and define a different network adapter in the config before installing and comment out the plex part of the install from the script that installs the other apps. My standalone plex app makes the user plex part of the media group to allow access. I have sonar and radarr to do 660 file mask and 770 folder mask with user media and group media. Check to make sure the owner of your media files is media:media and the permissions allow user and group access.

Thanks for that feedback.

One other issue, regarding sabnzbd config data, which doesnt seem to be working.
https://i.imgur.com/5Bnneej.png

The edits to sabnzdb.ini dont happen via script (I`ve edited manually, so now works, but thought you`d like to know)

Also there is a perms problem that doesnt get sorted via script for sabnzdb (the one in the config folder), it doesnt have execute, again fixed manually and it works fine, but doesn't by default via the script, so might want to check that in the script also.

Note: I haven't tested the Plex part of this script yet, as I commented it out. However, I'm about to nuke the Jail and test it all again with my edits, so I`ll report back shortly for you. I`ll enable the Plex part whilst I test this, since I`ll be nuking the Jail again before making my final build/setup.

My final setup will have this as 2 Jails like I discussed, since I want Plexapp to be on one network adapter, and Plex itself on another.
I`ll also report back how that worked.
 
Last edited:

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Brilliant, thankyou.
One other pickup, which seems to be an issue.



Thanks for that feedback.

One other issue, regarding sabnzbd config data, which doesnt seem to be working.
https://i.imgur.com/5Bnneej.png

The edits to sabnzdb.ini don't happen via script (I`ve edited manually, so now works, but thought you`d like to know)

Also there is a perms problem that doesnt get sorted via script for sabnzdb (the one in the config folder), it doesnt have execute, again fixed manually and it works fine, but doesn't by default via the script, so might want to check that in the script also.

Note: I haven't tested the Plex part of this script yet, as I commented it out. However, I'm about to nuke the Jail and test it all again with my edits, so I`ll report back shortly for you. I`ll enable the Plex part whilst I test this, since I`ll be nuking the Jail again before making my final build/setup.

My final setup will have this as 2 Jails like I discussed, since I want Plexapp to be on one network adapter, and Plex itself on another.
I`ll also report back how that worked.
Appreciate the feedback will make adjusts when I get home. For sure the standalone plex installation script works.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
@Kiskaa I've made adjusts discuss above. If you have a chance give it a try and let me know if it worked without manual editing.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
@Kiskaa I've made adjusts discuss above. If you have a chance give it a try and let me know if it worked without manual editing.
I`ll give that a try tomorrow for you, I`m about to head to bed, its pretty late here (UK).
Also, a quick question. The file mono-config. What's the purpose behind this file, since everything in here, is already defined within the install.sh script in the #Initialise defaults area.
In your old version (the one without plex you did) I didn't even use the mono-config file (tbh I actually forgot initially till I realised it's of no use) and it worked just fine.

Not sure if the following info is relevant for you, but thought I`d let you know what version of FreeNAS I'm using so you can say "tested on xyz"
I`m using FreeNAS-11.1-U5
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
a user could do git pull to get the most up-to-date script without their config file causing a conflict.
As danb35 said it allows you to pull the latest version without having to replace the settings keeping it more generic.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
@NasKar
Out of interest, if you use mono-config file, does that over-ride the info in the defined variables inside the install.sh script?, the reason I ask, I put differing IPs in by mistake, and it made the jail with the mono-config IP.

Just another suggestion. In the script, you have POOL_PATH/apps/SONARR_DATA etc.
The bit that says apps. Can I suggest, you ask people to define this in their variables. apps is a very common directory name I should imagine. I myself have an apps folder already, for, well, PC apps etc, within my main dataset. If you don't want to define it, instead of "apps" may I suggest something along the lines of POOL_PATH/plexappdata/SONARR_DATA as an alternative.

I know this is easy to modify yourself in the script, but might be worth editing that for those who don't know much about scripting who are using this.

The install itself went along fine, I`m having a few issues with Plex in this install, such as metadata images for movies and tv shows aren't showing up. However, I`m not sure if that's a problem with the install, or some permissions issue somewhere atm. I`m looking into that at the moment.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
@NasKar
Out of interest, if you use mono-config file, does that over-ride the info in the defined variables inside the install.sh script?, the reason I ask, I put differing IPs in by mistake, and it made the jail with the mono-config IP.

Just another suggestion. In the script, you have POOL_PATH/apps/SONARR_DATA etc.
The bit that says apps. Can I suggest, you ask people to define this in their variables. apps is a very common directory name I should imagine. I myself have an apps folder already, for, well, PC apps etc, within my main dataset. If you don't want to define it, instead of "apps" may I suggest something along the lines of POOL_PATH/plexappdata/SONARR_DATA as an alternative.

I know this is easy to modify yourself in the script, but might be worth editing that for those who don't know much about scripting who are using this.

The install itself went along fine, I`m having a few issues with Plex in this install, such as metadata images for movies and tv shows aren't showing up. However, I`m not sure if that's a problem with the install, or some permissions issue somewhere atm. I`m looking into that at the moment.

The mono-config over-rides the setting in the install.sh script
I was thinking of adding a variable for the app directory will update it.
In the updated README.md file... your may have an older version.
After install
Server/Network/Secure connections is set to Preferred by default
Make sure to add to Server/Network/List of IP addresses and networks that are allowed without auth to your subnet for example 192.168.5.0/24 to allow metadata to be downloaded.

Analyze and Refresh All Metadata for the libraries

Glad to hear it all worked without errors.
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
The mono-config over-rides the setting in the install.sh script
I was thinking of adding a variable for the app directory will update it.
In the updated README.md file... your may have an older version.
After install
Server/Network/Secure connections is set to Preferred by default
Make sure to add to Server/Network/List of IP addresses and networks that are allowed without auth to your subnet for example 192.168.5.0/24 to allow metadata to be downloaded.

Analyze and Refresh All Metadata for the libraries

Glad to hear it all worked without errors.

Ah great, thanks for that, my artwork is now coming through. Wasn't aware they`d changed anything with how that works, and I don't remember changes things on my old setup.
The only thing for me to do is nuke this test install, and edit the files so I can have Plexapps and Plex as 2 different jails using differing network adapters.
I`ll let you know how that goes.
I`m assuming I`ll just need to comment out anything that's not related to Plex in the script install wise. (eg sonarr, lidarr etc)

I`m not sure if its something you use yourself, but there are 2 other apps that seem very popular within media setups, which might be nice to include if you plan on making this a bit more of a comprehensive script.

Ombi (Lets you request media)
Organizr (Central media management system)
 
Last edited:

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I`m assuming I`ll just need to comment out anything that's not related to Plex in the script install wise. (eg sonarr, lidarr etc)
You can comment out the plex install section at the end of the script and then run the https://github.com/NasKar2/freenas-iocage-plex script to install plex separately in a different jail/network adapter.

I`m not sure if its something you use yourself, but there are 2 other apps that seem very popular within media setups, which might be nice to include if you plan on making this a bit more of a comprehensive script.

Ombi (Lets you request media)
Organizr (Central media management system)

I have installed both apps before to check them out but don't use them. Seem easier to bookmark the web address or remember the port for the app instead of setting up Organizr unless I'm missing something. Have you used Ombi successfully to make a request for newsgroups or torrents?
 

Kiskaa

Dabbler
Joined
May 3, 2018
Messages
43
You can comment out the plex install section at the end of the script and then run the https://github.com/NasKar2/freenas-iocage-plex script to install plex separately in a different jail/network adapter.

I have installed both apps before to check them out but don't use them. Seem easier to bookmark the web address or remember the port for the app instead of setting up Organizr unless I'm missing something. Have you used Ombi successfully to make a request for newsgroups or torrents?

No, I don't use them myself either, I found it quicker to use the Sonarr and Radarr interface bookmarked. (It was more a suggestion for other people rather than myself, as they seem very popular)
I`ve also not used ombi myself, however, I am going to look into installing it, since now I have my new server setup that's capable of 8 streams, I have friends and family who use my Media Library to stream to their home TV`s, so can see this being useful. I have a friend who uses it, and he swears by it for his system, so his Kids and wife can add things to their library without hassling him all the time, so I`m assuming it works just fine (once configured right I guess)

I`ll take a look into it, and let you know what I think, and if it works within your system ok.

[edit]
Thanks for the Plex script link.
 
Last edited:
Status
Not open for further replies.
Top