Skip to content
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

Bug: cannot use custom provider with PIA port forwarding code #2147

Open
Carl-Elkhoury opened this issue Mar 8, 2024 · 3 comments
Open

Bug: cannot use custom provider with PIA port forwarding code #2147

Carl-Elkhoury opened this issue Mar 8, 2024 · 3 comments

Comments

@Carl-Elkhoury
Copy link

Is this urgent?

No

Host OS

Ubuntu Jammy

CPU arch

x86_64

VPN service provider

Private Internet Access

What are you using to run the container

Portainer

What is the version of Gluetun

Running version latest built on 2024-03-07T12:32:25.391Z (commit 3254fc8)

What's the problem 🤔

As Wireguard isn't officially supported for PIA, I was able to run my PIA wireguard configuration via custom service provider which works great.
I was trying to add port forwarding by setting VPN_PORT_FORWARDING_PROVIDER to private internet access as written in the wiki here that states: Choose the custom port forwarding code to use. This is useful when using the custom provider with Wireguard.

When I do I get error "panic: server name cannot be empty" (see logs below)
When I try to add the server name, it seems like it is not an accepted parameter under custom provider: "VPN settings: provider settings: server selection: for VPN service provider custom: the server name specified is not valid: one or more values is set but there is no possible value available"

Would you know what I am doing wrong?

Thank you for the help! Love your work on gluetun, this service is awesome

Share your logs (at least 10 lines)

LOG1:

2024-03-08T18:59:30Z INFO [port forwarding] starting
panic: server name cannot be empty
goroutine 21 [running]:
github.com/qdm12/gluetun/internal/provider/privateinternetaccess.(*Provider).PortForward(0xc001a86918?, {0x109c7e0?, 0xc000194730?}, {{0x7ea4ae8e01b8, 0xc00010ebe0}, {{0x0, 0xffff0a148e01}, 0xc000010018}, 0xc001e9e450, {0x0, ...}})
	github.com/qdm12/gluetun/internal/provider/privateinternetaccess/portforward.go:33 +0x82e
github.com/qdm12/gluetun/internal/portforward/service.(*Service).Start(0xc0000c6a90, {0x109c7e0, 0xc000194730})
	github.com/qdm12/gluetun/internal/portforward/service/start.go:31 +0x391
github.com/qdm12/gluetun/internal/portforward.(*Loop).run(0xc00014d400, {0x109c7e0, 0xc000194730}, 0x0?, 0x0?, 0xc00007fbc0, 0x0?)
	github.com/qdm12/gluetun/internal/portforward/loop.go:119 +0x8e4
created by github.com/qdm12/gluetun/internal/portforward.(*Loop).Start in goroutine 8
	github.com/qdm12/gluetun/internal/portforward/loop.go:71 +0x219


LOG2:

2024-03-08T19:00:51Z INFO [routing] default route found: interface eth0, gateway 172.18.0.1, assigned IP 172.18.0.2 and family v4
2024-03-08T19:00:51Z INFO [routing] local ethernet link found: eth0
2024-03-08T19:00:51Z INFO [routing] local ipnet found: 172.18.0.0/16
2024-03-08T19:00:51Z INFO [firewall] enabling...
2024-03-08T19:00:51Z INFO [firewall] enabled successfully
2024-03-08T19:00:51Z INFO [storage] merging by most recent 17820 hardcoded servers and 17820 servers read from /gluetun/servers.json
2024-03-08T19:00:51Z ERROR VPN settings: provider settings: server selection: for VPN service provider custom: the server name specified is not valid: one or more values is set but there is no possible value available

Share your configuration

services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    volumes:
      - /root/gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=wireguard
      - VPN_ENDPOINT_IP=XXXX
      - VPN_ENDPOINT_PORT=XXX
      - WIREGUARD_PUBLIC_KEY=XXXX
      - WIREGUARD_PRIVATE_KEY=XXXX
      - WIREGUARD_ADDRESSES=XXXX
      - WIREGUARD_ALLOWED_IPS=XXXX
      - VPN_PORT_FORWARDING_PROVIDER="private internet access"
      - VPN_PORT_FORWARDING=on
      - SERVER_NAMES=XXX
      - GID= 0
      - UID= 0
@WestonSemones
Copy link

I also encountered this issue today. I similarly am using docker compose, Private Internet Access and running the latest version.

qdm12 added a commit that referenced this issue Apr 29, 2024
- fix PIA port forwarding code usage
- refers to #2147
@qdm12
Copy link
Owner

qdm12 commented Apr 29, 2024

Yep I didn't foresee this usage. I pushed 72e2e4b where now the server name required for port forwarding (for TLS name verification of PIA's API web server) is set from the first value of SERVER_NAMES if it is set. Can you please try it and see if it works? So for example set SERVER_NAMES=adelaide401 for the au-adelaide-pf.privacy.network server. You can lookup the server name matching your desired server in https://github.com/qdm12/gluetun/blob/master/internal/storage/servers.json if needed. If this works, I'll add extra checks to enforce SERVER_NAMES is set if using pia as the port forwarding code.

@qdm12 qdm12 changed the title Bug: Wireguard custom provider portforwarding for PIA not working Bug: cannot use custom provider with PIA port forwarding code Apr 29, 2024
@carmatana

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants