Public | Automated Build

Last pushed: 3 days ago
Short Description
supervisor+rtorrent+nginx+rutorrent+autodl-irssi, optional basic auth+TLS/SSL, 64/32 bit
Full Description

Docker container with rTorrent and ruTorrent (stable and latest from github)

Ubuntu-based tags:

  • rtorrent-rutorrent:stable
  • rtorrent-rutorrent:latest
  • rtorrent-rutorrent:stable-32
  • rtorrent-rutorrent:latest-32

Alpine-based tags (no mediainfo and geoip yet):

  • rtorrent-rutorrent:stable-alpine
  • rtorrent-rutorrent:latest-alpine
  • rtorrent-rutorrent:stable-alpine-32
  • rtorrent-rutorrent:latest-alpine-32

Multiple processes inside the container managed by supervisord:

  • nginx
  • php-fpm
  • rtorrent
  • irssi

Exposed:

  • Web UI ports: 80 and 443
  • DHT UDP port: 49160
  • Incoming connections port: 49161
  • Downloads volume: /downloads
  • rtorrent scratch files (.rtorrent/{watch|session} will be created automatically): /downloads
  • autodl-irssi config files are created automatically: /downloads/.autodl
  • external rtorrent config (.rtorrent/.rtorrent.rc): /downloads
  • external ruTorrent ui config (config will be created automatically): /downloads/.rutorrent
  • rtorrent uid and gid: USR_ID and GRP_ID env vars, default is 1000:1000
  • php-fpm memory limit: PHP_MEM env var, default is 256M
  • disable IPv6 binding in nginx: set env var NOIPV6=1, default is not set
  • alternative webroot: WEBROOT env var, defailt is /

Adding basic auth:

Put .htpasswd into your /downloads volume root, the container will re-read .htpasswd each time it starts. To remote auth, simply remove .htpasswd and restart your container.

Instructions on how to generate .htpasswd can be found here: Nginx FAQ

$ printf "John:$(openssl passwd -crypt V3Ry)\n" >> .htpasswd # this example uses crypt encryption

$ printf "Mary:$(openssl passwd -apr1 SEcRe7)\n" >> .htpasswd # this example uses apr1 (Apache MD5) encryption

$ printf "Jane:$(openssl passwd -1 V3RySEcRe7)\n" >> .htpasswd # this example uses MD5 encryption

$ (PASSWORD="SEcRe7PwD";SALT="$(openssl rand -base64 3)";SHA1=$(printf "$PASSWORD$SALT" | openssl dgst -binary -sha1 | sed 's#$#'"$SALT"'#' | base64);printf "Jim:{SSHA}$SHA1\n" >> .htpasswd) # this example uses SSHA encryption

Adding TLS:

Put your keyfile (shall be named nginx.key) and your certificate (nginx.crt) into /dowloads volume root, the container looks for these files each time it starts.

Generate a self-signed certificate:

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx.key -out nginx.crt

Nginx TLS is configured as following:

keepalive_timeout   60;
ssl_ciphers "AES128+EECDH:AES128+EDH";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;

Basic auth secured with TLS:

Apparently, put .htpasswd, nginx.key and nginx.crt into /downloads root.


Example, 64-bit:

Insecure

$ docker run -dt --name rtorrent-rutorrent -p 8080:80 -p 49160:49160/udp -p 49161:49161 -v ~/test:/downloads diameter/rtorrent-rutorrent:latest

Secure

$ docker run -dt --name rtorrent-rutorrent -p 443:443 -p 49160:49160/udp -p 49161:49161 -v ~/test:/downloads diameter/rtorrent-rutorrent:latest

Example, map both secure and insecure ports, 32-bit:

$ docker run -dt --name rtorrent-rutorrent -p 8080:80 -p 443:443 -p 49160:49160/udp -p 49161:49161 -v ~/test:/downloads diameter/rtorrent-rutorrent:latest-32

Access web-interface: enter http://your_host_address:8080 in a browser for insecure version and https://your_host_address for secure version


Example, specify rtorrent gid and uid, and increase php-fpm memory limit:

$ docker run -dt --name rtorrent-rutorrent -p 8080:80 -p 49160:49160/udp -p 49161:49161 -v ~/test:/downloads -e USR_ID=11000 -e GRP_ID=22000 -e PHP_MEM=1024M diameter/rtorrent-rutorrent:stable

Upgrade from older container version, move rtorrent scratch files and rutorrent configs to the new locations:

Old New
/downloads/.session /downloads/.rtorrent/session
/downloads/watch /downloads/.rtorrent/watch
/downloads/config /downloads/.rutorrent

Docker Pull Command
Owner
diameter
Source Repository

Comments (31)
gedimiz
a day ago

I get this error when trying to run the container on QNAP:
2017-06-22 13:44:58,085 INFO exited: nginx (exit status 1; not expected)
I have tried to restart docker and recreate, however similar issue persists and I cannot use rtorrent.
Anyone knows how to fix this issue?

melchoir55
8 days ago

Probably the problem I posted earlier stems from the following:
Torrent list not yet available, connection to rTorrent not established.

Looks like the web ui can't connect to the process...

melchoir55
8 days ago

Really well put together container. Thanks!

I'm having a problem with autodl connecting to rtorrent. It looks like the port is wrong or something. Is there further configuration I need to do to handle this?

Here is the error message from autodl in rtorrent:
[15.06.2017 16:30:10] Error downloading files. Make sure autodl-irssi is started and configured properly (eg. password, port number): Error getting files listing: Error: Could not connect: (111) Connection refused

fearnaboinne
a month ago

Thanks @Diameter for this container. I do have one issue I cannot seem to resolve: RSS feeds do not automatically update.
The counter goes down in the UI when it is open... When I watch the traffic with tcpdump, it does NOT however connect to the RSS server at all. If I do a manual update, it all works as expected, and I will see traffic to the RSS server.
I've already tried adding the 'init plugins' script to .rtorrent.rc, but that doesn't seem to help either.

Any suggestions?

constantinbaciu
2 months ago

This works almost as I need it to work...
I'm using openmediavault (installed manually over a Debian 8 with a backported kernel) with the docker GUI plugin.
I have rtorrent running now, but I'm trying to create volumes with host folders. I see no error anywhere, but when I try to change the parameters for the AutoTools plugin, none of my host volumes are there.
The docker user group on the server has full access to the folders I'm trying to map to docker volumes...

Is there anything that I'm obviously missing?

mizled
3 months ago

@diameter
Is there any way you could add the mobile plugin or is there an easy way for me to do this? https://github.com/xombiemp/rutorrentMobile

platypus
4 months ago

thx @diameter!

It works perfectly now on HTTPS with authentication. The main problem was that I created some folders with my own user and docker is using root to run/execute the images. As soon as I gave the right permissions to root on the folders it started to work :-).

diameter
4 months ago

@platypus
Did you generate key and certificate in your /downloads mount as described in Adding TLS section?
Once you put nginx.crt and nginx.key there, and restart your container, you'll be able to access your host at https://your_host_address:6443. Your browser will complain because of self-signed certificate, but you may just add an exception for your host.

platypus
5 months ago

thx @diameter.

I'm now able to create the container using -p 6443:443 but not to access it. It should reply on address https://my_host_address:6443 right?

The browser just tell me 'Failed to open page'.

Any idea?

diameter
5 months ago

Hi @platypus
Try -p 6443:443 instead of -p 443:443 in docker run command