This article explains how to install a Transmission peer-2-peer client on a DNS-325.
Transmission client on a DNS-325 is very interesting for different aspects :
- Usually, a NAS is running 7/7 – 24/24
- Transmission is fully Web controlled
- It is using very less RAM
- It is very light on CPU power
- It is offering lots of parameters (ports limitation, speed throttle, …)
- So, with this setup, you will be able to serve 24h/24 your latest Linux distributions torrents from home without any computer on.
As a pre-requisite, you must have installed Fun_plug 0.7 and declared Slacker repositories following DNS 325 – Fun_plug 0.7 : Extend your NAS possibilities.
This procedure should also be compatible with a DNS-320, which is running the same system with less memory and less processor power.
1. Install the packages
First thing to do is to connect to your NAS thru SSH. All following commands are issued from the NAS prompt.
At the same time as Transmission, you need to install CURL package, a command line tool for transferring data with URL syntax.
Installation is done via stacker :
# slacker -a
Within slacker, you need to select the following packages :
kylek:Transmission-2.52 +
s:curl-7.21 +
Once packages selected, press Enter to install.
2. Create the Execution Environment
For Transmission running environment, we have to create 2 directories :
– one for the downloaded files, which will be available thru a samba share
– one for the transmission database
This is done with the following commands :
# mkdir /mnt/HD/HD_a2/torrent
# chown -R nobody /mnt/HD/HD_a2/torrent
# mkdir /ffp/var/transmission
# mkdir /ffp/var/transmission/incomplete
# chown -R nobody /ffp/var/transmission
These directories have to be declared in the transmission configuration
# mc -e /ffp/start/transmission.sh
/ffp/start/transmission.sh
...
TRANSMISSION_HOME=/ffp/var/transmission
...
3. First launch
To create the transmission configuration file /ffp/var/transmission/settings.json, you have to manually launch the client a first time with the appropriate environment.
This first launch command will set :
– the username and password to be used to connect thru the web user interface
– the directory /mnt/HD/HD_a2/torrent where completed torrents will be stored
– the network mask allowed to connect thru the web interface (here 127.0.0.1 & 192.168.x.x)
# su nobody -c "transmission-daemon -f -g /ffp/var/transmission -w /mnt/HD/HD_a2/torrent -t -u username -v password -a 127.0.0.1,192.168.*.*"
[18:46:11.233] Transmission 2.52 (13309) started (session.c:718)
[18:46:11.233] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:803)
[18:46:11.233] RPC Server Adding address to whitelist: 192.168.*.* (rpc-server.c:803)
[18:46:11.233] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:997)
[18:46:11.233] RPC Server Whitelist enabled (rpc-server.c:1001)
[18:46:11.233] RPC Server Password required (rpc-server.c:1004)
[18:46:11.234] UDP Failed to set receive buffer: requested 4194304, got 217088 (tr-udp.c:75)
[18:46:11.234] UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:80)
[18:46:11.234] UDP Failed to set send buffer: requested 1048576, got 217088 (tr-udp.c:86)
[18:46:11.234] UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:91)
[18:46:11.234] DHT Generating new id (tr-dht.c:309)
[18:46:11.234] Using settings from "/ffp/var/transmission" (daemon.c:488)
[18:46:11.235] Saved "/ffp/var/transmission/settings.json" (bencode.c:1731)
[18:46:11.235] transmission-daemon requiring authentication (daemon.c:508)
[18:46:11.235] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:72)
[18:46:11.235] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:72)
[18:46:11.235] Port Forwarding (UPnP) Found Internet Gateway Device "http://192.168.x.x:5555/ctl/IPConn" (upnp.c:202)
[18:46:11.235] Port Forwarding (UPnP) Local Address is "192.168.x.x" (upnp.c:204)
[18:46:11.236] Port Forwarding (UPnP) Port forwarding through "http://192.168.x.x:5555/ctl/IPConn", service "urn:schemas-upnp-org:service:WANIPConnection:1". (local address: 192.168.x.x:51413) (upnp.c:279)
[18:46:11.236] Port Forwarding (UPnP) Port forwarding successful! (upnp.c:282)
[18:46:11.236] Port Forwarding Forwarded (port-forwarding.c:93)
You can stop the process by pressing CTRL+C.
4. Configuration of settings.json
The configuration file /ffp/var/transmission/settings.json has been created and can be modified.
# nano /ffp/var/transmission/settings.json
/ffp/var/transmission/settings.json
...
"incomplete-dir": "/ffp/var/transmission/incomplete",
"incomplete-dir-enabled": true,
...
"peer-port": 11000,
"peer-port-random-high": 11999,
"peer-port-random-low": 11001,
...
"rpc-enabled": true,
"rpc-password": "password",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "username",
"rpc-whitelist-enabled": false,
...
Once modified, you need to apply back the access right, to enable the transmission start at boot. You can also start the daemon.
# chown -R nobody /ffp/var/transmission
# chmod a+x /ffp/start/transmission.sh
# /ffp/start/transmission.sh start
5. Router Port Forwarding
As Transmission client has been configure to use port 11000 to 11999, you now need to setup your home router port forwarding for this TCP range.
So, on your home router you need to configure port forwarding as follow :
protocol : TCP
port range : 11000 – 11999
Address : your DNS-325 IP address on the LAN
Once this is done, you just need to connect at http://YourNasIpAddress:9091/.
6. Access thru a Reverse Prxy
If your DNS 325 is not directly accessible from internet, you can configure your Apache 2 web server to act as a reverse prxy to forward all the traffic from an Internet URL to your DNS 325 transmission client inside your LAN.
To configure the reverse prxy, you just need to declare the following lines in your Apache 2 virtual host :
/path/to/apache/configuration/file
PrxyRequests Off
<Prxy *>
Order deny,allow
Allow from all
</Prxy>
# DNS-325 - Transmission reverse prxy
PrxyPass /transmission/ http://192.168.x.x:9091/transmission/
PrxyPassReverse /transmission/ http://192.168.x.x:9091/transmission/
where 192.168.x.x is the LAN address of your DNS-325.
After an Apache 2 restart, you will be able to access your DSN-325 transmission client from :
http://your.site.name/transmission/web/ if your host is a standard HTTP host
https://your.site.name/transmission/web/ if your host is a SSL one
It is obviously advised to use a SSL reverse prxy !
Done
Your torrents are waiting for you …
#ffp, #ffp-0-7, #linux, #nas, #torrent, #transmission