firecat53 / dockerfiles

Dockerfiles: Gollum, Jackett, Miniflux, Nginx/PHP-FPM, Plex, Privatebin, Qbittorrent, Radarr, Sabnzbd, Samba, SSH Socks Proxy server, Sonarr, Syncthing, Transmission, Unifi Controller.
MIT License
623 stars 93 forks source link

Question around port forwarding setup #14

Closed jgilfoil closed 6 years ago

jgilfoil commented 6 years ago

So i'm trying to figure out the purpose of the below code. I'm gonna state a couple of assumptions, and hopefully you can point out anything I get wrong.

1) you've already setup your port forwarding through PIA's interface somewhere on their site. 2) This code is just a clever way to dynamically pull the current forwarded ports so that you can pass that along to other containers via the var/run/pia/pia_port file.

Did I get that correct?

client_id=$(head -n 100 /dev/urandom | sha256sum | tr -d " -")
json=$(curl "http://209.222.18.222:2000/?client_id=$client_id" 2>/dev/null)

Thanks! P.S. Really like your setup here, and i'm entirely jealous. I may attempt a similar strategy soon.

firecat53 commented 6 years ago

Information about PIA's port forwarding setup is here. It's only accessible via certain servers. So the answer to 1. is technically no...port forwarding is accessed through their API. There's no setup needed. The answer to 2. is yes.

Thanks for the kind words!

jgilfoil commented 6 years ago

Ahh ok, that link fills in the gap there, thanks!