chore(env): SERVER_NAMES variable

- With retro-compatibility with `SERVER_NAME`
This commit is contained in:
Quentin McGaw
2022-02-05 23:22:25 +00:00
parent a69c456965
commit fcab4ae3c6
2 changed files with 3 additions and 2 deletions

View File

@@ -109,7 +109,7 @@ ENV VPN_SERVICE_PROVIDER=pia \
# # Nordvpn only: # # Nordvpn only:
SERVER_NUMBER= \ SERVER_NUMBER= \
# # PIA and ProtonVPN only: # # PIA and ProtonVPN only:
SERVER_NAME= \ SERVER_NAMES= \
# # ProtonVPN only: # # ProtonVPN only:
FREE_ONLY= \ FREE_ONLY= \
# # Surfshark only: # # Surfshark only:

View File

@@ -46,7 +46,8 @@ func (r *Reader) readServerSelection(vpnProvider, vpnType string) (
_, hostnamesCSV := r.getEnvWithRetro("SERVER_HOSTNAMES", "SERVER_HOSTNAME") _, hostnamesCSV := r.getEnvWithRetro("SERVER_HOSTNAMES", "SERVER_HOSTNAME")
ss.Hostnames = lowerAndSplit(hostnamesCSV) ss.Hostnames = lowerAndSplit(hostnamesCSV)
ss.Names = envToCSV("SERVER_NAME") _, namesCSV := r.getEnvWithRetro("SERVER_NAMES", "SERVER_NAME")
ss.Names = lowerAndSplit(namesCSV)
if csv := os.Getenv("SERVER_NUMBER"); csv != "" { if csv := os.Getenv("SERVER_NUMBER"); csv != "" {
numbersStrings := strings.Split(csv, ",") numbersStrings := strings.Split(csv, ",")