[Support] binhex - rTorrentVPN


Recommended Posts

EDIT : It seems like the problem fixed itself. I left the container running, and it's functioning normally now.

 

I seem to be having an issue, every time I start the docker it refuses to run properly. The webGUI loads, but nothing is controllable or working. The console of the gui gives this error.

 

[30.12.2020 12:08:18] WebUI started.
[30.12.2020 12:08:19] No connection to rTorrent. Check if it is really running. Check $scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent configuration file.

And the docker logs show this


2020-12-30 07:07:05,562 DEBG 'start-script' stdout output:
[info] Starting OpenVPN (non daemonised)...

2020-12-30 07:07:05,569 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:05 2020 WARNING: file 'credentials.conf' is group or others accessible
Wed Dec 30 07:07:05 2020 OpenVPN 2.4.9 [git:makepkg/9b0dafca6c50b8bb+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 20 2020
Wed Dec 30 07:07:05 2020 library versions: OpenSSL 1.1.1g 21 Apr 2020, LZO 2.10

2020-12-30 07:07:05,569 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:05 2020 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts

2020-12-30 07:07:05,570 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:05 2020 CRL: loaded 1 CRLs from file [[INLINE]]

2020-12-30 07:07:05,571 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:05 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]199.36.223.152:1198
Wed Dec 30 07:07:05 2020 UDP link local: (not bound)
Wed Dec 30 07:07:05 2020 UDP link remote: [AF_INET]199.36.223.152:1198

2020-12-30 07:07:05,691 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:05 2020 [montreal411] Peer Connection Initiated with [AF_INET]199.36.223.152:1198

2020-12-30 07:07:06,933 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:06 2020 TUN/TAP device tun0 opened
Wed Dec 30 07:07:06 2020 /usr/bin/ip link set dev tun0 up mtu 1500

2020-12-30 07:07:06,934 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:06 2020 /usr/bin/ip addr add dev tun0 10.22.112.169/24 broadcast 10.22.112.255

2020-12-30 07:07:06,936 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:06 2020 /root/openvpnup.sh tun0 1500 1553 10.22.112.169 255.255.255.0 init

2020-12-30 07:07:06,942 DEBG 'start-script' stdout output:
Wed Dec 30 07:07:06 2020 Initialization Sequence Completed

2020-12-30 07:07:09,010 DEBG 'start-script' stdout output:
[info] Attempting to get external IP using 'http://checkip.amazonaws.com'...

2020-12-30 07:07:10,183 DEBG 'start-script' stdout output:
[info] Successfully retrieved external IP address 199.36.223.152

2020-12-30 07:07:10,185 DEBG 'start-script' stdout output:
[info] Script started to assign incoming port

2020-12-30 07:07:10,186 DEBG 'start-script' stdout output:
[info] Port forwarding is enabled
[info] Checking endpoint 'ca-montreal.privacy.network' is port forward enabled...

2020-12-30 07:07:10,775 DEBG 'start-script' stdout output:
[info] PIA endpoint 'ca-montreal.privacy.network' is in the list of endpoints that support port forwarding

2020-12-30 07:07:10,775 DEBG 'start-script' stdout output:
[info] List of PIA endpoints that support port forwarding:-

2020-12-30 07:07:10,776 DEBG 'start-script' stdout output:
[info] al.privacy.network
[info] ad.privacy.network
[info] austria.privacy.network
[info] brussels.privacy.network
[info] ba.privacy.network
[info] sofia.privacy.network
[info] czech.privacy.network
[info] denmark.privacy.network
[info] ee.privacy.network
[info] fi.privacy.network
[info] france.privacy.network
[info] de-frankfurt.privacy.network
[info] de-berlin.privacy.network
[info] gr.privacy.network

2020-12-30 07:07:10,776 DEBG 'start-script' stdout output:
[info] hungary.privacy.network
[info] is.privacy.network
[info] ireland.privacy.network
[info] man.privacy.network
[info] italy.privacy.network
[info] lv.privacy.network
[info] liechtenstein.privacy.network
[info] lt.privacy.network
[info] lu.privacy.network
[info] mk.privacy.network
[info] malta.privacy.network
[info] md.privacy.network
[info] monaco.privacy.network
[info] montenegro.privacy.network
[info] nl-amsterdam.privacy.network
[info] no.privacy.network
[info] poland.privacy.network
[info] pt.privacy.network
[info] ro.privacy.network
[info] rs.privacy.network
[info] sk.privacy.network
[info] spain.privacy.network
[info] sweden.privacy.network
[info] swiss.privacy.network
[info] ua.privacy.network
[info] uk-london.privacy.network
[info] uk-southampton.privacy.network
[info] uk-manchester.privacy.network
[info] uk-2.privacy.network
[info] bahamas.privacy.network
[info] ca-montreal.privacy.network
[info] ca-toronto.privacy.network
[info] ca-ontario.privacy.network
[info] ca-vancouver.privacy.network
[info] greenland.privacy.network
[info] mexico.privacy.network
[info] panama.privacy.network
[info] ar.privacy.network
[info] br.privacy.network
[info] venezuela.privacy.network
[info] yerevan.privacy.network
[info] bangladesh.privacy.network
[info] cambodia.privacy.network
[info] china.privacy.network
[info] cyprus.privacy.network
[info] georgia.privacy.network
[info] hk.privacy.network
[info] in.privacy.network
[info] israel.privacy.network

2020-12-30 07:07:10,776 DEBG 'start-script' stdout output:
[info] japan.privacy.network
[info] kazakhstan.privacy.network
[info] macau.privacy.network
[info] mongolia.privacy.network
[info] philippines.privacy.network
[info] qatar.privacy.network
[info] saudiarabia.privacy.network
[info] sg.privacy.network
[info] srilanka.privacy.network
[info] taiwan.privacy.network
[info] tr.privacy.network
[info] ae.privacy.network
[info] vietnam.privacy.network
[info] aus-perth.privacy.network
[info] au-sydney.privacy.network
[info] aus-melbourne.privacy.network
[info] nz.privacy.network
[info] dz.privacy.network
[info] egypt.privacy.network
[info] morocco.privacy.network
[info] nigeria.privacy.network
[info] za.privacy.network

2020-12-30 07:07:12,508 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '25577'

2020-12-30 07:07:13,120 DEBG 'watchdog-script' stdout output:
[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.22.112.169 different, marking for reconfigure

2020-12-30 07:07:13,124 DEBG 'watchdog-script' stdout output:
[info] rTorrent not running

2020-12-30 07:07:13,124 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 49160 and VPN incoming port 25577 different, marking for reconfigure

2020-12-30 07:07:13,125 DEBG 'watchdog-script' stdout output:
[info] Removing any rTorrent session lock files left over from the previous run...

2020-12-30 07:07:13,131 DEBG 'watchdog-script' stdout output:
[info] Attempting to start rTorrent...

2020-12-30 07:07:13,132 DEBG 'watchdog-script' stdout output:
Script started, output log file is '/home/nobody/typescript'.

2020-12-30 07:07:13,160 DEBG 'watchdog-script' stdout output:
Script done.

2020-12-30 07:07:13,263 DEBG 'rutorrent-script' stdout output:
[info] rtorrent started, setting up rutorrent...

2020-12-30 07:07:13,263 DEBG 'rutorrent-script' stdout output:
[info] nginx cert files already exists, skipping copy

2020-12-30 07:07:13,264 DEBG 'rutorrent-script' stdout output:
[info] nginx config file already exists, skipping copy

2020-12-30 07:07:13,265 DEBG 'rutorrent-script' stdout output:
[info] php.ini file already exists, skipping copy

2020-12-30 07:07:13,266 DEBG 'rutorrent-script' stdout output:
[info] rutorrent conf folder already exists, skipping copy

2020-12-30 07:07:13,271 DEBG 'rutorrent-script' stdout output:
"python" => '/usr/bin/python', // Something like /usr/bin/python. If empty, will be found in PATH.

2020-12-30 07:07:13,279 DEBG 'rutorrent-script' stdout output:
[info] Setting PHP timezone to UTC...

2020-12-30 07:07:13,289 DEBG 'rutorrent-script' stdout output:
[info] running rsync to copy rutorrent user plugins to the plugins folder inside the container...

2020-12-30 07:07:13,294 DEBG 'rutorrent-script' stdout output:
sending incremental file list

2020-12-30 07:07:13,295 DEBG 'rutorrent-script' stdout output:
README.txt

2020-12-30 07:07:13,295 DEBG 'rutorrent-script' stdout output:
theme/themes/README.txt

2020-12-30 07:07:13,337 DEBG 'rutorrent-script' stdout output:

sent 365 bytes received 64 bytes 858.00 bytes/sec
total size is 237 speedup is 0.55

2020-12-30 07:07:13,338 DEBG 'rutorrent-script' stdout output:
[info] rutorrent share folder already exists, skipping copy

2020-12-30 07:07:13,340 DEBG 'rutorrent-script' stdout output:
[info] nginx /rpc2 location enabled

2020-12-30 07:07:13,349 DEBG 'rutorrent-script' stdout output:
[info] Updating password for rpc2 account 'admin'...

2020-12-30 07:07:13,352 DEBG 'rutorrent-script' stderr output:


2020-12-30 07:07:13,352 DEBG 'rutorrent-script' stderr output:
password for user admin

2020-12-30 07:07:13,361 DEBG 'rutorrent-script' stdout output:
[info] Updating password for web ui account 'admin'...

2020-12-30 07:07:13,363 DEBG 'rutorrent-script' stderr output:


2020-12-30 07:07:13,364 DEBG 'rutorrent-script' stderr output:
password for user admin

2020-12-30 07:07:13,364 DEBG 'rutorrent-script' stdout output:
[info] starting php-fpm...

2020-12-30 07:07:13,385 DEBG 'rutorrent-script' stderr output:
[NOTICE] [pool www] 'user' directive is ignored when FPM is not running as root
[NOTICE] [pool www] 'group' directive is ignored when FPM is not running as root

2020-12-30 07:07:13,388 DEBG 'rutorrent-script' stdout output:
[info] starting nginx...

2020-12-30 07:07:21,239 DEBG 'watchdog-script' stdout output:
[info] rTorrent process started
[info] Waiting for rTorrent process to start listening on port 5000...

2020-12-30 07:07:21,250 DEBG 'watchdog-script' stdout output:
[info] rTorrent process listening on port 5000

2020-12-30 07:07:21,250 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2020-12-30 07:07:21,260 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2020-12-30 07:07:21,271 DEBG 'watchdog-script' stdout output:
[info] nginx running
[info] Initialising ruTorrent plugins...

2020-12-30 07:07:28,288 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

2020-12-30 07:07:58,434 DEBG 'watchdog-script' stdout output:
[info] rTorrent not running

2020-12-30 07:07:58,434 DEBG 'watchdog-script' stdout output:
[info] Removing any rTorrent session lock files left over from the previous run...

2020-12-30 07:07:58,440 DEBG 'watchdog-script' stdout output:
[info] Attempting to start rTorrent...

2020-12-30 07:07:58,441 DEBG 'watchdog-script' stdout output:
Script started, output log file is '/home/nobody/typescript'.

2020-12-30 07:07:58,472 DEBG 'watchdog-script' stdout output:
Script done.

2020-12-30 07:08:06,548 DEBG 'watchdog-script' stdout output:
[info] rTorrent process started
[info] Waiting for rTorrent process to start listening on port 5000...

2020-12-30 07:08:06,558 DEBG 'watchdog-script' stdout output:
[info] rTorrent process listening on port 5000

2020-12-30 07:08:06,558 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2020-12-30 07:08:06,568 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2020-12-30 07:08:06,578 DEBG 'watchdog-script' stdout output:
[info] nginx running

2020-12-30 07:08:06,578 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins...

2020-12-30 07:08:07,498 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

2020-12-30 07:08:37,552 DEBG 'watchdog-script' stdout output:
[info] rTorrent not running

2020-12-30 07:08:37,553 DEBG 'watchdog-script' stdout output:
[info] Removing any rTorrent session lock files left over from the previous run...

2020-12-30 07:08:37,559 DEBG 'watchdog-script' stdout output:
[info] Attempting to start rTorrent...

2020-12-30 07:08:37,560 DEBG 'watchdog-script' stdout output:
Script started, output log file is '/home/nobody/typescript'.

2020-12-30 07:08:37,585 DEBG 'watchdog-script' stdout output:
Script done.

2020-12-30 07:08:44,651 DEBG 'watchdog-script' stdout output:
[info] rTorrent process started
[info] Waiting for rTorrent process to start listening on port 5000...

2020-12-30 07:08:44,661 DEBG 'watchdog-script' stdout output:
[info] rTorrent process listening on port 5000

2020-12-30 07:08:44,661 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2020-12-30 07:08:44,671 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2020-12-30 07:08:44,681 DEBG 'watchdog-script' stdout output:
[info] nginx running
[info] Initialising ruTorrent plugins...

2020-12-30 07:08:50,939 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

2020-12-30 07:09:21,174 DEBG 'watchdog-script' stdout output:
[info] rTorrent not running

2020-12-30 07:09:21,175 DEBG 'watchdog-script' stdout output:
[info] Removing any rTorrent session lock files left over from the previous run...

2020-12-30 07:09:21,180 DEBG 'watchdog-script' stdout output:
[info] Attempting to start rTorrent...

2020-12-30 07:09:21,181 DEBG 'watchdog-script' stdout output:
Script started, output log file is '/home/nobody/typescript'.

2020-12-30 07:09:21,212 DEBG 'watchdog-script' stdout output:
Script done.

2020-12-30 07:09:28,274 DEBG 'watchdog-script' stdout output:
[info] rTorrent process started
[info] Waiting for rTorrent process to start listening on port 5000...

2020-12-30 07:09:28,283 DEBG 'watchdog-script' stdout output:
[info] rTorrent process listening on port 5000

2020-12-30 07:09:28,283 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2020-12-30 07:09:28,291 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2020-12-30 07:09:28,302 DEBG 'watchdog-script' stdout output:
[info] nginx running
[info] Initialising ruTorrent plugins...

2020-12-30 07:09:28,274 DEBG 'watchdog-script' stdout output:
[info] rTorrent process started
[info] Waiting for rTorrent process to start listening on port 5000...

2020-12-30 07:09:28,283 DEBG 'watchdog-script' stdout output:
[info] rTorrent process listening on port 5000

2020-12-30 07:09:28,283 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2020-12-30 07:09:28,291 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2020-12-30 07:09:28,302 DEBG 'watchdog-script' stdout output:
[info] nginx running
[info] Initialising ruTorrent plugins...

2020-12-30 07:09:34,366 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

2020-12-30 07:09:34,366 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

 

Edited by squelch
Fixed
Link to comment
On 12/7/2020 at 10:44 AM, kajeagentspi said:

Found a temporary fix to this problem. You just need to edit some lines in /root/wireguard.sh and getvpnport.sh

Assumptions

You have a windows machine

Wireguard and port forwarding enabled on the windows client.

 

1. Go to C:\Program Files\Private Internet Access\data

2. Copy accounts.json somewhere since if you just open the file it would fail due to some permission issue.

3. Open the copied accounts.json file and copy the token

4. Open up the shell of the container

5. Replace the contents of /root/wireguard.sh and /root/getvpnport.sh with the ones from this gist

6. Restart

 

Do note that editing any of the settings of the container would reset the changes above.

 

@binhex is it possible to add a TOKEN variable to the image to somehow fix this till PIA fix their servers?

 

 

I just swapped to PIA. Is this necessary to enable port forwarding on my ruTorrent container? Currently I'm just using a generated .ovpn file from their site which I can create from my account page. I really need port forwarding working but the way that it is set up at the moment it seems you're only able to get a random one from within their Windows client... So how do we do this using the container? @binhex

 

EDIT: Ok so I've read your FAQ on Github and the last 10 pages of posts.

 

So far I get this in my log:

2020-12-31 21:52:38,738 DEBG 'start-script' stdout output:
[info] Script started to assign incoming port

2020-12-31 21:52:38,738 DEBG 'start-script' stdout output:
[info] Port forwarding is enabled

I'm using a brand new PIA account. Windows client is set to Wireguard and Request Port Forwarding is set to: YES (on Windows client).

 

PIA password and username are set in container options. STRICT_PORT_FORWARDING=yes

I am also using an endpoint that allows port forwarding. I've got an .ovpn file in the openvpn folder that I generated from my PIA account page using GCM cipher etc. as you said it may provide better performance.

 

Here's a copy of that with cert and country.IP etc. removed:

 

client
dev tun
proto udp
remote xxxxxx.privacy.network 1198
resolv-retry infinite
nobind
persist-key
cipher aes-128-gcm
ncp-disable
tls-client
remote-cert-tls server

auth-user-pass credentials.conf
compress
verb 1
<crl-verify>
-----BEGIN X509 CRL-----
xxxxxxxxxxxxx
-----END X509 CRL-----
</crl-verify>

<ca>
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxx
-----END CERTIFICATE-----
</ca>

disable-occ

 

My main question is. How do I tell what port is being forwarded by the container? Also, will this port always be the same? Finally, and maybe most importantly. What do I do with the rtorrent.rc file which states what port I am trying to use? I mean if the forwarded port is chosen randomly or something with your script Binhex, how do I know what port to set the container to use in the rtorrent.rc/ruTorrent Settings -> Connections tab? When I was using Mullvad the port I chose to be opened via Wireguard was permanent, PIA seems to do this totally differently though.

 

Anyway so what port should I set in the rtorrent.rc file and then port forward in my router. I would rather use Wireguard too for better performance but my server isn't exactly weak or anything. So if that's possible, I'd love some info on doing that. Though it seems PIA doesn't have some Wireguard config generator or anything.

 

Thanks

 

EDIT 2:

 

I just saw this in the log:

2020-12-31 22:03:48,536 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '51083'

2020-12-31 22:03:48,850 DEBG 'watchdog-script' stdout output:
[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.x.xxx.95 different, marking for reconfigure

2020-12-31 22:03:48,857 DEBG 'watchdog-script' stdout output:
[info] irssi not running

2020-12-31 22:03:48,864 DEBG 'watchdog-script' stdout output:
[info] rTorrent not running

2020-12-31 22:03:48,865 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 49160 and VPN incoming port 51083 different, marking for reconfigure

So this time it bound 51083 as the incoming port, and last time it seems to have been 48225.

 

In the ruTorrent settings I have: Settings -> Connection -> Port, set to 55180-55180. I don't understand what the script is trying to do, how does it handle the rtorrent.rc port setting and how can I anticipate what port is going to be assigned upon a container restart so I know what to forward in my router so I am not always having to change that in my router settings. Is there at least some logic or port range or something I can anticipate so I don't always have to change things in my router (I have an ASUS AX88U)? Could you please make this a bit more clearer in your Github FAQ.

Edited by plantsandbinary
Link to comment
1 hour ago, binhex said:

Thanks for replying at such a time. So firstly, happy new years!

I read that, so my local router setting is pointless. I'll disable that.

 

My question then. So I am to assume that the rtorrent.rc file setting is completely pointless (at least for me running PIA)?

Also, then I guess I am also to assume that I should ignore that "open port" plugin that rutorrent shows being closed?

 

If this is the case, please let me know. Then I'll leave the rtorrent.rc port set to whatever if it makes no difference.

 

I've checked on the canyouseeme.org and yougetsignal.com and they both show the port is open. Download speed is still pretty finicky but that could just be a coincidence. However, both sites show the port is a TCP port. Though my .ovpn config is using UDP only. Why is that?

Link to comment
1 hour ago, plantsandbinary said:

y question then. So I am to assume that the rtorrent.rc file setting is completely pointless (at least for me running PIA)?

Also, then I guess I am also to assume that I should ignore that "open port" plugin that rutorrent shows being closed?

I don't use rtorrentvpn but in regards to the incoming port then I think that's a Yes to both. PIA users don't have to worry about setting a port as that is done for you. IIRC that is the case for all of binhex vpn containers.

 

1 hour ago, plantsandbinary said:

However, both sites show the port is a TCP port. Though my .ovpn config is using UDP only. Why is that?

The TCP incoming port is used for others peers to connect to you whereas the UPD port in your .ovpn config is used to connect to the remote vpn server of your choice. So they are two different things.

Link to comment

@binhex I'm trying to use an ip address instead of a domain with PIA. This is because using a domain means that my IP will be different every single time, even if I only use the one country specific .ovpn file. For security I guess this might be good but it causes problems with other use cases which I will explain below. So when I generated my .ovpn file from PIA I chose IP.

 

However, your script doesn't have this IP address in the list as listed to be port forwarded. Even though it should support port forwarding.

 

So I am getting this:

 

2021-01-02 18:51:11,452 DEBG 'start-script' stdout output:
[info] Successfully retrieved external IP address 188.126.xxx.xxx

2021-01-02 18:51:11,454 DEBG 'start-script' stdout output:
[info] Script started to assign incoming port

2021-01-02 18:51:11,455 DEBG 'start-script' stdout output:
[info] Port forwarding is enabled
[info] Checking endpoint '188.126.xxx.xxx' is port forward enabled...

2021-01-02 18:51:11,813 DEBG 'start-script' stdout output:
[warn] PIA endpoint '188.126.xxx.xxx' is not in the list of endpoints that support port forwarding, DL/UL speeds maybe slow
[info] Please consider switching to one of the endpoints shown below

...

2021-01-02 18:51:13,753 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '47283'

2021-01-02 18:51:42,881 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 59851 and VPN incoming port 47283 different, marking for reconfigure

I checked my ports and as far as I can see, they are now closed when using an IP.

 

The reason why I do this is because one of the trackers I use has a stupid rule that you must download the .torrent from the exact same IP as the one in which your client is installed and using. It's a dumb rule to be honest but I haven't had any problems in the past using manual port forwarding with Mullvad and yet another custom generated .ovpn file.

 

Just thought I'd let you know in case you wanted to edit the script to maybe print out whether or not the port was forwarded successfully even if the user is using an IP and not a domain to connect to (and that IP isn't in the list of what-ever those that are port forwarded). Maybe get it to check both?

 

Perhaps it would be even easier to just get it to attempt port forwarding even if the IP/domain isn't in the list. That way I can use an IP without it even needing to check if it is supported. Just a heads up.

 

EDIT: I figured out how to use the Privoxy built into the container to deal with this dynamic IP via PIA dns issue. So that fixed that problem, but I still have the issue where the port is not always forwarded and updated automatically by the script, even when using a port forwarded enabled endpoint.

Edited by plantsandbinary
Link to comment

Ok I am 100% convinced that even using a port forward enabled endpoint. This script does not always do the port forwarding. My main tracker that I use is still reporting after multiple restarts of the container that rutorrent is instead using the port that is set in rtorrent.rc... which I was told above is not important if I am using PIA. This means that the port is not being reassigned correctly.

 

EDIT: and here I have proof that it is not always working for some reason:

 

2021-01-02 19:12:00,242 DEBG 'start-script' stdout output:
[info] Port forwarding is enabled
[info] Checking endpoint 'ee.privacy.network' is port forward enabled...

2021-01-02 19:12:00,596 DEBG 'start-script' stdout output:
[info] PIA endpoint 'ee.privacy.network' is in the list of endpoints that support port forwarding

...

2021-01-02 19:12:02,546 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '56158'

...

2021-01-02 19:12:02,946 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 49160 and VPN incoming port 56158 different, marking for reconfigure

2021-01-02 19:12:02,950 DEBG 'watchdog-script' stdout output:
[info] Attempting to start irssi...

 

Normally it should read this (when it does port forward correctly and I can test and see that it has, the below is just an example of the missing line where the assignment is actually done):

 

2021-01-02 19:12:02,946 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 49160 and VPN incoming port 56158 different, marking for reconfigure

2021-01-02 19:12:02,946 DEBG 'watchdog-script' stdout output:
56158-56158

2021-01-02 19:12:02,950 DEBG 'watchdog-script' stdout output:
[info] Attempting to start irssi...

I've seen it do the above once or twice, but I don't know why it doesn't ALWAYS do it. That middle line is the most important, because that's the actual port being changed by the script from whatever is in rtorrent.rc to whatever has been randomly forwarded by PIA. Half the time I don't see that though in the log.

 

Most of the time the log simply says: 'marking for reconfigure' but it doesn't actually do it...

 

Here's a full log with private data removed: https://cryptobin.co/25a9h7o0

Password is: unraidforum

 

Here's the .ovpn options minus the cert and other private stuff

 

client
dev tun
proto udp
remote ee.privacy.network 1198
resolv-retry infinite
nobind
persist-key
persist-tun
cipher aes-128-gcm
ncp-disable
tls-client
remote-cert-tls server

auth-user-pass credentials.conf
compress
verb 1
reneg-sec 0

Final EDIT:

 

So it seems for some reason you have it set up to do the actual forwarding something like 30 minutes after connecting. Check the below times. I just checked my log again and sure enough it does actually try to forward and even check if this is the case, but only after 30 minutes? Why is this the case? Look at the times below.

 

1. The container finishes running at 20:04:55,010

2. 15 minutes later the port is for some reason reassigned again at 20:19:47,485

3. A further 15 minutes later at 20:35:23,295 the script checks if the port is open and was forwarded correctly, in my case below it fails.

2021-01-02 20:04:55,002 DEBG 'watchdog-script' stdout output:
[info] Privoxy process started
[info] Waiting for Privoxy process to start listening on port 8118...

2021-01-02 20:04:55,010 DEBG 'watchdog-script' stdout output:
[info] Privoxy process listening on port 8118

2021-01-02 20:19:47,485 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '27772'

2021-01-02 20:34:47,603 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '27772'

2021-01-02 20:35:21,709 DEBG 'watchdog-script' stdout output:
0

2021-01-02 20:35:23,295 DEBG 'watchdog-script' stdout output:
[warn] Incoming port site 'https://portchecker.co/' failed to web scrape, marking as failed

2021-01-02 20:35:24,452 DEBG 'watchdog-script' stdout output:
0

2021-01-02 20:35:24,452 DEBG 'watchdog-script' stdout output:
0

2021-01-02 20:35:25,808 DEBG 'watchdog-script' stdout output:
[info] rtorrent incoming port closed, marking for reconfigure

2021-01-02 20:35:51,042 DEBG 'start-script' stdout output:
[info] Sending SIGTERM (-15) to 'openvpn' due to port closed...

2021-01-02 20:35:51,057 DEBG 'start-script' stdout output:
Sat Jan 2 20:35:51 2021 event_wait : Interrupted system call (code=4)

2021-01-02 20:35:51,065 DEBG 'start-script' stdout output:
Sat Jan 2 20:35:51 2021 /usr/bin/ip addr del dev tun0 10.20.112.79/24

2021-01-02 20:35:51,082 DEBG 'start-script' stdout output:
Sat Jan 2 20:35:51 2021 /root/openvpndown.sh tun0 1500 1553 10.20.112.79 255.255.255.0 init

2021-01-02 20:35:51,087 DEBG 'start-script' stdout output:
Sat Jan 2 20:35:51 2021 SIGTERM[hard,] received, process exiting

2021-01-02 20:35:51,088 DEBG 'start-script' stdout output:
[info] Script finished to assign incoming port

2021-01-02 20:35:51,095 DEBG 'start-script' stdout output:
[info] Starting OpenVPN (non daemonised)...

 

Now here is where things get interesting. THIS TIME, it does the port reconfigure.

 

2021-01-02 20:36:07,942 DEBG 'start-script' stdout output:
[info] Successfully assigned and bound incoming port '34643'

2021-01-02 20:36:28,648 DEBG 'watchdog-script' stdout output:
[info] rTorrent incoming port 27772 and VPN incoming port 34643 different, marking for reconfigure

2021-01-02 20:36:29,036 DEBG 'watchdog-script' stdout output:
34643-34643

2021-01-02 20:36:29,036 DEBG 'watchdog-script' stdout output:
34643-34643

2021-01-02 20:36:29,443 DEBG 'watchdog-script' stdout output:
34643

2021-01-02 20:36:30,244 DEBG 'watchdog-script' stdout output:
0

2021-01-02 20:36:30,669 DEBG 'watchdog-script' stdout output:
0

2021-01-02 20:36:30,685 DEBG 'watchdog-script' stdout output:
[info] Initialising ruTorrent plugins (checking rTorrent is running)...

2021-01-02 20:36:30,693 DEBG 'watchdog-script' stdout output:
[info] rTorrent running
[info] Initialising ruTorrent plugins (checking nginx is running)...

2021-01-02 20:36:30,700 DEBG 'watchdog-script' stdout output:
[info] nginx running
[info] Initialising ruTorrent plugins...

2021-01-02 20:36:31,125 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

2021-01-02 20:36:31,125 DEBG 'watchdog-script' stdout output:
[info] ruTorrent plugins initialised

There is clearly something up with this script. I assume there's a reason why you wait 15-30 minutes to do the check, I guess because that's how long it takes to show up publicly on one of those sites, or for some anti API flooding reason? Either way, the reason that the open port check fails is because it doesn't seem to actually reconfigure automatically unless you let the script restart itself after waiting 30 minutes for the check. So you've got the working reconfigure job only set to run AFTER a restart of the container when the open port check fails (which it always fails because it never re-assigns the right way the first time around).

 

So yeah after the seemingly pointless 30 minute wait and failure to reconfigure the first time. When it ultimately always reboots and does it properly, it works. As shown in the below image where I am now fully connectable. So the port in rtorrent.rc DOES matter. However, it must be reassigned by the script to work and this does not happen when the container is started or restarted. Only after the open port check fails and it restarts on its own.

Screenshot_2021-01-02 Client Tracker Details My Anonamouse.png

Edited by plantsandbinary
Link to comment
2 hours ago, plantsandbinary said:

There is clearly something up with this script. I assume there's a reason why you wait 15-30 minutes to do the check

yes, the reason for the wait between checks is because i check to see if the port is open (or not) by doing a web scrape of several public websites, thus i dont want to hit them too frequently (ip block or ban otherwise).

 

i will check to see if i can replicate the issue, it SHOULD set the port on each start and then subsequent 30 minute periods for the checks to run and possible reconfigure if the port is closed.

Link to comment
2 hours ago, plantsandbinary said:

I've seen it do the above once or twice, but I don't know why it doesn't ALWAYS do it. That middle line is the most important, because that's the actual port being changed by the script from whatever is in rtorrent.rc to whatever has been randomly forwarded by PIA. Half the time I don't see that though in the log.

let me clarify this, the reason that you see the middle line, as in:-

 

2 hours ago, plantsandbinary said:

56158-56158

is because on a reconfigure AFTER rtorrent is running, the port change is done using XMLRPC, whereas on the first run the port change is done via command line options to rtorrent, thus you do not see the port echo'd out to the log, still investigating this, but so far i cannot replicate the issue....

Edited by binhex
Link to comment

3 restarts, on each restart i was issued a new port (as expected) and each time it was configured correctly on startup of rtorrent (no 30 minute wait).

 

can you please attach your rtorrent.rc file, i want to see if there is anything obvious in there.

Link to comment

Thanks for the reply. Here's my rtorrent.rc file:

 

# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.

# Maximum number of simultaneous downloads and uploads slots (global slots!) (`max_downloads_global`, `max_uploads_global`)
#
#throttle.max_downloads.global.set = 300
#throttle.max_uploads.global.set   = 300

# Global upload and download rate in KiB. "0" for unlimited.
#
#throttle.global_down.max_rate.set_kb = 0
#throttle.global_up.max_rate.set_kb = 0

# Maximum number of simultaneous downloads and uploads slots per torrent (`max_uploads`) Default: `50` for both
#
#throttle.max_downloads.set = 50
#throttle.max_uploads.set = 8

# Maximum and minimum number of peers to connect to per torrent.
#
#throttle.min_peers.normal.set = 100
#throttle.max_peers.normal.set = 200

# Same as above but for seeding completed torrents (-1 = same as downloading)
#
#throttle.min_peers.seed.set = 10
#throttle.max_peers.seed.set = 50

# Maximum number of connections rtorrent can accept/make (`sockets`)
#
#network.max_open_sockets.set = 1200

# Maximum number of open files rtorrent can keep open (you have to modify the system wide settings with ulimit!) (`set_max_open_files`)
#
#network.max_open_files.set = 600

# Default directory to save the downloaded torrents.
#
execute = {/bin/bash,-c,mkdir -p /data/incomplete}
directory.default.set = /data/incomplete/

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
#
execute = {/bin/bash,-c,mkdir -p /config/rtorrent/session}
session.path.set = /config/rtorrent/session/

# Watch a directory for new torrents, and stop those that have been
# deleted.
#
#schedule2 = watch_directory,5,5,load.start=./watch/*.torrent
#schedule2 = untied_directory,5,5,stop_untied=

# Close torrents when diskspace is low.
#
#schedule2 = low_diskspace,5,60,close_low_diskspace=100M

# The ip address reported to the tracker.
#
#network.local_address.set = 127.0.0.1
#network.local_address.set = rakshasa.no

# The ip address the listening socket and outgoing connections is
# bound to.
#
#network.bind_address.set = 127.0.0.1
#network.bind_address.set = rakshasa.no

# Port range to use for listening.
#
network.port_range.set = 55180-55180

# Start opening ports at a random position within the port range.
#
network.port_random.set = no

# Disable check for SSL cert for tracker
#
network.http.ssl_verify_peer.set = 0

# Check hash for finished torrents. Might be useful until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#
#pieces.hash.on_completion.set = no

# Set whether the client should try to connect to UDP trackers.
#
trackers.use_udp.set = yes

# Set the maximum permitted single file size in a torrent.
# Note if you do not set this and attempt to start a torrent that
# contains a file larger than 512 GB (default) then the torrent will
# not start.
#
#system.file.max_size.set = 1024G

# Alternative calls to bind and ip that should handle dynamic ip's.
#
#schedule2 = ip_tick,0,1800,ip=rakshasa
#schedule2 = bind_tick,0,1800,bind=rakshasa

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# allow_incoming - Allow incoming encrypted connections from other peers
# try_outgoing - Attempt to set up encryption when initiating a connection
# require - Require encryption, and reject to peers who don't support it
# require_RC4 - Require RC4 encryption specifically
# enable_retry - If a peer is rejected for not supporting the encryption we need, retry the handshake
# prefer_plaintext - Prefer plaintext encryption
#
protocol.encryption.set = allow_incoming,try_outgoing,enable_retry

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
# 
dht.mode.set = auto

# UDP port to use for DHT. 
#
dht.port.set = 6426

# Enable peer exchange (for torrents not marked private)
#
protocol.pex.set = yes

# Set downlad list layout style. ("full", "compact")
#
#ui.torrent_list.layout.set = "full"

# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC)
#
# Use a IP socket with scgi_port, or a Unix socket with scgi_local.
# schedule can be used to set permissions on the unix socket.
#
scgi_port = 0.0.0.0:5000
#scgi_local = /home/user/rtorrent/rpc.socket
#schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"

# Initialise ruTorrent plugins (required for rss and scheduler plugins) on startup 
# (normally triggered by a browser opening the web ui).
#
# The command below in practice does NOT always trigger (possible race condition?) and thus
# the same command has been added to the script /home/nobody/initplugins.sh in order to 
# attempt to ensure all plugins are initialised.
#
# NOTE - Do not double quote or curly brackets env var for 'WEBUI_USER'
#
execute = {/bin/bash,-c,/usr/bin/sleep 10s && /usr/bin/php /usr/share/webapps/rutorrent/php/initplugins.php $WEBUI_USER &}

I've tested another 4 something times restarting the container, after setting a 30 minute timer on my mobile phone. I don't get an open port until roughly 30 minutes after starting or restarting the container. The main tracker I am using reports that the port I selected in the rtorrent.rc file is what is being used and for that port it's closed. Similarly, the websites I use to check also give the same error.

 

As I said, after the automatic restart when the port check fails in the script, it works 100% of the time. So far this happens the same way every single time. 30 minutes of rtorrent using the config file port, and then afterwards the port is reassigned and works immediately and is immediately updated on the tracker page. Please let me know if you need any other files.

Edited by plantsandbinary
Link to comment

It looks like when you are not using vpn and you want to set a incoming port / dht port, setting via the web ui won't take effect or be saved. 

 

Need to set via \appdata\binhex-rtorrentvpn\rtorrent\config\rtorrent.rc directly when the docker image is not running, which will be saved and works. 

Link to comment
On 9/27/2019 at 5:45 PM, td00 said:

Another update, one day passed since I rebooted to get everything working again and when I logged in... same issue.

 

*Edit - Sept/30th/2019* OK so this is happening now every few hours.

Did you ever resolve this issue?  I'm dealing with this now too 😕

Link to comment
6 minutes ago, JackPo said:

Did you ever resolve this issue?  I'm dealing with this now too 😕

actually, looked in my log and saw a bunch of issues around rtorrent listening to new IP after VPN reconnects, seems like it can't access rtxmlrpc.

[info] rTorrent listening interface IP 10.16.112.9 and VPN provider IP 10.26.112.111 different, marking for reconfigure




2021-01-04 14:33:45,124 DEBG 'watchdog-script' stdout output:


[info] rTorrent incoming port 45817 and VPN incoming port 50542 different, marking for reconfigure




2021-01-04 14:33:45,125 DEBG 'watchdog-script' stderr output:


/home/nobody/rtorrent.sh: line 13: rtxmlrpc: command not found




2021-01-04 14:33:45,125 DEBG 'watchdog-script' stderr output:


/home/nobody/rtorrent.sh: line 19: rtxmlrpc: command not found




2021-01-04 14:33:45,126 DEBG 'watchdog-script' stderr output:


/home/nobody/rtorrent.sh: line 24: rtxmlrpc: command not found



 

Link to comment
19 hours ago, kbbeer said:

"PHP message: PHP Warning: require_once(/config/rutorrent/conf/config.php): failed to open stream: Too many open files

a quick google, this looks relevant (ignore the fact its not for rtorrent/rutorrent), not sure whether you are using unraid, but looks like you need to up the open files limit for your os:- https://github.com/guzzle/guzzle/issues/1927

 

 

Link to comment

Hey @binhex, I have been using your apps on unraid for sometime now but I am facing issue with rtorrentvpn for unraid. Please help me with this.

 

There are multiple torrents all the time throwing below mentioned error until it updates the torrent.

Tracker: [Failure reason \"Invalid user-agent !\"]

It happens when a torrent surpasses 30minutes and 0seconds marker and it remains in the error list until it updates and become 0seconds.

 

I have shared the screenshot for you. Screenshot: VzWQA6x.png

 

 

Thanks.

 

 

Link to comment

Hello, im trying to setup rtorrentvpn but i cant access webui. I always get connection failed even with openvpn and wireguard (using mullvad) but the docker is starting.

 

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='binhex-rtorrentvpn' --net='bridge' --privileged=true -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'VPN_ENABLED'='yes' -e 'VPN_USER'='myusername' -e 'VPN_PASS'='mypassword' -e 'VPN_PROV'='custom' -e 'VPN_CLIENT'='openvpn' -e 'VPN_OPTIONS'='' -e 'STRICT_PORT_FORWARD'='yes' -e 'ENABLE_PRIVOXY'='no' -e 'ENABLE_AUTODL_IRSSI'='no' -e 'ENABLE_RPC2'='yes' -e 'ENABLE_RPC2_AUTH'='yes' -e 'ENABLE_WEBUI_AUTH'='yes' -e 'RPC2_USER'='admin' -e 'RPC2_PASS'='admin' -e 'WEBUI_USER'='admin' -e 'WEBUI_PASS'='admin' -e 'LAN_NETWORK'='192.168.1.0/24' -e 'NAME_SERVERS'='209.222.18.222,84.200.69.80,37.235.1.174,1.1.1.1,209.222.18.218,37.235.1.177,84.200.70.40,1.0.0.1' -e 'ADDITIONAL_PORTS'='6977,8287,11703,31947,62836' -e 'DEBUG'='true' -e 'PHP_TZ'='UTC' -e 'UMASK'='000' -e 'PUID'='99' -e 'PGID'='100' -p '5000:5000/tcp' -p '9080:9080/tcp' -p '9445:9443/tcp' -p '8121:8118/tcp' -v '/mnt/user/downloads/':'/downloads':'rw' -v '/mnt/disks/appdata_docker/appdata/binhex-rtorrentvpn':'/config':'rw' --sysctl="net.ipv4.conf.all.src_valid_mark=1" 'binhex/arch-rtorrentvpn'

 

Edited by Kishin
Link to comment
On 1/11/2021 at 9:11 AM, Kishin said:

Hello, im trying to setup rtorrentvpn but i cant access webui. I always get connection failed even with openvpn and wireguard (using mullvad) but the docker is starting.

 

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='binhex-rtorrentvpn' --net='bridge' --privileged=true -e TZ="Europe/Paris" -e HOST_OS="Unraid" -e 'VPN_ENABLED'='yes' -e 'VPN_USER'='myusername' -e 'VPN_PASS'='mypassword' -e 'VPN_PROV'='custom' -e 'VPN_CLIENT'='openvpn' -e 'VPN_OPTIONS'='' -e 'STRICT_PORT_FORWARD'='yes' -e 'ENABLE_PRIVOXY'='no' -e 'ENABLE_AUTODL_IRSSI'='no' -e 'ENABLE_RPC2'='yes' -e 'ENABLE_RPC2_AUTH'='yes' -e 'ENABLE_WEBUI_AUTH'='yes' -e 'RPC2_USER'='admin' -e 'RPC2_PASS'='admin' -e 'WEBUI_USER'='admin' -e 'WEBUI_PASS'='admin' -e 'LAN_NETWORK'='192.168.1.0/24' -e 'NAME_SERVERS'='209.222.18.222,84.200.69.80,37.235.1.174,1.1.1.1,209.222.18.218,37.235.1.177,84.200.70.40,1.0.0.1' -e 'ADDITIONAL_PORTS'='6977,8287,11703,31947,62836' -e 'DEBUG'='true' -e 'PHP_TZ'='UTC' -e 'UMASK'='000' -e 'PUID'='99' -e 'PGID'='100' -p '5000:5000/tcp' -p '9080:9080/tcp' -p '9445:9443/tcp' -p '8121:8118/tcp' -v '/mnt/user/downloads/':'/downloads':'rw' -v '/mnt/disks/appdata_docker/appdata/binhex-rtorrentvpn':'/config':'rw' --sysctl="net.ipv4.conf.all.src_valid_mark=1" 'binhex/arch-rtorrentvpn'

supervisord.log 28.95 kB · 2 downloads

it looks like rtorrent is unable to start, most probably due to incorrect changes to the config file, delete the file /config/rtorrent/config/rtorrent.rc and then restart the container.

Link to comment

Hi, I'm trying to switch over to this from the delugevpn docker since I was having issues accessing the webui and I'm having issues access this webui when I try and set it up. I've attached a log from when I start it up and try and connect to the webui and also a screenshot of what I have the settings of the docker at. I've removed any usernames and passwords that would have been in them. I use Mullvad as the vpn. I've tried scouring this thread and I can't seem to find anything so I apologize if this has been answered before but I figured at this time it might be better for my time to just ask rather than spend more time just trying to brute force this since I'm going nowhere right now. If more info is needed I can definitely provide that.

 

image.thumb.png.0cab9b298a0e56613e31249af610fe1c.png

supervisord usernames and passwords removed.log

Link to comment
5 hours ago, LINK1733 said:

Hi, I'm trying to switch over to this from the delugevpn docker since I was having issues accessing the webui and I'm having issues access this webui when I try and set it up. I've attached a log from when I start it up and try and connect to the webui and also a screenshot of what I have the settings of the docker at. I've removed any usernames and passwords that would have been in them. I use Mullvad as the vpn. I've tried scouring this thread and I can't seem to find anything so I apologize if this has been answered before but I figured at this time it might be better for my time to just ask rather than spend more time just trying to brute force this since I'm going nowhere right now. If more info is needed I can definitely provide that.

 

image.thumb.png.0cab9b298a0e56613e31249af610fe1c.png

supervisord usernames and passwords removed.log 19.51 kB · 1 download

your lan_network is incorrect, see Q4:- https://github.com/binhex/documentation/blob/master/docker/faq/vpn.md

Link to comment
  • binhex locked this topic
Guest
This topic is now closed to further replies.