General NAS-Central Forums

Welcome to the NAS community
It is currently Wed Nov 22, 2017 2:02 am

All times are UTC




Post new topic Reply to topic  [ 723 posts ]  Go to page 1, 2, 3, 4, 5 ... 49  Next
Author Message
PostPosted: Mon Sep 02, 2013 9:56 pm 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
See Post 9 Of This Thread For Detailed Installation Instructions

Download latest version (V0.98) from HERE

See HERE for installing on Entware-ng. The current version will be the last version for ffp.

I'm writing a script to attempt to simplify and automate the install of Sabnzbd, Couchpotato and Sickbeard on a NSA325 which you will find in a post below, if you find it useful please go ahead and test it, I will continue updates as and when I can, hope this helps you guys.

Many thanks to barmalej2 for guidance with parts of the code, and to TheSwede86 for working with me at the beginning of this project. And to anyone who is willing to test and provide feedback!

Change log

V0.1 initial beta release
V0.2 kill command added to stop program's if already running during update sequence
V0.3 Kill command removed as could cause .db corruption with couch and sickbeard
V0.4 Clean shutdown added for all three programs
V0.5 Added support for https, script detects whether ssl enabled (mostly for shutdown commands)
V0.6 fixed multiple directory errors on first run of the script. (please note the added fix for sabtosickbeard.py read/write errors at the bottom of the guide)
V0.65 removed reference to installing kyleks sudo package as suggested by barmalej2 in post 32 of this topic, and modified script to run SAB as root (for the time being). Various code clean ups
V0.7 changed from midgetspy sickbeard repo to mr-orange repo, for failed download ep handling (See instructions for setup)
V0.75 Code cleanup
V0.8 Changed Mr-orange repo to Echel0n as Mr-Orange is no more! also added extra lines for issues when deleting sabnzbd folder not being able to reinstall.
v0.9 re-write to include user options to install SABnzbd, CouchPoato, SickBeard, Headphones, Mylar and NZBtoMedia scripts. Also includes python binding to include automatic updates for postprocessing scripts (this can be turned off with version 0.95)
V0.92 Error when starting Mylar with script freezing. Code cleanup.
V0.95 error with python fixed if bindmount set to 0
V0.98 rewrite to take advantage of python2.7.5 which allows env to call python correctly across the filesystem. No more need for messy hacks, hashbang editing, update failures or bindmounting
V0.99 Moved to Github and modified the shutdown/restart command. Final /ffp release. Script has been ported to Entware-ng for future developments.

To do:

*Modify kill command to shutdown program's cleanly. (Done)
*Look into integration with Slacker to add automated dependency install (any thoughts on this are welcome!) (no need as opkg is used with Entware-ng)
*Some issues experienced with SAB running post processing scripts (done)
* Alter shutdown commands to accept no username or password without returning "" (done)
* Add https support for shutdown sequence (done)
* Intermittent failure shutting down couchpotato causing script hang (timeout added to shutdown command)(no longer needed)
* Add kill command if couch shutdown fails (no longer needed)
* Have all three program's run as a standard user instead of running as root... (Potential security issues)
* Create instructions to set up Sickbeard TPB failed download handling (done)
* Port script to Entware-ng (done) http://forum.nas-central.org/viewtopic.php?f=249&t=18383


Last edited by burbulence on Tue Sep 06, 2016 7:44 am, edited 28 times in total.

Top
 Profile  
 
PostPosted: Tue Sep 03, 2013 2:00 pm 
Offline

Joined: Thu Jun 06, 2013 12:56 pm
Posts: 283
Sounds interesting .. keep up the great work :)

_________________
NAS: NSA 325
FW : NSA325_V4.70(AAAJ.0)
FFP : v0.7 on HDD

    Running SickBeard (vMaster)
    Running NZBGet (v15)
    Running Transmission (v2.84)
    Running Darkstat


Top
 Profile  
 
PostPosted: Sun Sep 08, 2013 9:38 pm 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
Winterwolf wrote:
Sounds interesting .. keep up the great work :)

