Maint: remove NordVPN SERVER_NAME filter

- Filter was not effective
- Is to be deprecated in v4 anyway
- Bump NordVPN server model version to `3`
- Remove `Name` field from NordVPN server model
This commit is contained in:
Quentin McGaw (desktop)
2021-09-21 23:56:29 +00:00
parent 9a1d9c5d74
commit 6bcbaf085d
8 changed files with 3 additions and 5162 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ ENV VPNSP=pia \
OPENVPN_CLIENTKEY_SECRETFILE=/run/secrets/openvpn_clientkey \
# # Nordvpn only:
SERVER_NUMBER= \
# # NordVPN and ProtonVPN only:
# # PIA and ProtonVPN only:
SERVER_NAME= \
# # ProtonVPN only:
FREE_ONLY= \
-5
View File
@@ -27,11 +27,6 @@ func (settings *Provider) readNordvpn(r reader) (err error) {
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
}
settings.ServerSelection.Names, err = r.env.CSVInside("SERVER_NAME", constants.NordvpnHostnameChoices(servers))
if err != nil {
return fmt.Errorf("environment variable SERVER_NAME: %w", err)
}
settings.ServerSelection.Numbers, err = readNordVPNServerNumbers(r.env)
if err != nil {
return err
-8
View File
@@ -25,11 +25,3 @@ func NordvpnHostnameChoices(servers []models.NordvpnServer) (choices []string) {
}
return makeUnique(choices)
}
func NordvpnNameChoices(servers []models.NordvpnServer) (choices []string) {
choices = make([]string, len(servers))
for i := range servers {
choices[i] = servers[i].Name
}
return makeUnique(choices)
}
-1
View File
@@ -65,7 +65,6 @@ type MullvadServer struct {
type NordvpnServer struct { //nolint:maligned
Region string `json:"region"`
Hostname string `json:"hostname"`
Name string `json:"name"`
Number uint16 `json:"number"`
IP net.IP `json:"ip"`
TCP bool `json:"tcp"`
-1
View File
@@ -21,7 +21,6 @@ func (n *Nordvpn) filterServers(selection configuration.ServerSelection) (
case
utils.FilterByPossibilities(server.Region, selection.Regions),
utils.FilterByPossibilities(server.Hostname, selection.Hostnames),
utils.FilterByPossibilities(server.Name, selection.Names),
utils.FilterByPossibilities(serverNumber, selectedNumbers),
utils.FilterByProtocol(selection, server.TCP, server.UDP):
default:
+1 -1
View File
@@ -81,7 +81,7 @@ func Test_versions(t *testing.T) {
"Nordvpn": {
model: models.NordvpnServer{},
version: allServers.Nordvpn.Version,
digest: "a3b5d609",
digest: "a8043704",
},
"Privado": {
model: models.PrivadoServer{},
File diff suppressed because it is too large Load Diff
@@ -46,7 +46,6 @@ func GetServers(ctx context.Context, client *http.Client, minServers int) (
server := models.NordvpnServer{
Region: jsonServer.Country,
Hostname: jsonServer.Domain,
Name: jsonServer.Name,
Number: number,
IP: ip,
TCP: jsonServer.Features.TCP,