Installing Transmission on TonidoPlug

Boot from a SATA or USB drive before installing Transmission.
Do not install Transmission on the TonidoPlug’s internal flash. It will VOID your warranty.

This guide is written for the TonidoPlug 2. It has not been tested on the TonidoPlug 1.

Introduction

Transmission is a feature rich and well supported bit torrent client.

There are two ways to install Transmission on the TonidoPlug:

  • The Easy Way: From the Debian Squeeze repositories using the apt-get
    • Pros: Fast, simple. Up and running in minutes
    • Cons: Not the latest version of Transmission. Lacks features like blocklists and is somewhat less stable.
    • Current version: 2.03
  • The Fun Way: From the Transmission sources.
    • Pros: Latest stable version. All the current features, better performance.
    • Cons: Not simple. Takes about and hour. Many steps.
    • Current version: 2.81

The content for this guide is largely taken from the Tonido User Forums, in particular, posts by geeknam and pmcallihan and from the Arch Linux Guide to Installing Transmission

Installing Transmission From Repository Using apt-get

1. SSH into the Tonido Plug.

2. Change to the root directory.

  cd /

3. Update the repository package database.

  apt-get update

4. Upgrade all installed packages.

  apt-get upgrade

5. Install the transmission components.

  apt-get install transmission-cli transmission-common transmission-daemon

6. Stop transmission.

  /etc/init.d/transmission-daemon stop

7. Open the setting.json file in the nano editor.

  nano /var/lib/transmission-daemon/info/settings.json

In order to manage transmission remotely, either from the browser or with a GUI, some rpc settings in the settings.json file must be changed. Both the rpc-authentication AND the rpc-whitelist must be changed in order to connect successfully.

8. Change the rpc username and password.

  set "rpc-username": "<<your rpc username>>",
  set "rpc-password": "<<your rpc password>>",  

9. Change the rpc-whitelist so that you can connect to transmission from another computer.

  set rpc-whitelist": "127.0.0.1, <<your ip range>>",
    
  Example: "rpc-whitelist": "127.0.0.1, 192.168.0.*"
  This will allow connections from all IP’s in the range 192.168.0.1 to 192.168.0.255     

10. Save the changes to the setting.json file: CRTL-o, followed by ENTER.

11. Exit nano: CRTL-x.

12. Restart transmission.

   /etc/init.d/transmission-daemon start

13. Connect to the transmission client from a browser @ http://tonidoplug_address:9091 or from a GUI such as the Transmission Remote GUI.


Sources: http://www.tonido.com/forum/viewtopic.php?f=33&t=2138, http://archlinuxarm.org/support/guides/applications/transmission

Installing Transmission from the Source Code

These instructions are based almost entirely on the work of pmcallihan

Setup the build environment

1. To install transmission from the sources you must first set up a build environment.

2. SSH into the Tonido Plug.

3. Go to the root directory

 cd /

4. Set up a working directory if one does not already exist, and go to it.

 mkdir src
 cd /src

5. Install some additional dependencies. (about 3 minutes)

 apt-get install libcurl4-openssl-dev

Build from the source code

6. Transmission requires a libevent package >= 2.0. It is not available in the Debian Squeeze repositories, so let’s build it with the following commands: (about 15 minutes)

 wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
 tar xvfz libevent-2.0.21-stable.tar.gz
 cd libevent-2.0.21-stable
 ./configure
 make && make install
 ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
 cd ..

7. Get the source code for transmission and build it. (about 15 minutes)

 wget http://download.transmissionbt.com/files/transmission-2.81.tar.xz
 tar xvpf transmission-2.81.tar.xz
 cd transmission-2.81
 ./configure --enable-lightweight
 make && make install
 ln -s /usr/local/bin/transmission-daemon /usr/local/sbin/transmission-daemon
 cd ..

Setup a user for transmssion and the download locations.

It’s a good idea to create for transmission to run under (It is generally a bad idea to run transmission as root)
Configuration directory: /home/.transmission (note the ”.” makes the directory invisible)
Download directory: /home/download (you can put this anywhere, even on another disk)

8. Return to the root directory.

 cd /

9. Create a user for transmission to run under.

 adduser --system --group --no-create-home --quiet transmission   

10. Make the download and configuration directories, and give the transmission user permissions to them.

  mkdir /home/downloads /home/.transmission
  chown -R transmission:transmission /home/downloads /home/.transmission
  chmod -R 775 /home/.transmission /home/downloads  

Setup the daemon files

11. Create the default transmission-daemon script at /etc/default.

  nano /etc/default/transmission-daemon

12. Paste the following into the file:

  ENABLE_DAEMON=1
  CONFIG_DIR="/home/.transmission"
  OPTIONS="--config-dir $CONFIG_DIR"

13. Save and close the file.

  CRTL-o
  ENTER
  CRTL-x

14. Create the init.d script named transmission-daemon at /etc/init.d.

  nano /etc/init.d/transmission-daemon

15. Paste the following into the file.

#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO

NAME=transmission-daemon
DAEMON=/usr/local/bin/$NAME
USER=transmission
STOP_TIMEOUT=3

export PATH="${PATH:+$PATH:}/sbin"

[ -x $DAEMON ] || exit 0

[ -e /etc/default/$NAME ] && . /etc/default/$NAME

. /lib/lsb/init-functions

start_daemon () {
if [ $ENABLE_DAEMON != 1 ]; then
log_progress_msg "(disabled, see /etc/default/${NAME})"
else
start-stop-daemon --start \
--chuid $USER \
--exec $DAEMON -- $OPTIONS
fi
}

case "$1" in
start)
log_daemon_msg "Starting bittorrent daemon" "$NAME"
start_daemon
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON --retry $STOP_TIMEOUT \
--oknodo
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON \
--oknodo --signal 1
log_end_msg 0
;;
restart|force-reload)
log_daemon_msg "Restarting bittorrent daemon" "$NAME"
start-stop-daemon --stop --quiet \
--exec $DAEMON --retry $STOP_TIMEOUT \
--oknodo
start_daemon
log_end_msg 0
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}"
exit 2
;;
esac

exit 0

16. Save changes and exit nano.

  CRTL-o
  ENTER
  CRTL-x   

17. Make the daemon file executable.

  chmod a+x /etc/init.d/transmission-daemon   

18. Make transmission start on boot.

  update-rc.d transmission-daemon defaults

Setup the configuration file

19. Stop, start and stop the transmission-daemon to create the default settings.json file.

  /etc/init.d/transmission-daemon stop
  /etc/init.d/transmission-daemon start
  /etc/init.d/transmission-daemon stop

20. Edit the settings.json file in nano

  nano /home/.transmission/settings.json

21. Change the download directory

  "download-dir": "/home/downloads",

22. Change the rpc-whitelist, where XXX.YYY.*.* is your ip address range, and enable the whitelist.

  "rpc-whitelist": "127.0.0.1,XXX.YYY.*.*",
  "rpc-whitelist-enabled": true,  

23. Change the RPC username and password, and require RPS authentication.

  "rpc-username": "your_transmission_username",
  "rpc-password": "your_transmission_password",
  "rpc-authentication-required": true,  

24. Save changes and exit nano.

  CRTL-o
  ENTER
  CRTL-x

Running Transmission

25. Start transmission

 /etc/init.d/transmission-daemon start

26. On a browser, goto http:<your-plug-ip>:9091. Login with the rpc username and password that you put in the setting.json file.


Sources: http://www.tonido.com/forum/viewtopic.php?f=37&t=4130, http://archlinuxarm.org/support/guides/applications/transmission

Advanced Settings

Information about all the config files, command line switches and various other settings can be found in the Transmission Wiki.

Blocklists

To enable a single blocklist:

1. Stop transmission.

 /etc/init.d/transmission-daemon stop

2. Edit the settings.json file in nano.

  nano /home/.transmission/settings.json

3. Change the blocklists settings.

 "blocklist-enabled": true,
 "blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",

This is an example of a blocklist url. Free and paid blocklist are widely available.
Transmission supports P2P Plaintext Format and DAT Format in gzip (gz) arechives. More info can be found here.

4. Save and close the json file.

5. Start transmission.

 /etc/init.d/transmission-daemon start

6. Log into the transmission web interface, click on the settings icon in the lower right, select “update blocklist”. The blocklist is now active. This can also be done from a transmission GUI.