mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 20:10:11 +02:00
d81d4bbda3
- Fixes #420 - Revert to docker/build-push-action@v2.4.0
53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package configuration
|
|
|
|
import (
|
|
"github.com/qdm12/gluetun/internal/constants"
|
|
)
|
|
|
|
func (settings *Provider) torguardLines() (lines []string) {
|
|
if len(settings.ServerSelection.Countries) > 0 {
|
|
lines = append(lines, lastIndent+"Countries: "+commaJoin(settings.ServerSelection.Countries))
|
|
}
|
|
|
|
if len(settings.ServerSelection.Cities) > 0 {
|
|
lines = append(lines, lastIndent+"Cities: "+commaJoin(settings.ServerSelection.Cities))
|
|
}
|
|
|
|
if len(settings.ServerSelection.Hostnames) > 0 {
|
|
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
|
|
}
|
|
|
|
return lines
|
|
}
|
|
|
|
func (settings *Provider) readTorguard(r reader) (err error) {
|
|
settings.Name = constants.Torguard
|
|
|
|
settings.ServerSelection.TCP, err = readProtocol(r.env)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.TorguardCountryChoices())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
settings.ServerSelection.Cities, err = r.env.CSVInside("CITY", constants.TorguardCityChoices())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.TorguardHostnameChoices())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|