sabnzbd / sickbeard / couchpotato pbi's

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Sabnzbd / SickBeard / CouchPotato / Headphones / Maraschino / LazyLibrarian / Gamez

INFO - http://www.youtube.com/watch?v=ATvuk5Y4SJM
Default Ports
sabnzbd - 8080
sickbeard/anime - 8081
couchpotato - 5050
headphones - 8181
maraschino - 7000
lazylibrarian - 8082
gamez - 8085

If you are upgrading from an earlier version I highly recommend you..
-stop the service
-backup data/ folder somewhere outside of the jail (only needed if you want to backup+restore your data)
-delete all of your plugins
-delete + reinstall your plugin jail
-reinstall new version of plugin
-put data/ folder back into place (only needed if you want to backup+restore your data)
-start plugin from freenas gui

BUGS
When starting the plugins from the FreeNAS webgui, it may show that the plugin didn't start correctly. Try refreshing the page as the pidfiles sometimes take too long to be created.

DOWNLOADS
64bit - http://freenas.synergames.com//browse.php?action=browse&userid=7&folder=amd64
32bit(untested) - http://freenas.synergames.com//browse.php?action=browse&userid=7&folder=i386
source - post or PM me your public key and I'll give you git access

DONATIONS (Thank you so much for those who have donated thus far!)
paypal = joshruehlig@gmail.com
bitcoin = 18xmRyyDUj1GfNQkAVQU8ekpc8anuxm9QU

THANKS
Craysh - PBI hosting
Thanks to everyone who has donated thus far!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I'm about to post a video on how to initialize the PBI/Plugin Jail. I'll update here with a link. It should be in about an hour or so.

Although I don't use Serviio, I've sort of cornered myself into supporting it. So my first goal is to do a Serviio Plugin, but if I get that figured out soon I'll see what I can do to help.


EDIT: Here's the video. The quality doesn't seem to be as clear after uploading so I may repost it later.

http://protosd.blogspot.com/2012/03/quick-guide-to-using-plugins-video-with.html
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm about to post a video on how to initialize the PBI/Plugin Jail. I'll update here with a link. It should be in about an hour or so.

Although I don't use Serviio, I've sort of cornered myself into supporting it. So my first goal is to do a Serviio Plugin, but if I get that figured out soon I'll see what I can do to help.

If you can get serviio running this python stuff should be a peace of cake. thanks for all your help and direction as well.
yeah, view your blog often to see if I want to start up a jail on freenas, never got myself to do it but I've been super busy lately.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
The Jail PBI itself is really quite useful, it does a lot of the pre-config stuff for setting up a jail that I describe in my Jail tutorials. Putting the PBI stuff aside and just doing a "jexec" to go inside the jail and add packages would be easy, it just means that you do stuff from the command line inside the jail instead of adding a PBI from the GUI. I need more time to play around with it myself, but I've also got other projects I need to finish... Too many toys and not enough time!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The Jail PBI itself is really quite useful, it does a lot of the pre-config stuff for setting up a jail that I describe in my Jail tutorials. Putting the PBI stuff aside and just doing a "jexec" to go inside the jail and add packages would be easy, it just means that you do stuff from the command line inside the jail instead of adding a PBI from the GUI. I need more time to play around with it myself, but I've also got other projects I need to finish... Too many toys and not enough time!

Wow that jail setup seemed rediculusly simple, thanks for it! I'll probably switch over to 8.2 later today and see if I can start testing pbi creation
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Logan54,

This release is still a very early beta, so things are not working completely yet. Only *some* plugins/PBI's from the FreeBSD 9 repository are supposed to work. I don't know which ones..... I'd be patient and just play with things to get an idea of how they *should* work.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
about to go to 8.2 and test transmission/firefly.

Sabnzbd / sickbeard won't be completely strait forward to make because they don't have recent ports for FreeBSD8.2 or 9. What I'm thinking is have the pbi_makeport be for FreeBSD's python27, then run a post script that populates a folder with the sabnzbd / sickbeard stuff. Then have the gui options somehow create the startup command for the 2 python apps. We'd also need to edit the 'sabToSickBeard2.py' for things to talk correctly.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
The problem with Serviio is the "Port Maintainer" (person) has the wrong dependencies for the port, so it won't work right either. He/she has Java JDK instead of JRE.

Josh, your plan sounds like it would work. Maybe have a 'patch' file for sabToSickBeard2.py and have it run in the post script also. I personally haven't used any of these apps, same with Serviio, I'm just helping when/where I can.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
decided to focus on just getting sabnzbd to work at first. I've managed to get a working rc.d file for it, still confused on how I'll cleanly package everything up but at least got part of the way there.
 

kashiwagi

Dabbler
Joined
Jul 5, 2011
Messages
35
I actually thought about doing this myself, but seems things are already rolling.

Anyway, I would be willing to test this stuff out (if you need people to test that is).
Currently using all of them in a "home made" jail on 8.0.4.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
feel free to help, the problem is that sabnzbd / sickbeard / python2.7 stuff isn't in the freebsd ports tree. this can all be fixed by packaging the needed dependencies within the pbi. I'm still need to figure out how the pbi is made. Anyway I've gotten a working rc script for sabnzbd and sickbeard, I'll try to get couchpotato and headphones done by tomorrow night.

The next step is getting is getting everything packaged up

