How to set up ProtonVPN in Deluge
I thought I'd share how I configured binhex-delugevpn to use ProtonVPN for those fellow paying ProtonVPN users. I don't know if this will work for the free VPN service - likely not. Your milage may vary.
Prerequisites
Go to https://account.protonvpn.com/ and obtain:
ProtonVPN OpenVPN username and password.
Openvpn.config file for P2P. As of this post, look at the country pages under your downloads account page and look for the icon with opposing arrows. Select the Linux platform (although it may not make a difference) and UDP. I have not tested TCP.
Steps
From the OpenVPN configs, we need to create two new files. The first must be called openvpn.ovpn and have the following lines, but take the appropriate stanzas from the downloaded configs:
remote <from downloaded configs; you may be able to put multiple remote stanzas for failover>
client
dev tun
proto udp
server-poll-timeout 20
remote-random
resolv-retry infinite
nobind
cipher AES-256-CBC
auth SHA512
comp-lzo
verb 3
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
ping 15
ping-restart 0
ping-timer-rem
remote-cert-tls server
auth-user-pass
pull
fast-io
script-security 2
auth-user-pass credentials.conf
tls-client
ca ca.rsa.2048.crt
disable-occ
key-direction 1
<tls-auth>
# 2048 bit OpenVPN static key
<from downloaded configs, include the BEGIN and END lines>
</tls-auth>
You'll notice your downloaded configs have a block with <ca> </ca> tags, cut that block out that starts at
<ca>
-----BEGIN CERTIFICATE-----
to
-----END CERTIFICATE-----
</ca>
and paste it to a new file called ca.rsa.2048.crt, but this file won't need the <ca> </ca> tags. It should just have the text including and between the BEGIN and END lines.
You'll notice that the template mentions a credentials.conf, this is created when the Docker image is saved.
Take the ca.rsa.2048.crt and openvpn.ovpn and copy them to the appdata/binhex-delugevpn/openvpn directory.
Next step is to edit the Docker image:
Host Port 1: 8112
Container Port: 8112
Host Port 2: 58846
Container Port: 58846
Host Port 3: 58946
Container Port: 58946
Host Port 4: 58946
Container Port: 58946
Host Port 5: 8118
Container Port: 8118
Host Path 2: /mnt/user/Deluge/data (or where ever you have it setup)
Container Path: /data
Key 1: yes
Container Variable: VPN_ENABLED
Key 2: <Your ProtonVPN OpenVPN username>
Container Variable: VPN_USER
Key 3: <Your ProtonVPN OpenVPN password>
Container Variable: VPN_PASS
Key 4: custom
Container Variable: VPN_PROV
Key 5: -none-
Container Variable: VPN_OPTIONS
Key 6: yes
Container Variable: STRICT_PORT_FORWARD
Key 7: yes
Container Variable: ENABLE_PRIVOXY
Key 8: 192.168.1.0/24 (or your local LAN address space)
Container Variable: LAN_NETWORK
Key 9: 8.8.8.8,209.222.18.222,37.235.1.174,209.222.18.218,37.235.1.177,8.8.4.4
Container Variable: NAME_SERVERS
Key 10: false
Container Variable: DEBUG
Key 11: 000
Container Variable: UMASK
Key 12: 99
Container Variable: PUID
Key 13: 100
Container Variable: PGID
AppData Config Path: /mnt/user/appdata/binhex-delugevpn
Container Path: /config
After hitting apply it should create the credentials.conf and start the image. You can't pre-create the credentials.conf, the docker image will likely complain about permissions and not start.
Some troubleshooting tips:
To login to the docker image:
docker exec -it binhex-delugevpn /bin/bash
Once inside the docker image, run
dig +short myip.opendns.com @resolver1.opendns.com
to get its IP address. As long as this is different from your actual IP, things should be working.
To confirm your IP is hidden, go to https://ipleak.net. It should detect your actual ISP IP, but the Torrent Address detection should be the IP from the above dig command.
Note 1: the NAME_SERVERS are ones from when I set up PIA, I don't know ProtonVPN nameservers, the OpenVPN config assigns a private DNS server on my desktop. If anyone has the actual ProtonVPN DNS servers, please comment.
Note 2: If you notice that the Tracker status shows timeouts, then likely that VPN remote no longer supports P2P or is too slow. Check the Country Configs and update as needed.
Anyway, hope this helps someone.