fix(protonvpn): set free field for free servers
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type ipToServer map[string]models.Server
|
||||
|
||||
func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
entryIP net.IP) {
|
||||
free bool, entryIP net.IP) {
|
||||
key := entryIP.String()
|
||||
|
||||
server, ok := its[key]
|
||||
@@ -24,6 +24,7 @@ func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
server.City = city
|
||||
server.ServerName = name
|
||||
server.Hostname = hostname
|
||||
server.Free = free
|
||||
server.UDP = true
|
||||
server.TCP = true
|
||||
server.IPs = []net.IP{entryIP}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
@@ -47,6 +48,12 @@ func (u *Updater) FetchServers(ctx context.Context, minServers int) (
|
||||
hostname := physicalServer.Domain
|
||||
entryIP := physicalServer.EntryIP
|
||||
|
||||
lowerCaseName := strings.ToLower(name)
|
||||
var free bool
|
||||
if strings.Contains(hostname, "free") || strings.Contains(lowerCaseName, "free") {
|
||||
free = true
|
||||
}
|
||||
|
||||
// Note: for multi-hop use the server name or hostname
|
||||
// instead of the country
|
||||
countryCode := logicalServer.ExitCountry
|
||||
@@ -55,7 +62,7 @@ func (u *Updater) FetchServers(ctx context.Context, minServers int) (
|
||||
u.warner.Warn(warning)
|
||||
}
|
||||
|
||||
ipToServer.add(country, region, city, name, hostname, entryIP)
|
||||
ipToServer.add(country, region, city, name, hostname, free, entryIP)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106773,7 +106773,7 @@
|
||||
},
|
||||
"protonvpn": {
|
||||
"version": 4,
|
||||
"timestamp": 1655576932,
|
||||
"timestamp": 1655576953,
|
||||
"servers": [
|
||||
{
|
||||
"vpn": "openvpn",
|
||||
@@ -108586,6 +108586,7 @@
|
||||
"hostname": "node-jp-13.protonvpn.net",
|
||||
"tcp": true,
|
||||
"udp": true,
|
||||
"free": true,
|
||||
"ips": [
|
||||
"45.14.71.5"
|
||||
]
|
||||
@@ -109016,6 +109017,7 @@
|
||||
"hostname": "node-nl-17.protonvpn.net",
|
||||
"tcp": true,
|
||||
"udp": true,
|
||||
"free": true,
|
||||
"ips": [
|
||||
"192.40.57.231"
|
||||
]
|
||||
@@ -111183,6 +111185,7 @@
|
||||
"hostname": "node-us-41.protonvpn.net",
|
||||
"tcp": true,
|
||||
"udp": true,
|
||||
"free": true,
|
||||
"ips": [
|
||||
"172.98.93.226"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user