finally we need a way to edit some settings from the freenas gui (they'll just edit the respective config files). We at least need the freenas gui to be able to change sabnznbd_enable="YES/NO" in /etc/rc.conf
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Here's a little trick you can use to edit the rc.conf from a script:

Code:
sed -i '' -e 's/old_string/new_string/' /etc/rc.conf


The -i '' (TWO single quotes) this overwrites the exising file, so test without it to make sure substition works first

The other quote marks are single back-ticks, usually on the same key as the ~ mark, these are required also.

I can't imagine that they don't have some type of method for flipping the value of that variable from the GUI.

Perhaps you can disect one of the other plugins to see how it gets done.

I don't have much time to put into helping right now, but I'll keep an eye out and see if I can add any helpful tips.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I've got the files setup and can create pbi's with 'pbi_create'
I'll post my source / pbi once I get couchpotato and headphones done, though I believe the way frenas unpacks pbi's is different then the standard way. My 'external-links' doesn't seem to work (need this to link my rc scripts). My 'resources/tweak-rcconf' also doesn't seem to edit my rc.conf file correctly. Though if I manually run these scripts later everything works.
 

Kev

Cadet
Joined
Jan 28, 2012
Messages
3
Just wanted to say a quick thanks to you both on behalf of myself and anyone else who rely on these add-ons. The complications of installing a working version of Serviio and Sab/CP etc have held me back from updating to 8 thus far. Proto, you might remember me from you blog board on the same subject. I have a Samsung TV and only Serviio seems to work with it so I am truly grateful. Keep up the good work guys, watching with interest.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Road Blocks thus far

Here I'll post what I've come up against in trying to create a pbi for FreeNAS for Sickbeard / Sabnzbd

*The ideal method for creating a pbi requires we have a port in the ports tree, sabnzbd doesn't have a current port in the ports tree. We could easily make one but it'd be based on python2.6 because that's what's in the ports tree for FreeBSD 8.2.
Python 2.7 is preferred for sabnzbd but more importantly FreeNAS has python2.7 installed. So basically we can't add python libraries (as package dependencies) to freenas because we'd need python2.7 stuff which isn't in the FreeBSD 8.2 ports tree. All of this could be fixed if our python version matched our ports tree, I think this will be fixed when FreeNAS is based off of FreeBSD 9.0 / 8.3 in the hopefully near future.

####
*What I'm doing instead is using the pbi_create command to create a pbi from a directory and a config directory.

*grab my source folder at http://eto.homeip.net/usenet-source.tar.gz it contains..
-tagert directory 'usenet' (with dependencies / rc.d files / latest Sabnzbd Sickbeard / sickbeard config folder)
-config directory 'config' (creates external-links / tweak-rcconf)
-make.sh (creates usenet-0.1-amd64.pbi + usenet-0.1-amd64.pbi.sha256)
~this script does some screwy stuff, I move the target directory because that's the only way I could get the links in the right place (see /usr/pbi/usenet-amd64/.sbin/install-pathlinks.sh)

URGENT TODO
*integrate couchpotato / headphones
*add status command to rc files
*a bunch of gui stuff (check status, enable/disable + start/stop, mount media directory)

FUTURE TODO
*run as non root user
*more gui options (ports to listen on?)
*a way from the gui to update sab, a simple script tied to the gui do this. It would need the version number though.
###

Ways you can test for now
-download zip, unzip, place into jail
-run ./make.sh
-download /root/usenet-0.1-amd64.pbi and /root/usenet-0.1-amd64.pbi.sha256
-install through gui
-tweak rc.conf file '/usr/pbi/usenet-amd64/tweak-rcconf'
-start sab nzbd/sickbeard from commandline with 'service sabnzbd/sickbeard start/stop'

To start hacking
-stop any running services (sabnzbd/sickbeard)
-uninstall usenet through gui
-edit source folder
-make / download / install / test
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Sabnzbd / SickBeard / CouchPotato / Headphones - 80% there

This is basically a revision of my last post, I summarized everything again here so read this one for latest info.

SOURCE
http://eto.homeip.net/usenet-0.2.tar.gz
PBI's (still need you to edit /etc/rc.conf and start services)
http://eto.homeip.net/usenet-0.2-pbi.tar.gz

CHANGES
-added couchpotato, headphones
-have 'scripts/post-install.sh' grab the latest SABnzbd / SickBeard / CouchPotato / Headphones
-split into 4 seperate plugins

WHAT NEEDS TO BE DONE BEFORE RELEASE
(please contribute what you can, if someone wants to throw the source up on github I'd be happy so multiple people could contribute)
-status loop 'etc/rc.d/' files*
-stop services on uninstall 'scripts/pre-remove.sh'*
-start/stop from gui 'resources/control'
-Mounting 'resources/mp_edit.html'
-enable/disable from gui 'resources/edit.html' (would edit /etc/rc.conf)

*=I'll work on this soon

WHAT COULD BE DONE
-32bit version (only unzip, par2cmdline, and unrar need to be changed)
-run as non root user (would need to create user in 'scripts/post-install.sh')
-cleanup unused files 'lib/' (would also need to edit external-links)
-SABnzbd update from GUI (not already built into sabnzbd =[ )
-backup/restore config (maybe even logs but config.ini files should be enough at first)

WARNING
-this could mess up your jail, and possibly stop your FreeNAS gui from working. Be ready to have to reboot or even reinstall FreeNAS from a cd if your GUI gets broken. you've been warned.
 

injectx

Cadet
Joined
Nov 16, 2011
Messages
5
Hi Joshua,

Yesterday I've updated to FreeNAS 8.2 and noticed my custom made downloaders script (SABnzbd, SickBeard, CouchPotato, Headphones) didn't work anymore. So .. I'm waiting for you to get things working :)

Keep up the good work.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I'll take a look tomorrow evening and see what I can do. It looks like the Serviio plugin won't be that difficult, more about that later.

WARNING
-this could mess up your jail, and possibly stop your FreeNAS gui from working. Be ready to have to reboot or even reinstall FreeNAS from a cd if your GUI gets broken. you've been warned.

Did something happen that made you say this? Technically the jail is isolated from FreeNAS and shouldn't cause any problems unless there's a bug, but it is possible to mess up the jail if the plugin doesn't work right.

There's definitely some error checking that needs to be done in the GUI. I should try and open some tickets before the release or there's going to be some confusion and mistakes when people try to install plugins.

I'm wonder what artifacts may be left behind if a jail is deleted improperly. Anyway, it's getting late for me.

Thanks for your effort to figure this out and post the details, nice work.
 
Status
Not open for further replies.
Top