Fix #135
This commit is contained in:
@@ -31,10 +31,6 @@ type DNS struct {
|
||||
}
|
||||
|
||||
func (d *DNS) String() string {
|
||||
const (
|
||||
enabled = "enabled"
|
||||
disabled = "disabled"
|
||||
)
|
||||
if !d.Enabled {
|
||||
return fmt.Sprintf("DNS over TLS disabled, using plaintext DNS %s", d.PlaintextAddress)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ func (s *ShadowSocks) String() string {
|
||||
if !s.Enabled {
|
||||
return "ShadowSocks settings: disabled"
|
||||
}
|
||||
log := "disabled"
|
||||
log := disabled
|
||||
if s.Log {
|
||||
log = "enabled"
|
||||
log = enabled
|
||||
}
|
||||
settingsList := []string{
|
||||
"ShadowSocks settings:",
|
||||
|
||||
@@ -21,9 +21,9 @@ func (t *TinyProxy) String() string {
|
||||
if !t.Enabled {
|
||||
return "TinyProxy settings: disabled"
|
||||
}
|
||||
auth := "disabled"
|
||||
auth := disabled
|
||||
if t.User != "" {
|
||||
auth = "enabled"
|
||||
auth = enabled
|
||||
}
|
||||
settingsList := []string{
|
||||
fmt.Sprintf("Port: %d", t.Port),
|
||||
|
||||
Reference in New Issue
Block a user