Fix #135
This commit is contained in:
@@ -8,19 +8,29 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/params"
|
||||
)
|
||||
|
||||
const (
|
||||
enabled = "enabled"
|
||||
disabled = "disabled"
|
||||
)
|
||||
|
||||
// Settings contains all settings for the program to run
|
||||
type Settings struct {
|
||||
VPNSP models.VPNProvider
|
||||
OpenVPN OpenVPN
|
||||
System System
|
||||
DNS DNS
|
||||
Firewall Firewall
|
||||
TinyProxy TinyProxy
|
||||
ShadowSocks ShadowSocks
|
||||
PublicIPPeriod time.Duration
|
||||
VPNSP models.VPNProvider
|
||||
OpenVPN OpenVPN
|
||||
System System
|
||||
DNS DNS
|
||||
Firewall Firewall
|
||||
TinyProxy TinyProxy
|
||||
ShadowSocks ShadowSocks
|
||||
PublicIPPeriod time.Duration
|
||||
VersionInformation bool
|
||||
}
|
||||
|
||||
func (s *Settings) String() string {
|
||||
versionInformation := disabled
|
||||
if s.VersionInformation {
|
||||
versionInformation = enabled
|
||||
}
|
||||
return strings.Join([]string{
|
||||
"Settings summary below:",
|
||||
s.OpenVPN.String(),
|
||||
@@ -30,6 +40,7 @@ func (s *Settings) String() string {
|
||||
s.TinyProxy.String(),
|
||||
s.ShadowSocks.String(),
|
||||
"Public IP check period: " + s.PublicIPPeriod.String(),
|
||||
"Version information: " + versionInformation,
|
||||
"", // new line at the end
|
||||
}, "\n")
|
||||
}
|
||||
@@ -69,5 +80,9 @@ func GetAllSettings(paramsReader params.Reader) (settings Settings, err error) {
|
||||
if err != nil {
|
||||
return settings, err
|
||||
}
|
||||
settings.VersionInformation, err = paramsReader.GetVersionInformation()
|
||||
if err != nil {
|
||||
return settings, err
|
||||
}
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user