chore(env): SERVER_COUNTRIES variable

- With retro-compatibility with `COUNTRY`
This commit is contained in:
Quentin McGaw
2022-02-05 23:15:20 +00:00
parent 3f5c72d898
commit d6b39e66d1
2 changed files with 4 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ ENV VPN_SERVICE_PROVIDER=pia \
WIREGUARD_ADDRESSES= \ WIREGUARD_ADDRESSES= \
# VPN server filtering # VPN server filtering
REGION= \ REGION= \
COUNTRY= \ SERVER_COUNTRIES= \
CITY= \ CITY= \
SERVER_HOSTNAME= \ SERVER_HOSTNAME= \
# # Mullvad only: # # Mullvad only:

View File

@@ -25,12 +25,13 @@ func (r *Reader) readServerSelection(vpnProvider, vpnType string) (
return ss, err return ss, err
} }
ss.Countries = envToCSV("COUNTRY") _, countriesCSV := r.getEnvWithRetro("SERVER_COUNTRIES", "COUNTRY")
ss.Countries = lowerAndSplit(countriesCSV)
if vpnProvider == constants.Cyberghost && len(ss.Countries) == 0 { if vpnProvider == constants.Cyberghost && len(ss.Countries) == 0 {
// Retro-compatibility for Cyberghost using the REGION variable // Retro-compatibility for Cyberghost using the REGION variable
ss.Countries = envToCSV("REGION") ss.Countries = envToCSV("REGION")
if len(ss.Countries) > 0 { if len(ss.Countries) > 0 {
r.onRetroActive("REGION", "COUNTRY") r.onRetroActive("REGION", "SERVER_COUNTRIES")
} }
} }