Index
17-Oct-2011: initial release.
Introduction.
Downloading large files can go lighting fast or dead slow. To download files with the bittorent protocol you need a bittorent client. More convenient is to install a server on our home server and control that from the client workstations. If you then have a slow download that lasts several days you can safely turn of your client workstation while the server continues the download. We will install transmission on the server and allow clients to connect directly or by using a web browser.
Installation.
[root@homsrv ~]# pacman -S transmission-cli resolving dependencies... looking for inter-conflicts... Targets (1): transmission-cli-2.41-2 Total Download Size: 0.51 MB Total Installed Size: 3.32 MB Proceed with installation? [Y/n] :: Retrieving packages from extra... transmission-cli-2... 522.0K 788.7K/s 00:00:01 [######################] 100% (1/1) checking package integrity [######################] 100% (1/1) checking for file conflicts [######################] 100% (1/1) installing transmission-cli [######################] 100% If you want to run the Transmission daemon at boot, add transmissiond to the DAEMONS array in /etc/rc.conf. You have to set the user in /etc/conf.d/transmissiond. [root@homsrv ~]#
Configuration.
We configure the server to run as a normal user. This means that the configuration and changes to the configuration can be stored in the home directory of that user. It also means that if you set the permissions right for all the downloads, all other system users can move the downloaded results out of the download directory. We do this by setting the umask in the configuration to 002 instead of the default 022. The download directory will be set to /mnt/users with the permissions set for all home server users. See Samba and the NFS4 setup for the details on the /mnt/users directory.
First, create the torrent user and create the download directories:
[root@homsrv ~]# useradd -c "Transmission Torrent" -d /home/torrent -m \
-g users -s /bin/bash torrent
[root@homsrv ~]# mkdir -p /mnt/users/.incomplete /mnt/users/Downloads
[root@homsrv ~]# chown torrent:users /mnt/users/.incomplete /mnt/users/Downloads
[root@homsrv ~]# chmod 775 /mnt/users/.incomplete /mnt/users/Downloads
[root@homsrv ~]#
Then edit /etc/conf.d/transmissiond like this:
# example configuration file TRANSMISSION_HOME=/home/torrent TRANS_USER="torrent" TRANS_ARGS="--allowed 127.0.0.*,10.126.160.*"
Now start and stop the daemon so that the basic configuration file is created.
[root@homsrv ~]# /etc/rc.d/transmissiond start :: Starting Transmission Daemon [DONE] [root@homsrv ~]# /etc/rc.d/transmissiond stop :: Stopping Transmission Daemon [DONE] [root@homsrv ~]#
Edit /home/torrent/.config/transmission-daemon/settings.json:
{
"alt-speed-down": 1250,
"alt-speed-enabled": false,
"alt-speed-time-begin": 120,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 480,
"alt-speed-up": 70,
"bind-address-ipv4": "10.126.161.2",
"bind-address-ipv6": "2001:1af8:fecf:7ea1::2",
"blocklist-enabled": true,
"blocklist-url": "http://www.bluetack.co.uk/config/level1.gz",
"cache-size-mb": 4,
"dht-enabled": false,
"download-dir": "/mnt/users/Downloads",
"download-queue-enabled": true,
"download-queue-size": 5,
"encryption": 2,
"idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false,
"incomplete-dir": "/mnt/users/.incomplete",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": "default",
"pex-enabled": false,
"port-forwarding-enabled": false,
"preallocation": 1,
"prefetch-enabled": 1,
"queue-stalled-enabled": true,
"queue-stalled-minutes": 30,
"ratio-limit": 2,
"ratio-limit-enabled": true,
"rename-partial-files": true,
"rpc-authentication-required": false,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "{619fbb3ecaa0afd75728e8a0a9e1136640863108cQ2WN9ZE",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "",
"rpc-whitelist": "127.0.0.*,10.126.160.*",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 1000,
"speed-limit-down-enabled": true,
"speed-limit-up": 70,
"speed-limit-up-enabled": true,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 2,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
Important settings:
- Bind to the external network interface (eth1).
- Set the blocklist url.
- Set the download dir to /mnt/user/Download.
- Set the incomplete dir to /mnt/users/.incomplete and enable it.
- Set the umask to 2.
We must set these settings directly in the settings.json file because some settings cannot be set from a client. Most other settings can be set from a client. Using a separate incomplete directory in a hidden directory has the advantage that users cannot manipulate the downloads before they are complete. The daemon will move a download to the normal download directory as soon as a download is complete without any interruptions to upload peers.
When these settings are done, start the daemon again and add it to /etc/rc.conf.
Web interface.
You can reach the web interface using http://homsrv.wpl.ym:9091
Download.
The complete download with all configuration files:
