diff --git a/README.md b/README.md index ec05082c..65dc6760 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ docker run --rm --network=container:pia alpine:3.11 wget -qO- https://ipinfo.io | Environment variable | Default | Description | | --- | --- | --- | +| `VPNSP` | `pia` | VPN Service Provider, one of `pia`, `mullvad` | | `REGION` | `CA Montreal` | (PIA only) one of the [PIA regions](https://www.privateinternetaccess.com/pages/network/) | | `COUNTRY` | `Sweden` | (Mullvad only) one of the [Mullvad countries](https://mullvad.net/en/servers/#openvpn) | | `CITY` | | (Mullvad only, *optional*) one of the [Mullvad cities](https://mullvad.net/en/servers/#openvpn) | diff --git a/internal/params/mullvad.go b/internal/params/mullvad.go index 318bdb04..8ccff5d4 100644 --- a/internal/params/mullvad.go +++ b/internal/params/mullvad.go @@ -11,7 +11,7 @@ import ( // GetMullvadCountry obtains the country for the Mullvad server from the // environment variable COUNTRY func (p *paramsReader) GetMullvadCountry() (country models.MullvadCountry, err error) { - choices := append(constants.MullvadCityChoices(), "") + choices := append(constants.MullvadCountryChoices(), "") s, err := p.envParams.GetValueIfInside("COUNTRY", choices) return models.MullvadCountry(strings.ToLower(s)), err } diff --git a/internal/settings/mullvad.go b/internal/settings/mullvad.go index 328c966b..d5d8025e 100644 --- a/internal/settings/mullvad.go +++ b/internal/settings/mullvad.go @@ -35,6 +35,8 @@ func GetMullvadSettings(params params.ParamsReader) (settings Mullvad, err error if err != nil { return settings, err } + // Remove spaces in user ID to simplify user's life, thanks @JeordyR + settings.User = strings.ReplaceAll(settings.User, " ", "") settings.Country, err = params.GetMullvadCountry() if err != nil { return settings, err