gluetun icon indicating copy to clipboard operation
gluetun copied to clipboard

Implement support for Wireguard in PIA

Open FireMasterK opened this issue 1 year ago • 14 comments

Closes #612 Untested, as I don't have a PIA account

Warning: I don't really write a lot of Go code, so the structure may be bad!

FireMasterK avatar Sep 01 '23 22:09 FireMasterK

I'm willing to test this. Already built the image but what should I put in my compose file?

garlik82 avatar Sep 03 '23 21:09 garlik82

I'm willing to test this. Already built the image but what should I put in my compose file?

You should be able to set your account credentials in the openvpn user credentials, and set VPN_TYPE=wireguard. You need not configure any wireguard keys, as ephemeral keys are automatically registered and used in the API.

FireMasterK avatar Sep 03 '23 22:09 FireMasterK

I'm willing to test this. Already built the image but what should I put in my compose file?

You should be able to set your account credentials in the openvpn user credentials, and set VPN_TYPE=wireguard. You need not configure any wireguard keys, as ephemeral keys are automatically registered and used in the API.

ERROR VPN settings: provider settings: VPN provider name is not valid for Wireguard: value is not one of the possible choices: private internet access must be one of airvpn, custom, ivpn, mullvad, nordvpn, surfshark or windscrib.

This is what I get.

If I put custom instead of PIA I get the error saying no endpoint set

garlik82 avatar Sep 03 '23 22:09 garlik82

ERROR VPN settings: provider settings: VPN provider name is not valid for Wireguard: value is not one of the possible choices: private internet access must be one of airvpn, custom, ivpn, mullvad, nordvpn, surfshark or windscrib.

This is what I get.

If I put custom instead of PIA I get the error saying no endpoint set

I've fixed this in the latest commit, please build and try it again.

FireMasterK avatar Sep 03 '23 22:09 FireMasterK

ERROR VPN settings: provider settings: VPN provider name is not valid for Wireguard: value is not one of the possible choices: private internet access must be one of airvpn, custom, ivpn, mullvad, nordvpn, surfshark or windscrib. This is what I get. If I put custom instead of PIA I get the error saying no endpoint set

I've fixed this in the latest commit, please build and try it again.

Now I get this:

ERROR [vpn] finding a VPN server: filtering servers: no server found: for VPN wireguard; protocol udp; region dk copenhagen; encryption preset strong


garlik82 avatar Sep 04 '23 05:09 garlik82

I've fixed this in the latest commit, please build and try it again.

Now I get this:

ERROR [vpn] finding a VPN server: filtering servers: no server found: for VPN wireguard; protocol udp; region dk copenhagen; encryption preset strong

Hi, please try again, this should now be fixed!

FireMasterK avatar Sep 04 '23 19:09 FireMasterK

How do I know the right thing to put in SERVER_REGIONS= ?

garlik82 avatar Sep 04 '23 20:09 garlik82

How do I know the right thing to put in SERVER_REGIONS= ?

Anything that works with OpenVPN should most likely work with Wireguard too.

FireMasterK avatar Sep 04 '23 21:09 FireMasterK

How do I know the right thing to put in SERVER_REGIONS= ?

Anything that works with OpenVPN should most likely work with Wireguard too.

It doesn't. Must likely it's searching on servers.json for a wireguard server but PIA only has ovpn server in the built in server list.

https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json (builtin server list) https://serverlist.piaservers.net/vpninfo/servers/v6 (pia server list)

garlik82 avatar Sep 04 '23 21:09 garlik82

It doesn't. Must likely it's searching on servers.json for a wireguard server but PIA only has ovpn server in the built in server list.

https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json (builtin server list) https://serverlist.piaservers.net/vpninfo/servers/v6 (pia server list)

Could you give it a go again? I managed to reproduce those errors without an account, and each of them should be fixed now.

You may need to disable the firewall with FIREWALL=off (not sure how to work around it currently)

FireMasterK avatar Sep 04 '23 23:09 FireMasterK

almost there.

ERROR [vpn] getting Wireguard connection: HTTP status code is not OK: https://www.privateinternetaccess.com/gtoken/generateToken: 403 403 Forbidden: response received:

403 Forbidden

403 Forbidden


cloudflare
</html

garlik82 avatar Sep 05 '23 06:09 garlik82

any way I could help to get support added for PIA wireguard?

Nikamura avatar Nov 12 '23 18:11 Nikamura

Is there a chance that this will be implemented somewhen? I would love to have that feature.

Skylinar avatar Jun 17 '24 20:06 Skylinar

any way I could help to get support added for PIA wireguard? Is there a chance that this will be implemented somewhen? I would love to have that feature.

Note you can already use it with the custom provider and wireguard. Not super easy, but it still relatively easy to do, and quite a few users are already doing this. This is still blocked by #137 which will get merged after release v3.39.0

qdm12 avatar Jun 17 '24 22:06 qdm12