What follows is my submission of Transmission, version 2.73, for the DroboPorts website. I tried to follow the general outline of the existing guides posted there. The configuration file and service.sh file are sandwiched between BEGIN/END tags, with the idea that you can pull the relevant lines and make them downloadable files, with wget lines inserted in the packaging phase as done in guides such as with lighttpd.
Let me know if there are any gaps I need to fill in, or anything else for that matter. I welcome all comments.
I can also email you, or make available from my G-Drive, the files of this build including the resulting tgz built on the cross-compiler VM.
Thanks.
[code]transmission-2.73
Overview…
Transmission is a lean, small footprint BitTorrent client with support for protocol encryption, peer exchange, magnetic links, uPnP and NAT-PMP port forwarding, watch directories, global and time based network speed limits, and comes bundled with an easy to use web interface. Transmission requires openssl, libcurl, libevent, and zlib. Gzip is required to build gunzip, itself used to un-gzip a client block list which is downloaded when Transmission is started via the service.sh script. All libraries are cross-compiled statically for easier deployment.
Preparation…
Make sure you have a cross-compiling virtual machine properly setup.
Compilation…
export DEST=/mnt/DroboFS/Shares/DroboApps/transmission
mkdir -p $DEST/bin
cd ~/code
wget http://zlib.net/zlib-1.2.7.tar.gz
tar zxf zlib-1.2.7.tar.gz
cd zlib-1.2.7
ZLIB=pwd
CFLAGS="$CFLAGS -O3" ./configure --prefix=$ZLIB --static
make clean && make && make install
cd …
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar xzf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
OPENSSL=pwd
./Configure linux-generic32 -DL_ENDIAN --prefix=$OPENSSL no-shared no-zlib-dynamic --with-zlib-include=$ZLIB --with-zlib-lib=$ZLIB
sed -i -e “s/CFLAG= /CFLAG=${CFLAGS} /g” Makefile
make clean && make
cd …
wget http://curl.haxx.se/download/curl-7.28.0.tar.gz
tar zxf curl-7.28.0.tar.gz
cd curl-7.28.0
CURL=pwd
CFLAGS="$CFLAGS -O3 -I$ZLIB -I$OPENSSL/include" LDFLAGS="$LDFLAGS -L$ZLIB -L$OPENSSL" LIBS="-ldl" ./configure --host=arm-none-linux-gnueabi --prefix=$CURL --disable-shared --with-ssl --with-zlib --with-random --with-ca-bundle=$DEST/etc/ssl/certs/ca-certificates.crt
make clean && make
cd …
wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar zxf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
LIBEVENT=pwd
./configure --prefix=$LIBEVENT --host=arm-none-linux-gnueabi --disable-shared --enable-static
make clean && make
cd …
wget http://ftp.gnu.org/gnu/gzip/gzip-1.5.tar.gz
tar zxf gzip-1.5.tar.gz
cd gzip-1.5
./configure --host=arm-none-linux-gnueabi
make clean && make
cp gunzip $DEST/bin
cd …
wget http://download.transmissionbt.com/files/transmission-2.73.tar.bz2
tar jxf transmission-2.73.tar.bz2
cd transmission-2.73
LIBCURL_CFLAGS="-I$CURL/include" LIBCURL_LIBS="-L$CURL/lib -lcurl" LIBEVENT_CFLAGS="-I$LIBEVENT/include" LIBEVENT_LIBS="-L$LIBEVENT -levent" OPENSSL_CFLAGS="-I$OPENSSL/include" OPENSSL_LIBS="-L$OPENSSL -lssl -lcrypto" ./configure --prefix=$DEST --host=arm-none-linux-gnueabi --disable-shared --enable-static --enable-cli --enable-daemon --disable-mac --disable-nls --with-zlib=$ZLIB
make clean && make && make install
Packaging…
cd $DEST
mkdir -p etc var/log var/run
-make settings.json.default file-
{
“alt-speed-down”: 50,
“alt-speed-enabled”: false,
“alt-speed-time-begin”: 420,
“alt-speed-time-day”: 127,
“alt-speed-time-enabled”: false,
“alt-speed-time-end”: 1260,
“alt-speed-up”: 5,
“bind-address-ipv4”: “0.0.0.0”,
“bind-address-ipv6”: “::”,
“blocklist-enabled”: true,
“blocklist-url”: “http://www.bluetack.co.uk/config/level1.gz”,
“cache-size-mb”: 4,
“dht-enabled”: true,
“download-dir”: “/mnt/DroboFS/Shares/Media/Torrents/Downloads”,
“download-queue-enabled”: true,
“download-queue-size”: 5,
“encryption”: 1,
“idle-seeding-limit”: 30,
“idle-seeding-limit-enabled”: false,
“incomplete-dir”: “/mnt/DroboFS/Shares/Media/Torrents/Incomplete”,
“incomplete-dir-enabled”: false,
“lazy-bitfield-enabled”: true,
“lpd-enabled”: true,
“message-level”: 2,
“open-file-limit”: 50,
“peer-congestion-algorithm”: “”,
“peer-limit-global”: 300,
“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”: true,
“port-forwarding-enabled”: true,
“preallocation”: 1,
“prefetch-enabled”: 1,
“proxy”: “”,
“proxy-auth-enabled”: false,
“proxy-auth-password”: “”,
“proxy-auth-username”: “”,
“proxy-enabled”: false,
“proxy-port”: 80,
“proxy-type”: 0,
“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”: “{85ff11839c1acdc800cd80026f1dee2ceff144dd6d7UDkX3”,
“rpc-port”: 9091,
“rpc-url”: “/transmission/”,
“rpc-username”: “”,
“rpc-whitelist”: “192.168.1.*”,
“rpc-whitelist-enabled”: false,
“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”: 100,
“speed-limit-down-enabled”: false,
“speed-limit-up”: 10,
“speed-limit-up-enabled”: false,
“start-added-torrents”: true,
“trash-original-torrent-files”: false,
“umask”: 18,
“upload-slots-per-torrent”: 10,
“utp-enabled”: true,
“watch-dir”: “/mnt/DroboFS/Shares/Media/Torrents”,
“watch-dir-enabled”: true
}
-make services.sh file-
#!/bin/sh
transmission
Load the DroboApps service functions
. /etc/service.subr
Required DroboApps variables
prog_dir=dirname \
realpath $0``
name=“transmission”
version=“2.73”
pidfile=${prog_dir}/var/run/transmission.pid
logfile=${prog_dir}/var/log/transmission.log
conffile=${prog_dir}/etc/settings.json
export TRANSMISSION_WEB_HOME=${prog_dir}/share/transmission/web
This is needed to avoid segfault with eventlib
EVENT_NOEPOLL=1
export EVENT_NOEPOLL
start(){
# make sure that the config exists
if [ ! -f $conffile ]; then
cp ${conffile}.default ${conffile} > /dev/null 2>&1
fi
# Download a fresh blocklist if there isn't one or current one is over four days old
if [ ! -d ${prog_dir}/etc/blocklists ]; then
mkdir ${prog_dir}/etc/blocklists
fi
find ${prog_dir}/etc/blocklists -mtime +4 -type f -name level1 -exec rm {} \;
if [ ! -f ${prog_dir}/etc/blocklists/level1 ]; then
wget -q -O ${prog_dir}/etc/blocklists/level1.gz http://www.bluetack.co.uk/config/level1.gz
if [ -f ${prog_dir}/etc/blocklists/level1.gz ]; then
${prog_dir}/bin/gunzip ${prog_dir}/etc/blocklists/level1.gz
if [ $? -eq 0 ]; then
chmod go+r ${prog_dir}/etc/blocklists/level1
else
rm -f ${prog_dir}/etc/blocklists/level1*
fi
fi
fi
mv ${logfile} ${logfile}.last > /dev/null 2>&1
# Start Transmission
${prog_dir}/bin/transmission-daemon -g ${prog_dir}/etc -x ${pidfile} -e ${logfile} >> ${logfile} 2>&1
}
case “$1” in
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
sleep 3
start_service
;;
status)
status
;;
*)
echo “Usage: $0 [start|stop|restart|status]”
exit 1
;;
esac
chmod a+x service.sh
~/bin/package.sh
Installation…
Download the TGZ file below and place it in your DroboApps share. If you do not have SSH access, reboot your Drobo. Otherwise, SSH in and type:
/usr/bin/DroboApps.sh install
After installation, Transmission can be accessed with a web browser at…
http://:9091
Alternately, you can use a cross platform remote GUI such as…
http://code.google.com/p/transmisson-remote-gui/
Final remarks…
Upon installation and startup, Transmission will begin listening for non-authenticated connections on port 9091 from any IP. There are obvious security implications if your DroboFS is not behind a firewall. If you’re going to be operating your DroboFS on an unsecured network, you can use the rpc-whitelist setting in the configuration file etc/settings.json to restrict network access to a set of IPs or subnets.
Those truly worried about snooping can leverage Apache or lighttpd with mod_proxy, mod_ssl, and mod_auth to place Transmission behind an HTTPS portal with authentication.
Not all of the settings in the etc/settings.json file are configurable from the web interface or remote GUI client. Information on these settings and their options can be found at https://trac.transmissionbt.com/wiki/EditConfigFiles.
Note: The Transmission daemon should be halted by calling “./service.sh stop” before editing the contents of etc/settings.json, otherwise your changes may be overwritten.
Upgrade Advice…
The etc folder contains configuration data, session statistics, and information on any torrents currently registered in Transmission. While these files and directories shouldn’t be overwritten during an upgrade, it is advisable to make a backup of this directory prior to applying any updates.
[/code][hr]
Given that the compile steps are the same for DroboShare as they are for DroboFS, I wonder if we(I) should include a set of start/stop scripts for those that are still, myself included, putzing around with DroboShares.