From d6b39e66d15b45a7f9bc30628e23f055c179da73 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Sat, 5 Feb 2022 23:15:20 +0000 Subject: [PATCH] chore(env): `SERVER_COUNTRIES` variable - With retro-compatibility with `COUNTRY` --- Dockerfile | 2 +- internal/configuration/sources/env/serverselection.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 873dfcc8..d95fb01c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -93,7 +93,7 @@ ENV VPN_SERVICE_PROVIDER=pia \ WIREGUARD_ADDRESSES= \ # VPN server filtering REGION= \ - COUNTRY= \ + SERVER_COUNTRIES= \ CITY= \ SERVER_HOSTNAME= \ # # Mullvad only: diff --git a/internal/configuration/sources/env/serverselection.go b/internal/configuration/sources/env/serverselection.go index 33142bb8..adcad733 100644 --- a/internal/configuration/sources/env/serverselection.go +++ b/internal/configuration/sources/env/serverselection.go @@ -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") } }