2021-03-05 23:12:19 -05:00
|
|
|
package configuration
|
|
|
|
|
|
|
|
|
|
import (
|
2021-07-23 02:34:15 +00:00
|
|
|
"fmt"
|
|
|
|
|
|
2021-03-05 23:12:19 -05:00
|
|
|
"github.com/qdm12/gluetun/internal/constants"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (settings *Provider) readFastestvpn(r reader) (err error) {
|
|
|
|
|
settings.Name = constants.Fastestvpn
|
|
|
|
|
|
|
|
|
|
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.FastestvpnHostnameChoices())
|
|
|
|
|
if err != nil {
|
2021-07-23 02:34:15 +00:00
|
|
|
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
|
2021-03-05 23:12:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.FastestvpnCountriesChoices())
|
|
|
|
|
if err != nil {
|
2021-07-23 02:34:15 +00:00
|
|
|
return fmt.Errorf("environment variable COUNTRY: %w", err)
|
2021-03-05 23:12:19 -05:00
|
|
|
}
|
|
|
|
|
|
2021-08-17 16:54:22 +00:00
|
|
|
return settings.ServerSelection.OpenVPN.readProtocolOnly(r.env)
|
2021-03-05 23:12:19 -05:00
|
|
|
}
|