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

@@ -25,12 +25,13 @@ func (r *Reader) readServerSelection(vpnProvider, vpnType string) (
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 {
// Retro-compatibility for Cyberghost using the REGION variable
ss.Countries = envToCSV("REGION")
if len(ss.Countries) > 0 {
r.onRetroActive("REGION", "COUNTRY")
r.onRetroActive("REGION", "SERVER_COUNTRIES")
}
}