Thanks, i think i am close to v.1 of the complete script. Its not pretty but it will download set up and start Sabnzbd SickBeard and CouchPotato, i am working on it being able to detect if it is first run where it will set up all the required folders and permissions before installing the programs or if it is on a subsequent run it will skip folder creation and complete the install (to update them) This is perhaps a bit over the top as CouchPotato and Sickbeard will inform you of an available update and complete the process. i'd like it to detect the current version of each program from and update if needed, i'll get to that at some point.

If anyone is interested in testing this script please let me know i will up it here... it comes with prerequisites which i will explain and hopefully it will be easier than the current install process


Last edited by burbulence on Wed Apr 23, 2014 9:41 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Sep 13, 2013 10:11 am 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
burbulence wrote:
Winterwolf wrote:
Sounds interesting .. keep up the great work :)

Thanks, i think i am close to v.1 of the complete script. Its not pretty but it will download set up and start Sabnzbd SickBeard and CouchPotato, i am working on it being able to detect if it is first run where it will set up all the required folders and permissions before installing the programs or if it is on a subsequent run it will skip folder creation and complete the install (to update them) This is perhaps a bit over the top as CouchPotato and Sickbeard will inform you of an available update and complete the process. i'd like it to detect the current version of each program from and update if needed, i'll get to that at some point.

If anyone is interested in testing this script please let me know i will up it here... it comes with prerequisites which i will explain and hopefully it will be easier than the current install process


Getting closer, it works! but is messy at the moment regarding HTTPS connections to GitHub, has anyone any ideas on how to remove the error below without using env GIT_SSL_NO_VERIFY=true command as i the example in my first post on this thread?

I need to add certificates to my /ssl folder (i think)???

Code:
error: SSL certificate problem: unable to get local issuer certificate while accessing https://github.....etc


Last edited by burbulence on Wed Apr 23, 2014 9:41 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Sep 13, 2013 11:00 am 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2310
Code:
git config --system http.sslverify false
-without ssl or better way:
Code:
git config --system http.sslcainfo /ffp/etc/ssl/certs/cacert.pem
-with ssl


Top
 Profile  
 
PostPosted: Fri Sep 13, 2013 12:15 pm 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
thanks for the tip, unfortunately i get this error after running the command

Code:
git clone https://github.com/midgetspy/Sick-Beard
Cloning into 'Sick-Beard'...
error: SSL certificate problem: unable to get local issuer certificate while accessing https://github.com/midgetspy/Sick-Beard/info/refs?service=git-upload-pack
fatal: HTTP request failed


Top
 Profile  
 
PostPosted: Fri Sep 13, 2013 2:41 pm 
Offline

Joined: Sun Apr 29, 2012 5:24 pm
Posts: 2310
Ooops... :mrgreen: Forgotten about certificate itself. Correct way is:
Code:
wget http://curl.haxx.se/ca/cacert.pem -O /ffp/etc/ssl/certs/cacert.pem
Code:
git config --system http.sslcainfo /ffp/etc/ssl/certs/cacert.pem
Code:
git clone https://github.com/midgetspy/Sick-Beard
Tested and working.

P.S. Maybe you should use
Code:
mkdir -p /ffp/etc/ssl/certs
before wget command. Slacker repos has different openssl releases and they can have different dir structure.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 1:19 am 
Offline

Joined: Wed Sep 18, 2013 1:16 am
Posts: 5
I would love to test.

Just got an NSA325 and updated to latest FW (4.61) and have been having a rough go at setting up SAB (I could follow the wiki directions and get .64 running, but couldn't update, so I have ffp and slacker and an assortment of libs installed already.)

I like the hardware, but the lack of "turn key" packages, compared to synology, is a bit of a bummer.


Top
 Profile  
 
PostPosted: Wed Sep 18, 2013 8:36 pm 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
Hi, ok so the script is by no means finished, but you can use it to install configure and download SAB sickbeard and couchpotato... if you start from scratch and follow the instructions there shoudnt be too many blanks!

On a side note if anyone out there can offer script improvements I will be more that grateful!


How To Install SickBeard Couchpotato and SABnzbd on a zyxel NSA 325(and possibly other Zyxel NAS drives)

YOU MUST REINSTALL FFP IF UPGRADING TO V0.98 OF THE SCRIPT

I have only tested this on an NSA325 so cannot confirm it will work on anything other than a 325. Others have confirmed it works on a 325v2, 320, and 310 also possible to run on the 5xx series NAS

This is my first attempt at script writing and I take no responsibility for any data loss etc running this script may cause

Setting up the NAS from factory defaults:

Remove FFP from the web interface under packages, remove all preferences/settings when prompted -- There is no other way!!!

1) Install Fonz Fun Plug 0.7

Either install and run from a USB stick following these instructions http://zyxel.nas-central.org/wiki/FFP-stick

Or Install as a Zypkg following these instructionshttp://zyxel.nas-central.org/wiki/FFP_as_zypkg
Or checkout Mijzelf's metarepository install - probably the easiest http://forum.nas-central.org/viewtopic.php?f=249&t=14553

Both have their advantages, running from USB leaves the filesystem on the NAS pretty much as stock, but if you are using it as a long term solution i prefer to install as a zypkg,

2) Install uwsiteloader - Open terminal or Putty and run the following commands.

ssh root@nas.ip.address
enter your root (admin) password
Code:
wget http://wolf-u.li/u/441 -O /ffp/bin/uwsiteloader.sh
   chmod a+x /ffp/bin/uwsiteloader.sh
   uwsiteloader.sh


select all sites using the up/down arrows and spacebar select OK and hit enter to update.

3) In terminal or Putty
Code:
slacker -Uui br2:python
choose the following "python 2.7.x, pip-1.5.4 and setuptools-3.4.4"

4) Run each of these and install the packages, if they do not show in list they are already installed
Code:
slacker -ui s:bzip2 s:zlib br2:expat br2:gcc-solibs uli:gdbm-1.10 br2:gettext br2:libiconv br2:libffi br2:ncurses br2:openssl br2:readline mz:sqlite-3.7.10 mz:zyxel_utils

Code:
slacker -ui s:autoconf s:automake s:binutils s:bison s:flex br2:intltool s:gcc s:gmp s:linux-headers s:make-3.81 s:mpfr s:pkg-config s:uClibc

Code:
slacker -ui br2:curl memiks:par memiks:par2cmdline  memiks:unrar memiks:git s:mpc s:libxml2 uli:libxslt s:libgpg-error s:libgcrypt br2:rtmpdump


5)Then run this command, it will take a while to complete and sometimes look like it has frozen, leave it grab a coffee/beer whatever.
Code:
pip install cheetah feedparser pyOpenSSL pysqlite cryptography==0.6 lxml

It should finish with the following message
Quote:
Successfully installed cheetah feedparser pyOpenSSL pysqlite Markdown cryptography six cffi pycparser lxml

make sure above line is the same as your output.

use the cryptography==0.6 as the later version has a bug.

See HERE for more info and a link to pypi packages.

6) Download V0.99 Final FFP release from HERE, the zip includes the script and the config file


V0.9x has had some major changes to previous releases, it now calls a config file which contains the file structure setup information. it also contains user adjustable settings to give you the option of installing or skipping certain programs (See section 7).


Give the script a name, for example autonzb.sh, and save it to /ffp/start (use filezilla or your favourite sftp client, it is easiest to copy files to the NAS) make sure it is saved as plain text, no formatting etc.

7) Open the config.cfg file. Open it with a text editor and set Sabnzbd CouchPotato Sickbeard Headphones Mylar and Nzbtomedia to either 1 for Install or 0 for skipped.

Also save it to /ffp/start

8) type
Code:
sh zyxel_utils hook /usr/bin
ln -sf /ffp/bin/env /usr/bin/env


9) Back in Terminal type:
Code:
cd /ffp/start
sh yourscriptname.sh (replacing yourscriptname with the actual name of the script)

It should now be configuring your folder locations needed for the installation of SABnzbd CouchPotato and SickBeard, installing the program data and starting them.
Type
Code:
chmod a+x yourscriptname.sh

This will run the script during startup of the NAS


10) after the script has completed open your web browser and browse to:

Your.NAS.IP:8081 (For Sickbeard)
Your.NAS.IP:5050 (For CouchPotato)
Your.NAS.IP:8085 (For SABnzbd)
Your.NAS.IP:8181 (For Headphones)
Your.NAS.IP:8090 (For Mylar)

SABnzbd and CouchPotato should open in wizard mode, complete the setup to your preferences.
SickBeard Headphones and Mylar will start to a blank database again to configure to you preferences.
All preferences will be saved to /i-data/md0/admin/configuration/...

11) The script will check for updates each time it is run, and if available, download and install them. it will also run the programs on each startup. I have set the script to run each time the NAS starts up on my NAS, i suggest doing the same:

add all your settings to autoProcessMedia.cfg ie

[SickBeard]
sbCategory = tv
host = localhost
port = 7071
username =
password =
web_root =
ssl = 0
delay = 0
watch_dir =
fork = auto
delete_failed = 0

see the wiki for more info on setup for postprocessing script and failed download handling Here

also follow these instructions to complete setup in SABnzbd

Please let me know your results...

It is also necessary to turn off automatic updates in Couchpotato as they will cause it to crash. the script updates all 3 programs if available each time it is run, so you could set a cronjob to run the script as often as you like.

Another good tool is lddd, it will scan your ffp install for missing dependencies which will help troubleshooting. More info Here


Last edited by burbulence on Sun May 15, 2016 8:39 am, edited 75 times in total.

Top
 Profile  
 
PostPosted: Thu Sep 19, 2013 2:23 am 
Offline

Joined: Wed Sep 18, 2013 1:16 am
Posts: 5
thanks.

Oddly tried i as a shellscript (notepad++ on win7) and got an assortment of errors,
I accidentally copied the whole thing into terminal, and it went abouts it's business

sickbeard started, but not sab or couchpotato.

edit2: added terminal output

root@NSA325:~# cd /ffp/start
root@NSA325:/ffp/start# pwd
/ffp/start
root@NSA325:/ffp/start# sh sabscript.sh
: command not found2:
: command not found3:
: command not found22:
: command not found30:
: command not found34:
sabscript.sh: line 70: syntax error near unexpected token `else'
'abscript.sh: line 70: ` else
root@NSA325:/ffp/start#

edit: I used VI on the machine to make the shell script, and it didn't have the above errors, my guess is notepad++ add some junk like carriage returns that got interpreted.


Last edited by gossipninja on Thu Sep 19, 2013 1:35 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: Thu Sep 19, 2013 5:14 am 
Offline

Joined: Wed Sep 18, 2013 1:16 am
Posts: 5
further notes.

edited
"else
sudo -u nobody PYTHON_EGG_CACHE=/tmp "/ffp/bin/python2.7" "/ffp/bin/sabnzbd"/SABnzbd.py -b 0 -d -s 0.0.0.0:8085 -f "$sabconfig"
to
PYTHON_EGG_CACHE=/tmp "/ffp/bin/python2.7" "/ffp/bin/sabnzbd"/SABnzbd.py -b 0 -d -s 0.0.0.0:8085 -f "/i-data/md0/admin/configuration/sabnzbd/sabnzbd.ini"

and copied over my desktop (win based) sab config ini (changing the port and the unrarpw to 1) and sab loads fine, with all my servers and such configured.


I don't really use cpotato, so I havent mess with it


Top
 Profile  
 
PostPosted: Thu Sep 19, 2013 7:30 am 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
gossipninja wrote:
thanks.

Oddly tried i as a shellscript (notepad++ on win7) and got an assortment of errors,
I accidentally copied the whole thing into terminal, and it went abouts it's business

Edit: sickbeard started, but not sab or couchpotato.

edit2: added terminal output

root@NSA325:~# cd /ffp/start
root@NSA325:/ffp/start# pwd
/ffp/start
root@NSA325:/ffp/start# sh sabscript.sh
: command not found2:
: command not found3:
: command not found22:
: command not found30:
: command not found34:
sabscript.sh: line 70: syntax error near unexpected token `else'
'abscript.sh: line 70: ` else
root@NSA325:/ffp/start#


There were a few errors on the script which i've edited now...

When you saved in notepad++ did you save EOL conversion as unix based, sorry cant remember the exact wording as I'm not on windows... I think it's under edit menu.
Try running the script again by sh -x sabscript.sh and post the output,

Thanks

Also why did you remove the sudu command? To start SAB?


Top
 Profile  
 
PostPosted: Thu Sep 19, 2013 1:51 pm 
Offline

Joined: Wed Sep 18, 2013 1:16 am
Posts: 5
I updated the shell script, notepad++ was set to unix format.

here is console output
Code:
login as: root
root@192.168.254.24's password:
== Welcome at FFP version 0.7/arm, running on NSA325 NSA325, firmware NSA325_4.61(AAAJ.1) ==
root@NSA325:~# sh /ffp/start/sab.sh
--09:45:41--  http://sabnzbd.org/download/
           => `-'
Resolving sabnzbd.org... 108.162.197.65, 108.162.196.65
Connecting to sabnzbd.org[108.162.197.65]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [ <=>                                                                     ] 12,776        --.--K/s

09:45:41 (366.93 KB/s) - `-' saved [12776]

SABnzbd already latest version
Traceback (most recent call last):
  File "/ffp/bin/sabnzbd/SABnzbd.py", line 1840, in <module>
    main()
  File "/ffp/bin/sabnzbd/SABnzbd.py", line 1084, in main
    res, msg = config.read_config(inifile)
  File "/usr/local/zy-pkgs/ffproot/ffp/bin/sabnzbd/sabnzbd/decorators.py", line 31, in newFunction
    return f(*args, **kw)
  File "/usr/local/zy-pkgs/ffproot/ffp/bin/sabnzbd/sabnzbd/config.py", line 655, in read_config
    return _read_config(path)
  File "/usr/local/zy-pkgs/ffproot/ffp/bin/sabnzbd/sabnzbd/config.py", line 686, in _read_config
    CFG = configobj.ConfigObj(path)
  File "/usr/local/zy-pkgs/ffproot/ffp/bin/sabnzbd/sabnzbd/utils/configobj.py", line 1242, in __init__
    self._load(infile, configspec)
  File "/usr/local/zy-pkgs/ffproot/ffp/bin/sabnzbd/sabnzbd/utils/configobj.py", line 1249, in _load
    h = open(infile, 'rb')
IOError: [Errno 13] Permission denied: '/i-data/md0/admin/configuration/sabnzbd/sabnzbd.ini'
From https://github.com/RuudBurger/CouchPotatoServer
 * branch            HEAD       -> FETCH_HEAD
Already up-to-date.
From https://github.com/midgetspy/Sick-Beard
 * branch            HEAD       -> FETCH_HEAD
Already up-to-date.
root@NSA325:~#


I know "/i-data/md0/admin/configuration/sabnzbd/sabnzbd.ini" is present (I wonder if that is why the error, it is trying to make a file that is already there?) and is used when I load up NASIP:8085.
Sab and Sick load, but couchpotato doesn't.

I do appreciate the help, and this script is very certainly easier than the more complex methods I have read about.


Top
 Profile  
 
PostPosted: Thu Sep 19, 2013 3:20 pm 
Offline

Joined: Sun Feb 17, 2013 10:00 pm
Posts: 308
Its a permissions error, sab cannot access the ini, run

chmod -R 777 /i-data/md0/admin/configuration/sabnzbd

Its because you edited the sabnzbd start command to remove run as user nobody, which the script modifies the access permissions to that user

As for the Couch issue, is the script set to run during startup?

If so just try a restart, I had the same issue at one point but it seemed to be couch running multiple times due to me re running the script over and over while testing, it's on the to do list to sort out


Top
 Profile  
 
PostPosted: Fri Sep 20, 2013 12:05 am 
Offline

Joined: Wed Sep 18, 2013 1:16 am
Posts: 5
burbulence wrote:
Its a permissions error, sab cannot access the ini, run

chmod -R 777 /i-data/md0/admin/configuration/sabnzbd


I had the ini chmodded, not the whole DIR.

Awesome, now couch works too.

Thanks so much for this. I, and hopefully the community, appreciate it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 723 posts ]  Go to page 1, 2, 3, 4, 5 ... 49  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 67 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group