VPN, rTorrent, AutoDL irssi - martikainen87/Home-Automation GitHub Wiki

This is a guide on how to use arch-rtorrentvpn @ Dockerhub image to get a complete solution for putting a seedbox behind VPN and to use autodownload function.

The main advantage of using this solution is the simplicity and stability it provides, it has all the needed security functions to keep it from leaking any information, it will restart the services if the VPN tunnel drops, and it's easy to backup & restore your configuration in case of any issues. Plus the container is well maintanted.

This guide describes on how to use it with a custom VPN provider, in this specific example it's OVPN which is a great provider here in Sweden.

Configuring the container

Start by preparing the folder structure, you will need a folder for your config, plus a folder for the downloads.

sudo mkdir /Docker/torrent/config

I already have a share available and will be using it (by the path /share)

Start the container with this command, be sure to edit it to fit your needs, for example the ports in case you're already using any of the listed ports. These ports needs to be open at your vpn provider if they are normaly closed. The DNS servers are ovpn's servers, so change them if using another provider.

docker run -d \
    --cap-add=NET_ADMIN \
    -p 49601:9080 \
    -p 49602:9443 \
    -p 49603:8118 \
    -p 49604:3000 \
    --name=torrent \
    -v /share:/data \
    -v /Docker/torrent/config:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e VPN_ENABLED=yes \
    -e VPN_USER=username \
    -e VPN_PASS=password \
    -e VPN_PROV=custom \
    -e ENABLE_PRIVOXY=yes \
    -e ENABLE_FLOOD=no \
    -e ENABLE_AUTODL_IRSSI=yes \
    -e LAN_NETWORK=192.168.1.0/24 \
    -e NAME_SERVERS=46.227.67.134,192.165.9.158 \
    -e DEBUG=false \
    -e PHP_TZ=UTC \
    -e UMASK=000 \
    -e PUID=1000 \
    -e PGID=1000 \
    binhex/arch-rtorrentvpn

Then stop the container

docker stop torrent

The container should have created all needed folders, and now we need to provide the correct VPN settings. Go to ovpn's site and log in with your accont, then go to the viscosity guide where we will download our configuration files. It's located under step 4, choose your settings and server (UDP recommended).

Unzip the files in a folder and open the .ovpn file. We need to extract the CA and TLS auth information into separate files, create 2 new files ovpn.ca ovpn.key

Open ovpn.ca and copy the info between and ** The content of the file should look like this

-----BEGIN CERTIFICATE-----
MIIEfTCCA2WgAwIBAgIJAK2aIWqpLj1/MA0GCSqGSIb3DQEBBQUAMIGFMQswCQYD
 


lots of rows with your certificate


/cIp3n50Eiyx6ktuqimhyb59P4Nw8gqH452tTtE4MM/brA5y0Q0WFBRBojfZIbGW
WQ==
-----END CERTIFICATE-----

save the file and close it, then delete all CA information from the .ovpn file (from and including to )

Do the same thing the information between and .

then somewhere around line 15 there should be a line starting with "ncp-ciphers AES", delete that row

At the bottom off the .ovpn file we need to add a path to the new CA and tls files.

ca /config/openvpn/ovpn.crt
tls-auth /config/openvpn/ovpn.key

Now your .ovpn file should look like this

client
dev tun
proto udp
remote pool.prd.se.ovpn.com 1194 # resolves to multiple VPN servers in location
remote pool.prd.se.ovpn.com 1195 # resolves to multiple VPN servers in location
remote-random
mute-replay-warnings
replay-window 256
remote-cert-tls server
cipher aes-256-cbc
pull
nobind
reneg-sec 432000
resolv-retry infinite
compress lzo
verb 3
persist-key
persist-tun
auth-user-pass
block-outside-dns
key-direction 1

ca /config/openvpn/ovpn.crt
tls-auth /config/openvpn/ovpn.key

Place all 3 files in /Docker/torrent/config/openvpn/ and start the torrent.

set permissions on the .ovpn file

sudo chmod 755 ovpn.ovpn
docker start torrent

wait a minute or two then browse to http://dockerhostip:49601 If the gui isn't loading, look in /Docker/torrent/config and the file supervisord.log, it will show you any errors and possible solutions.

Change the password

Execute these two commands on the docker host

docker exec -it torrent /home/nobody/deluser.sh admin
docker exec -it torrent /home/nobody/createuser.sh admin

Then enter a new password for the admin account

⚠️ **GitHub.com Fallback** ⚠️