Feature: Protonvpn filter servers with FREE_ONLY

This commit is contained in:
Quentin McGaw
2021-05-23 21:51:12 +00:00
parent bc7246f882
commit 0c4f01a892
6 changed files with 25 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package configuration
import (
"github.com/qdm12/gluetun/internal/constants"
"github.com/qdm12/golibs/params"
)
func (settings *Provider) protonvpnLines() (lines []string) {
@@ -25,6 +26,10 @@ func (settings *Provider) protonvpnLines() (lines []string) {
lines = append(lines, lastIndent+"Hostnames: "+commaJoin(settings.ServerSelection.Hostnames))
}
if settings.ServerSelection.FreeOnly {
lines = append(lines, lastIndent+"Free only: yes")
}
return lines
}
@@ -71,5 +76,10 @@ func (settings *Provider) readProtonvpn(r reader) (err error) {
return err
}
settings.ServerSelection.FreeOnly, err = r.env.YesNo("FREE_ONLY", params.Default("no"))
if err != nil {
return err
}
return nil
}