chore(env): simplify Cyberghost retro logic
This commit is contained in:
@@ -25,17 +25,14 @@ func (r *Reader) readServerSelection(vpnProvider, vpnType string) (
|
|||||||
return ss, err
|
return ss, err
|
||||||
}
|
}
|
||||||
|
|
||||||
countriesCSV := os.Getenv("COUNTRY")
|
ss.Countries = envToCSV("COUNTRY")
|
||||||
if vpnProvider == constants.Cyberghost && countriesCSV == "" {
|
if vpnProvider == constants.Cyberghost && len(ss.Countries) == 0 {
|
||||||
// Retro-compatibility
|
// Retro-compatibility for Cyberghost using the REGION variable
|
||||||
countriesCSV = os.Getenv("REGION")
|
ss.Countries = envToCSV("REGION")
|
||||||
if countriesCSV != "" {
|
if len(ss.Countries) > 0 {
|
||||||
r.onRetroActive("REGION", "COUNTRY")
|
r.onRetroActive("REGION", "COUNTRY")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if countriesCSV != "" {
|
|
||||||
ss.Countries = lowerAndSplit(countriesCSV)
|
|
||||||
}
|
|
||||||
|
|
||||||
ss.Regions = envToCSV("REGION")
|
ss.Regions = envToCSV("REGION")
|
||||||
ss.Cities = envToCSV("CITY")
|
ss.Cities = envToCSV("CITY")
|
||||||
|
|||||||
Reference in New Issue
Block a user