Running Transmission on Synology DS1010+
Synology’s Disk Station Manager (DSM) comes pre-packaged with it’s own download manager, but I have never been a fan of it, and have already heavily customized it but was still not quite happy with it. Over the last 12 months I modified my installation so that I can subscribe to RSS feeds and then automatically download feeds into the download manager for purchased content.
This guide assumes that you have good knowledge of Linux and have already installed IPKG onto your NAS. I will not go into all the package dependencies, but have included as an attachment my current IPKG installation list which should give you a good indication of what is required. This guide should work with any Synology product, provided that you have bootstrapped IPKG.
Once you are done with the installation you will have a Transmission installation which will provide you with:
- Automatic downloads of torrents via RSS subscription
- Automatic update of IP filters through blocklists
- Notification via email if a download has been started / completed
- Integrated short-cut via DSM
You will have to install the following pre-requisite packages: ipkg install grep libxslt sed bash (please let me know if there are others I might have missed)
Let’s start – we begin with the Transmission installation as it is fairly quick:
- I keep all my scripts/configs in either /opt/ or a separate directory in /volume1/Extensions/scripts
- Install Transmission via ipkg install transmission. If your IPKG has multiple versions, use the one with the embedded web-UI, as this will save you lots of work in setting up/configuring an HTTP server.
- Create a directory /opt/etc/transmission. This is the place where I store all the configs, scripts and blocklists. I wanted to avoid to have the configs in /root, as an upgrade will typically remove root and trash all your settings
- Now start the transmission-daemon via transmission-daemon -f. This will create the default settings in a hidden directory (use ls -la) in root. Move the contents of the directory into /opt/etc/transmission so that /opt/etc/transmission has your settings.json and a number of other directories in it.
- Kill the current transmission-daemon via killall transmission-daemon.
- Before you extract the transmission-etc.zip into the /opt/etc/transmission directory open /opt/etc/transmission/settings.json and copy the content of rpc-password as the settings.json will be overwritten in the next step
- Adjust the settings.json: You will need to adjust the download-dir, incomplete-dir, rpc-password (copy from previous step), rpc-whitelist (adjust to your own IP-range
- Open /opt/etc/transmission/transmission-end.sh and adjust your EMAIL and what you want to display in the email sent to you when the download finishes. This script will be called by Transmission once a torrent completes. The script will then stop and remove the torrent as well as send you an email.
- For the previous step I suggest that you use nail. Install it via ipkg install nail and then adjust /opt/etc/nail.rc according to these instructions.
- Now create a symbolic link so that Transmission will automatically start upon boot: ln -s /opt/etc/transmission/S90transmission.sh /opt/etc/init.d/
- Ensure that you open the TCP/UDP port 51413 on your firewall for Transmission to properly work.
- You can now start Transmission via /opt/etc/init.d/S90transmission.sh start. You can tail the log-file /opt/etc/transmission/transmission.log for any errors.
- Let’s fetch the latest blocklist (we will add this to the cronjob later on) via /opt/etc/transmission/update-blocklist.sh. This will download the block-list file and Transmission will parse this into a blocklist.bin file in the /opt/etc/transmission/blocklists directory
- To check that the Transmission UI is running, open the following URL on the NAS: http://YOURNASIP:9091
- Add the following line to your crontab via (ensure that all spaces are tabs, as Synology is quite picky:
30 23 * * * root sh /opt/etc/transmission/update-blocklist.sh
As the next step we will create a short-cut in DSM for Transmission:
- Open the file /opt/etc/transmission/shortcut/application.cfg. Adjust your IP-address
- Create a symbolic link so that DSM will pick up the shortcut: ln -s /opt/etc/transmission/shortcut/ /usr/syno/synoman/webman/3rdparty/transmission
- When you log into DSM you should now see a Transmission-icon in the quick-launch container. If you click on it, it should display the Transmission web-UI within DSM
- You can then just drag this icon onto your DSM desktop to create a short-cut
Finally we will get the automatic RSS downloads going. The RSS-catch script is universal and will also work with the Synology Download manager:
- The content of the rss-feed.zip needs to be placed in one directory. In my case I have them under /volume1/Extensions/scripts.
- The bp.conf contains a list of RSS-URLs. In the example provided I have an URL to Karmorra.
- There are two scripts: (1) synocatch.shell which will download the latest torrents via RSS and (2) syno_torrent_load.shell which will add the torrents for download to Transmission
- I based my scripts on this contribution but had to adjust it to have absolute paths and various other changes to make it work properly on my installation
- You will need to install xsltproc, bash and probably other dependencies. I am unsure what else is required, but if you find other pre-requisites, please let me know and I will update this guide with it.
- The synocatch.shell will require adjustments in the beginning of the script (i.e. torrentdir and CONFG) and within the script references to /volume1/Extensions/scripts/rss_catcher
- The syno_torrent_load.shell is responsible for parsing the downloaded torrents and adding them to Transmission.
- Adjust the variables in the beginning of the script as necessary. At the bottom of the script adjust your email address to receive notifications.
- If for whatever reason you want to use the Synology Download Manager replace the uncommented line (if /opt/bin/downloadstation) – this will require the downloadstation script which is referenced in this thread.
- As a last step you will need to add two crontab entries to fetch the latest RSS every hour (I spaced them five minutes apart which should be sufficient (remember that spaces need to be tabs and also adjust the script location if yours differs:
105 * * * * root /opt/bin/bash /volume1/Extensions/scripts/rss_catch/synocatch.shell >>/var/log/synocatch.log 2>&1 10 * * * * root /opt/bin/bash /volume1/Extensions/scripts/rss_catch/syno_torrent_load.shell >>/var/log/synocatch.log 2>&1
- Update 2011-01-23: Transmission includes the option -c WATCHDIR with this you don’t need to have the syno_torrent_load.shell and you will only need to adjust the S90transmission.sh script. I still use the load-script as it emails me when new torrents are loaded.
With the above in place I have a perfectly automated Transmission solution in place. I have also included the IPKG list for any possible dependencies I might have missed.
I did notice an improvement of download rate with Transmission installed (I started using Transmission from Thursday):
Update 2011-01-22: I changed the S90transmission.sh to have the log-file write to /var/log instead of /opt/etc/transmission. (This change is not included in the downloads below)