-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: add env variable to run script in addition to saving port to file #26
Comments
When set a custom script can be run once a port is successfully forwarded. See issue #26
I've added I briefly tested it with qBittorrent along with mounting the following script and it seemed to work as expected.
|
@thrnz you ROCK! However, when I:
Then I add a torrent to QBittorrent, the orange connection status is shown in the bottom. As soon as I run the script manually, # of seeds and peers goes from 0 to a high number, download goes fast and after a minute or so, the orange icon turns green.
I only added PORT_SCRIPT. I also simply stopped QB container, then restarted your container and started QB again: it doesn't seem to update the listen port. |
OK I can confirm: When stopping QB and restarting the vpn container, I waited 10sec before starting QB container --> green icon. It is not clear to me why it works after a restart, but not after creation. |
@thrnz I attempted to try out your scrip running it manually from within the VPN container. My qBittorrent container is up and running an using the VPN network, but I am not able to curl it from the VPN container (I get "Failed to connect to localhost port 8080 after 0 ms"). Is it something I might be missing? |
I've just manually ran that script against a qBittorrent 4.3.8 container that shares the network with the vpn container and it still seems to work as expected:
Nothing immediately comes to mind as to why it would be failing. I don't suppose you've changed qBittorrent's webui to listen on another port, or to be https only or anything? Does |
Hi, I use a custom script to forward the port, before @thrnz implement the post-script function, so I want to share with you my script, too me seems that works, maybe someone can use it to create a new and better script.
As you can see, some configuration variables are unset, like Ps, I always see the green connection from qBittorrent, but I've to set J |
If qBittorrent shows incoming TCP connections in the 'peers' tab (look for at least one BT peer with one of the 'flags' being an |
@Jorman, your container is connected via the network of Wireguard-pia. Did you test if the port is open via that container, for example via a terminal connection within the container? If you are simply opening a browser on your host system and going to a website and filling in that port to test, you are simply testing if you opened a port in your router. You are not testing from within the tunnel. So your test is useless. |
Hi @zilexa |
This can be closed. It all works fine. |
In case that's useful to someone, here's the PORT_SCRIPT I used for transmission:
|
For someone less inclined, The script goes inside the container and is run inside the container which passes the port to the QBitTorrent container right? |
@jacobonorte no, see the documentation about the script. There is an env variable for your Docker Compose that points to the script. That should be a location in your volume mapping of your service. See my compose file here and notice the volumes below this line: so my script is simply stored in $HOME/docker/vpn-proxy/pia-shared/ which is mapped via the Volumes section. So I only do this once:
(note if you edit the script, it will loose its execution setting (chmod +x) so you need to do that again. |
Im getting this error EDIT: success . My solution: Had to add another volume: "/home/ggg/docker/pia/script.sh:/script.sh " For Future reference if is someone having trouble , Here is my full docker-compose.yml file which is now working fine with webui port exposed in the internet. Change according to your needs.
|
you are a goat, I cant explain enough all the help this repo and all you smart people fixing it up. Thank you! |
May I suggest to add a tiny feature?
Currently, when port forwarding with PIA has been configured, the port is saved to port.dat. Would it be possible to add a secondary action to that: run a bash script.
Allow users to add an environment variable in Compose that specifies the path of the .sh file. This way we do not need inotify, a seperate container etc. and users can use a script for their favourite torrent client to update the port.
For QBittorrent: #3 (comment)
For Transmission: #3 (comment)
For Deluge: #16 (comment)
This github has become a nice repository of interesting info :)
The text was updated successfully, but these errors were encountered: