📜 ⬆️ ⬇️

Install pyload as standalone rocking for ReadyNAS DUO v2

For downloading ReadyNAS torrents on the home site, addons has a transmission, and it's not a problem to install it.
But, at the same time, simple ftp / http rocking, to my regret and surprise, I did not find there. This is a misunderstanding I propose to correct.

Pyload WebGUI

First you need to install EnableROOT from the addons for further comfortable configuration via ssh.
We download the EnableRootSSH_1.0-arm.bin and install it via the ReadyNAS admin panel.
We will be asked to reboot, after which ssh will be available on the standard port with the login root and your current password from the admin panel.

To connect, you can use the kitty. Recently, I prefer to use it instead of putty - because it has utf8 default encoding for new connections.
')
Here's what the ReadyNAS DUO v2 (version FW 5.3.8) is:

cat / etc / debian_version
6.0.3

uname -a
Linux nas 2.6.31.8.duov2 # 1 Thu Apr 18 18:24:47 HKT 2013 armv5tel GNU / Linux

cat / proc / cpuinfo
Processor: Feroceon 88FR131 rev 1 (v5l)
BogoMIPS: 1599.07
Features: swp half thumb fastmult edsp
CPU implementer: 0x56
CPU architecture: 5TE
CPU variant: 0x2
CPU part: 0x131
CPU revision: 1
Hardware: Feroceon-KW
Revision: 0000
Serial: 0000000000000000

cat / proc / meminfo
MemTotal: 246820 kB
MemFree: 24188 kB
Buffers: 6056 kB
Cached: 104700 kB
SwapCached: 12 kB
Active: 96728 kB
Inactive: 101508 kB
Active (anon): 36812 kB
Inactive (anon): 51176 kB
Active (file): 59916 kB
Inactive (file): 50332 kB
Unevictable: 16 kB
Mlocked: 4 kB
SwapTotal: 524268 kB
SwapFree: 524256 kB
Dirty: 92 kB
Writeback: 0 kB
AnonPages: 87504 kB
Mapped: 28332 kB
Slab: 15456 kB
SReclaimable: 3764 kB
SUnreclaim: 11692 kB
PageTables: 2052 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 647676 kB
Committed_AS: 610212 kB
VmallocTotal: 385024 kB
VmallocUsed: 940 kB
VmallocChunk: 382812 kB


On a note

ReadyNAS marketers are pushing under the name FLEX-RAID & X-RAID2 ... mdadm. Only shh!


Update the packages available from the base repository and install the necessary dependencies:
#apt-get update #apt-get install python python-beaker python-crypto python-imaging python-jinja2 python-openssl python-pycurl tesseract-ocr-eng unzip nano 


Since samba is mainly used to access downloaded files, we need to upload our files with the same user / group permissions as samba - nobody: nogroup. There is also an alternative (less hemorrhoid) option to leave everything as it is, and run pyload as root, but change the user / group with the means of pyload itself. For myself, I chose the first option (yes, Gentushnik).

Downloading the pyload sources:
 #cd /opt #wget https://github.com/pyload/pyload/archive/stable.zip #unzip stable.zip && mv pyload-stable pyload #touch /opt/pyload/pyload.pid && chown –R nobody:nogroup /opt/pyload #usermod –s /bin/bash nobody 


Now we proceed directly to setting up pyload.
Let's run in configuration mode - the careful pyload will check the features available to it and report it.

#cd /opt/pyload && su nobody -c "python pyLoadCore.py –s"
Exhaust should be similar (sheet):
Choose your Language / Wähle deine Sprache ([en], de, fr, it, es, nl, sv, ru, pl, cs, sr, pt_BR): Enter

// You can change the installation language.

Welcome to the pyLoad Configuration Assistent.
It will check your system and make a basic setup in order to run pyLoad.

The value in brackets [] always is the default value,
you are unsure what to choose, just hit enter.
Don't forget: you can always start pyLoadCore.
If you hit STRG-C,
to start with pyLoadCore automatically anymore.

When you are ready to check, hit enter. Enter

## System Check ##
Python Version: OK
pycurl: OK
sqlite3: OK

pycrypto: OK
py-OpenSSL: OK

py-imaging: OK
tesseract: OK

PyQt4: missing

jinja2: OK
beaker: OK
JS engine: missing

System check finished, hit enter status report. Enter

## Status ##

Features available: container decrypting, ssl connection, automatic captcha decryption, Webinterface

Featues missing:

Gui not available
The Graphical User Interface.

no JavaScript engine found
You will need to click here. Install Spidermonkey, ossp-js, pyv8 or rhino
Fix it up.
Continue with setup? ([y] / n): Enter

// I clamped resources and unwilling to overload the system. You can try to put rhino or spidermonkey.

Do you want to change the config path? Current is /root/pyload/.pyload
If you use it, it’s a good idea to change it.
Change config path? (y / [n]): Enter

// In my case, the saved path was pulled. Specify your - /root/pyload/.pyload

Do you want to configure login data and basic settings?
This is recommend for first run.
Make basic setup? ([y] / n): Enter

## Basic Setup ##

The following logindata is valid for CLI, GUI and webinterface.
Username [User]: pyload
Password:
Password (again):

// Drive in your data. Please note that the admin user is permanent on the system and cannot be deleted.

