Docker Transmission Container with Windscribe VPN

Found this awesome container that has Transmission with VPN support which I can use with Windscribe VPN.

Docker Hub Link – https://hub.docker.com/r/haugene/transmission-openvpn/

Run command:

docker run \
 --name somename\
 --restart=always \
 --cap-add=NET_ADMIN \
 --device=/dev/net/tun \
 -d \
 -v localdir:/data:z \
 -v /etc/localtime:/etc/localtime:ro \
 --log-driver json-file \
 --log-opt max-size=10m \
 -p localport:9091 \
 --dns 8.8.8.8 --dns 8.8.4.4 \
 -e "OPENVPN_PROVIDER=WINDSCRIBE" \
 -e "OPENVPN_USERNAME=user" \
 -e "OPENVPN_PASSWORD=pass" \
 -e "OPENVPN_CONFIG=US-East-tcp" \
 -e "LOCAL_NETWORK=iprange" \
 -e "TRANSMISSION_WEB_UI=combustion" \
 -e "TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true" \
 -e "TRANSMISSION_RPC_PASSWORD=rpc_pass" \
 -e "TRANSMISSION_RPC_USERNAME=rpc_user" \
 -e "TRANSMISSION_SCRIPT_TORRENT_DONE_ENABLED=true" \
 -e "TRANSMISSION_SCRIPT_TORRENT_DONE_FILENAME=somescript" \
 -e "TRANSMISSION_SPEED_LIMIT_UP=1" \
 -e "TRANSMISSION_SPEED_LIMIT_UP_ENABLED=true" \
 -e "TRANSMISSION_SEED_QUEUE_ENABLED=true" \
 -e "TRANSMISSION_SEED_QUEUE_SIZE=1" \
 -e "TRANSMISSION_DOWNLOAD_QUEUE_ENABLED=true" \
 -e "TRANSMISSION_DOWNLOAD_QUEUE_SIZE=10" \
 haugene/transmission-openvpn

Things to keep in mind:

  • I had to use dns parameters with Google DNS because my Docker container was not able to resolve any domains. You may not need it
  • user name and password is different from the ones you use to login to Windscribe site. Get these from here: https://windscribe.com/getconfig/openvpn
  • iprange is something like 192.168.0.0/24 depending upon your local area network
  • SELinux will cause issues. So, use following code to set an SELinux policy
cat << EOF > docker-openvpn.te
module docker-openvpn 1.0;

require {
    type svirt_lxc_net_t;
    class tun_socket create;
}

#============= svirt_lxc_net_t ==============
allow svirt_lxc_net_t self:tun_socket create;

EOF

checkmodule -M -m -o docker-openvpn.mod docker-openvpn.te
semodule_package -o docker-openvpn.pp -m docker-openvpn.mod
semodule -i docker-openvpn.pp
  • All the “-e” options that start with TRANSMISSION are Optional but I find those useful to set
    • Use rpc_user / rpc_pass if you want to have transmission use a user for login
    • somescript is a post-download script you want to execute
    • Set the Upload speed and queue size
    • Set the Download queue size

Additionally, I discovered that by default this container will use Port 1194 to connect to Windscribe. I prefer to use 443. There are many ways you can override the port and here’s how I preferred to do it.

I downloaded the OVPN file from Windscribe using link: https://windscribe.com/getconfig/openvpn

Then modified the OVPN file to add “/config/openvpn-credentials.txt” at the end of the line that starts with “auth-user-pass”. The file referenced will be automatically created by the container with Windscribe user/pass values you provide in the Run script. Then OpenVPN can use this auth information and seamlessly connect to Windscribe.

client
dev tun
proto tcp
remote us-east.windscribe.com 443

nobind
auth-user-pass /config/openvpn-credentials.txt
reneg-sec 432000
resolv-retry infinite

:
:

Thereafter, modified the Run script to use a CUSTOM provider and also mapped the location of OVPN file to /etc/openvpn/custom/default.ovpn.

docker run \
--name somename\
--restart=always \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
-d \
-v localdir:/data:z \
-v /etc/localtime:/etc/localtime:ro \
-v localdir/Windscribe-US-East.ovpn:/etc/openvpn/custom/default.ovpn:Z \
--log-driver json-file \
--log-opt max-size=10m \
-p localport:9091 \
--dns 8.8.8.8 --dns 8.8.4.4 \
-e "OPENVPN_PROVIDER=CUSTOM" \
-e "OPENVPN_USERNAME=user" \
-e "OPENVPN_PASSWORD=pass" \
-e "LOCAL_NETWORK=iprange" \
-e "TRANSMISSION_WEB_UI=combustion" \
-e "TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true" \
-e "TRANSMISSION_RPC_PASSWORD=rpc_pass" \
-e "TRANSMISSION_RPC_USERNAME=rpc_user" \
-e "TRANSMISSION_SCRIPT_TORRENT_DONE_ENABLED=true" \
-e "TRANSMISSION_SCRIPT_TORRENT_DONE_FILENAME=somscript" \
-e "TRANSMISSION_SPEED_LIMIT_UP=1" \
-e "TRANSMISSION_SPEED_LIMIT_UP_ENABLED=true" \
-e "TRANSMISSION_SEED_QUEUE_ENABLED=true" \
-e "TRANSMISSION_SEED_QUEUE_SIZE=1" \
-e "TRANSMISSION_DOWNLOAD_QUEUE_ENABLED=true" \
-e "TRANSMISSION_DOWNLOAD_QUEUE_SIZE=10" \
-e "ENABLE_UFW=false" \
haugene/transmission-openvpn

Notice that this does not have “OPENVPN_CONFIG” variable set. This is because we are overriding OpenVPN default config file.

Fire up your container, and you are all set!

comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.