Table of Contents
Description
Maintainers
Configuration
rtorrent
ENV
VPN
vpn mode
openvpn
nordvpn
Troubleshooting
mknod: /dev/net/tun: Operation not permitted
Description
A Docker image, based on alpine, for rtorrent with an optional openvpn, able to run as an
unprivileged container.
podman run -it --rm \
--cap-add=NET_ADMIN \
--cap-add=CAP_MKNOD \
-e OPENVPN_CONFIG_URL="https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/de490.nordvpn.com.udp.ovpn" \
-e OPENVPN_USER="" \
-e OPENVPN_PASS="" \
-p 5000:5000 \
-p 50000:50000 \
-v ./data:/data \
cocainefarm/rtorrent:latest
Copy
Maintainers
Configuration
All configuration can be done through environment variables but it’s possible to
mount in a openvpn configuration file and credentials file
rtorrent
ENV
RT\BASE \DIR : base directory for rtorrent files like downloads and .torrent
files. A trailing slash () is important ( default “/data “ )
RT\TRACKER \UDP : Enable or disable support for connecting to UDP trackers.
( default “yes” )
RT\DHT \MODE : Enable or disable DHT trackerless torrents. ( default “disable” )
RT\DHT \PORT : Port for trackerless torrents. ( default 49160 )
RT\PROTO \PEX : Enable or disable DHT trackerless torrents. ( default “no” )
RT\MAX \UP : Max upload bandwidth per torrent. ( default 100 )
RT\MAX \UP \GLOBAL : Max upload bandwidth globally. ( default 250 )
RT\MIN \PEERS : Minimum amount of Peers while downloading. ( default 20 )
RT\MAX \PEERS : Maximum amount of Peers while downloading. ( default 60 )
RT\MIN \PEERS \SEED : Minimum amount of Peers while seeding. ( default 30 )
RT\MAX \PEERS \SEED : Maximum amount of Peers while seeding. ( default 80 )
RT\TRACKERS \WANT : Number of wanted trackers. ( default 80 )
RT\MEMORY \MAX : Maximum mount of memory to use. ( default “1800M” )
RT\DAEMON : Run as a daemon and disable the UI. ( default “true” )
RT\XMLRPC \BIND : Bind IP for xmlrpc. ( default “0.0.0.0” )
RT\XMLRPC \PORT : Bind port for xmlrpc. ( default “5000” )
RT\CONFIG \FILE : Location of the config file. ( default “/.rtorrent.rc” )
VPN
vpn mode
To change the vpn mode ( default openvpn ) use the environment variable
VPNMODE ( default “openvpn” | "wg" wireguard | "nordvpn" | “off” disable the vpn function )
openvpn
ENV
CREATE\TUN \DEVICE : Create /dev/net/tun inside the container. See 2.2.2.3 . Empty is false. ( default “” )
OPENVPN\CONFIG \URL : URL from which to download and use an openvpn client
configuration file. ( default “” )
OPENVPN\CONFIG PATH : Sets where to find the openvpn client config when e.g.
mounting in your own config. ( default “” )
OPENVPN\USER : User for openvpn login. ( default “” )
OPENVPN\PASS : Password for openvpn login. ( default “” )
OPENVPN\AUTH \FILE : Path to a file that contains the openvpn credentials. User on
first line, password on second line. See 2.2.2.2 . ( default “” )
Authentication
For authenticating against openvpn you can either provide a user and password
via the environment variables, or mount in a file containing them.
The environment variables will be written to /private/auth.txt and that file
pass to openvpn as --auth-user-pass
When mounting your own file and setting OPENVPN\AUTH \FILE to it’s path the
environment variables will be ignored.
TUN Device
Openvpn needs a tun device in /dev/net/tun to work correctly.
You have to options to get that in a container:
Run the container as privileged and mount in /dev/net/tun from the host.
Give the container the NET_ADMIN and CAP_MKNOD capabilities and set
CREATE\TUN \DEVICE to have /dev/net/tun create inside the container.
wireguard
ENV
WIREGUARD_CONFIG_PATH : Path to a wireguard configuration file ( default "" )
nordvpn
ENV
NORDVPN\USER : User for nordvpn login. ( default “” )
NORDVPN\PASS : Password for nordvpn login. ( default “” )
Troubleshooting
mknod: /dev/net/tun: Operation not permitted
The container is running with the NET_ADMIN and CAP_MKNOD capabilities but
as a rootless container like podman. Creating the tun in the container will not
work with this setup. Run the container with --privileged and the capabilities
and the /dev/net/tun device will be ready to use in the container.