qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
8.12k stars 374 forks source link

Bug: Windscribe Hostname List alternative names #1675

Open adyanth opened 1 year ago

adyanth commented 1 year ago

Ref #1667

Is this urgent?

No

Host OS

Any

CPU arch

None

VPN service provider

Windscribe

What are you using to run the container

docker run

What is the version of Gluetun

Running version latest built on 2023-06-08T22:48:56.392Z (commit ea19914)

What's the problem 🤔

There are alternative names to the same servers listed in the servers.json. For example, when downloading a Wireguard credential file from the config generator for US - West Los Angeles Lamar, lax-310-wg.whiskergalaxy.com is the server listed on it. But all the servers in the servers.json are of the format us-west-nnn.whiskergalaxy.com.

Doing an nslookup on the address,

❯ nslookup lax-310-wg.whiskergalaxy.com
Server:     10.10.11.254
Address:    10.10.11.254#53

Non-authoritative answer:
Name:   lax-310-wg.whiskergalaxy.com
Address: 89.187.187.99
Name:   lax-310-wg.whiskergalaxy.com
Address: 185.152.67.227
Name:   lax-310-wg.whiskergalaxy.com
Address: 89.187.185.35

Referencing them to the servers list by IP address, we get:

{
  "vpn": "wireguard",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-066.whiskergalaxy.com",
  "wgpubkey": "7CGKj3gnMrJ73Q3TX/YPtk94ZqX+H3kfBbMwfhze/Hg=",
  "ips": [
    "89.187.187.99"
  ]
},
{
  "vpn": "wireguard",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-069.whiskergalaxy.com",
  "wgpubkey": "7CGKj3gnMrJ73Q3TX/YPtk94ZqX+H3kfBbMwfhze/Hg=",
  "ips": [
    "185.152.67.227"
  ]
},
{
  "vpn": "wireguard",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-040.whiskergalaxy.com",
  "wgpubkey": "7CGKj3gnMrJ73Q3TX/YPtk94ZqX+H3kfBbMwfhze/Hg=",
  "ips": [
    "89.187.185.35"
  ]
},

If we look at the corresponding OpenVPN servers by hostname, we see some reference to the DNS name provided by windscribe in the Wireguard configuration as the SNI in x509 of OpenVPN, with an additional -wg prefix.

{
  "vpn": "openvpn",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-066.whiskergalaxy.com",
  "tcp": true,
  "udp": true,
  "x509": "lax-310.windscribe.com",
  "ips": [
    "89.187.187.97",
    "89.187.187.98"
  ]
},
{
  "vpn": "openvpn",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-069.whiskergalaxy.com",
  "tcp": true,
  "udp": true,
  "x509": "lax-310.windscribe.com",
  "ips": [
    "185.152.67.225",
    "185.152.67.226"
  ]
},
{
  "vpn": "openvpn",
  "region": "US West",
  "city": "Los Angeles",
  "hostname": "us-west-040.whiskergalaxy.com",
  "tcp": true,
  "udp": true,
  "x509": "lax-310.windscribe.com",
  "ips": [
    "89.187.185.33",
    "89.187.185.34"
  ]
},

From a usability perspective, it might be easier for users to add the hostname they see in the config file when they need to. connect to a particular location/server.

Share your logs

N/A
https://raw.githubusercontent.com/qdm12/gluetun/4a0f9c36ba2aa5055f16f2444cc83c66521e7c48/internal/storage/servers.json

Share your configuration

N/A
ShayBox commented 1 year ago

There's no way to provide the Windscribe location name (Cube, Harvard, etc), and the host names provided by the config generator aren't supported by Gluetun, they have a -wg suffix in the subdomain and the subdomains themselves don't exactly match any non -wg subdomains They match openvpn subdomains but they're also not on the supported list...

EDIT: You also can't manually enter them as the Wireguard endpoint address because it doesn't accept hostnames, only addresses, and the address the subdomain points to is dynamically changing.

EDIT2: Adding the location name and an env to select it, or adding all the domains to the list of supported hostnames/allowing unsupported hostnames would fix this.

EDIT3: The best I can come up with is to download all 43 Wireguard location configs, copy the public key, and search for the matching host name in the servers.json, and ping the endpoint address from the config to find the entry with the matching ip...

EDIT4: These are all the same, the hostname field should be a hostnames list and all the IPs together in one list. the public key matches in this case, that's only true for matching server locations. Note: there are other matching locations without matching public keys, these have different location names and are separate. was-324-wg.whiskergalaxy.com / was-324.whiskergalaxy.com not listed, but point to all of the IPs below.

{
  "vpn": "wireguard",
  "region": "US East",
  "city": "Washington DC",
  "hostname": "us-east-089.whiskergalaxy.com",
  "wgpubkey": "uZxQR1klZ1Ere9kA8Thp7CUgAlviSWXdYjagsNdunjM=",
  "ips": [
    "198.7.56.228"
  ]
},
{
  "vpn": "wireguard",
  "region": "US East",
  "city": "Washington DC",
  "hostname": "us-east-090.whiskergalaxy.com",
  "wgpubkey": "uZxQR1klZ1Ere9kA8Thp7CUgAlviSWXdYjagsNdunjM=",
  "ips": [
    "207.244.91.131"
  ]
},
{
  "vpn": "wireguard",
  "region": "US East",
  "city": "Washington DC",
  "hostname": "us-east-092.whiskergalaxy.com",
  "wgpubkey": "uZxQR1klZ1Ere9kA8Thp7CUgAlviSWXdYjagsNdunjM=",
  "ips": [
    "207.244.91.144"
  ]
},
{
  "vpn": "wireguard",
  "region": "US East",
  "city": "Washington DC",
  "hostname": "us-east-093.whiskergalaxy.com",
  "wgpubkey": "uZxQR1klZ1Ere9kA8Thp7CUgAlviSWXdYjagsNdunjM=",
  "ips": [
    "198.7.56.239"
  ]
}

Example:

{
  "vpn": "wireguard",
  "region": "US East",
  "city": "Washington DC",
  "hostnames": [ // This should be a list
    "us-east-089.whiskergalaxy.com",
    "us-east-090.whiskergalaxy.com",
    "us-east-092.whiskergalaxy.com",
    "us-east-093.whiskergalaxy.com",
    "was-324.whiskergalaxy.com",
    "was-324-wg.whiskergalaxy.com"
  ],
  "wgpubkey": "uZxQR1klZ1Ere9kA8Thp7CUgAlviSWXdYjagsNdunjM=", // This is the unique identifier
  "alt": "precedent", // This can be a unique identifier too
  "ips": [
    "198.7.56.228",
    "207.244.91.131",
    "207.244.91.144",
    "198.7.56.239"
  ]
}

EDIT5: You could also make it so if I provide the public key without anything else it'll pick all the servers with that public key.

I found kggnERjnDsc9j4BQR+vA4IHsCtJqO1pZtFiXcKESWzw= (Harvard) is missing too

Here's my docker-compose.yml for anyone that may want it, it has every location I have access to pre-defined https://gist.github.com/ShayBox/c59e28a8c8cca5f4c3c3f6281ba0cca7

Note: Glinda, Hawkins, Brown, and Grand Central don't connect for some reason, probably have outdated host names (even though they're updated automatically) because they connect if I manually ping the new subdomain and use the IP as the endpoint. Nope, it just doesn't try any other hostname except the first... (except grandcentral which only has one entry in servers.json, but manually pinging the new IP works)