External clients (GUI, CLI or other) need to get access to work over the network.
However, you can save ram.
Enable remote access ([y] / n): n

// If you decide to try an rpc client from a PC, then you probably need to turn it on (more on that later).

Language ([en], de, fr, it, es, nl, sv, ru, pl, cs, sr, pt_BR): Enter
Downloadfolder [download]: / d / media2 / pyload

// My disk is divided into 2 volumes of 2 TB each. I'm greedy, what to do.

Max parallel downloads [3]: Enter
Use Reconnect? (y / [n]): Enter

Do you want to configure ssl?
Configure ssl? (y / [n]): Enter

// In the case of the choice of a threaded server, you need to enable it, and do not forget to generate keys with commands that the configurator spits out (more on this later).

Do you want to configure webinterface?
Configure webinterface? ([y] / n): Enter

## Webinterface Setup ##

Activate webinterface? ([y] / n): Enter

Listen address, if you use 127.0.0.1 or localhost, the web interface will only be accessible locally.
Address [0.0.0.0]: Enter
Port [8000]: Enter

// Port to taste, just not overlap with already running services.

pyLoad offers several server backends, now following a short explanation.
dont know which one to choose.
threaded: this server offers SSL and is a good alternative to builtin.
fastcgi: Can be used by apache, lighttpd, requires you to configure it.
lightweight: requires fast ordering and linux knowlegde.
Get it from here: github.com/jonashaag/bjoern , compile it
and copy bjoern.so to module / lib

Attention: If you notice problems with the webinterface
come back here.
Server ([builtin], threaded, fastcgi, lightweight): Enter

// I have tried different versions of web servers:
  • builtin: Tried it. Works. Stopped on it, as in the most unassuming version.
  • threaded: I tried. Works.
  • fastcgi: I haven't. On the official forum I came across problems with setting up wcgi. Hemorrhoids way. Skip
  • lightweight: failed to try. Installed the necessary tools to build and libev. When assembling buried in the error, why spat on this thing. Maybe someone will succeed (I spied here ).


Setup finished successfully.
Hit enter to exit and restart pyLoad


Congratulations, we have almost everything set up. Now we have to make a convenient launch of what we have done.

At first I decided to go to the forehead and make a makeshift autorun - I put the following entry in the crontab:
@reboot sh /root/pyload-start.sh

 root@nas:~# cat pyload-start.sh #!/bin/sh sleep 30 su nobody -c "/usr/bin/python /opt/pyload/pyLoadCore.py --daemon" 


Then, nevertheless, he entered more civilized. Create a startup script with the following content:
/etc/init.d/pyload
#! / bin / sh

### BEGIN INIT INFO
# Provides: pyload
# Required-Start: $ syslog $ local_fs $ network $ remote_fs
# Required-Stop: $ syslog $ local_fs $ network $ remote_fs
# Should-Start: $ remote_fs $ named
# Should-Stop: $ remote_fs $ named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts pyload daemon
# Description: this script runs the pyload service
### END INIT INFO

# Starts and stops the pyload daemon.

PATH = / bin: / usr / bin: / sbin: / usr / sbin
DAEMON = "/ usr / bin / python /opt/pyload/pyLoadCore.py"
PIDFILE = "/ opt / pyload / pyload.pid"

. / lib / lsb / init-functions

start () {
log_daemon_msg "Starting pyLoad server"

su nobody -c "$ DAEMON --daemon"

if [$? ! = 0]; then
log_end_msg 1
exit 1
else
log_end_msg 0
fi
}

stop () {
log_daemon_msg "Stoping pyLoad server"

su nobody -c "$ DAEMON --quit"

if [$? ! = 0]; then
log_end_msg 1
# exit 1
else
log_end_msg 0
fi
}

case "$ 1" in
start)
start
;;

stop)
stop
;;

force-reload)
stop
sleep 5
start
;;

restart)
stop
sleep 2
start
;;

*)
echo "Usage: $ 0 {start | stop | restart | force-reload}"
exit 1
;;
esac

exit 0


Making it executable:
 #chmod +x /etc/init.d/pyload 


And we force the service to start at the start:
 #update-rc.d pyload start 20 2 3 4 5 . stop 10 0 1 6 . 


We try to start and extinguish the service through an init-script:
 /etc/init.d/pyload start /etc/init.d/pyload stop 


I configured the openvpn tunnel to the home router, so the pyload web snout is available at my home address. If the reluctance to bother with openvpn - trite port forward on the router.

Pyload PyQT GUI

It is also possible to manage downloads through a separate program that over RPC (with SSL, if you have configured this) interacts with the pyload server. We download binaries for Windows pyload-v0.4.9-win.zip We are convincingly warned that the PyQT GUI is unstable, and it is better to use webGUI. I did not seem to fall and did not hang - maybe I exploited a little.

In order for ssl support to appear, you must answer in the affirmative in the configurator, as well as generate a self-signed certificate:
 openssl genrsa -out ssl.key 1024 openssl req -new -key ssl.key -out ssl.csr openssl req -days 36500 -x509 -key ssl.key -in ssl.csr > ssl.crt 


When setting up were used:
Pyload site
Pyload site: Install bjoern
Pyload forum: Script modification for booting Debian
Pyload forum: Running the download user

All positive and good luck!

Source: https://habr.com/ru/post/198110/


All Articles