Maintenance: improve DNS settings log
This commit is contained in:
@@ -3,7 +3,9 @@ package settings
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/dns/pkg/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -18,34 +20,47 @@ func Test_DNS_Lines(t *testing.T) {
|
||||
PlaintextAddress: net.IP{1, 1, 1, 1},
|
||||
},
|
||||
lines: []string{
|
||||
"DNS over TLS disabled, using plaintext DNS 1.1.1.1",
|
||||
" |--DNS:",
|
||||
" |--Plaintext address: 1.1.1.1",
|
||||
" |--Keep nameserver (disabled blocking): no",
|
||||
" |--DNS over TLS: disabled",
|
||||
},
|
||||
},
|
||||
"enabled DOT": {
|
||||
settings: DNS{
|
||||
Enabled: true,
|
||||
Enabled: true,
|
||||
KeepNameserver: true,
|
||||
Unbound: models.Settings{
|
||||
Providers: []string{"cloudflare"},
|
||||
},
|
||||
BlockMalicious: true,
|
||||
BlockAds: true,
|
||||
BlockSurveillance: true,
|
||||
UpdatePeriod: time.Hour,
|
||||
},
|
||||
lines: []string{
|
||||
"DNS settings:",
|
||||
" |--Unbound:",
|
||||
" |--DNS over TLS provider:",
|
||||
" |--Listening port: 0",
|
||||
" |--Access control:",
|
||||
" |--Allowed:",
|
||||
" |--Caching: disabled",
|
||||
" |--IPv4 resolution: disabled",
|
||||
" |--IPv6 resolution: disabled",
|
||||
" |--Verbosity level: 0/5",
|
||||
" |--Verbosity details level: 0/4",
|
||||
" |--Validation log level: 0/2",
|
||||
" |--Blocked hostnames:",
|
||||
" |--Blocked IP addresses:",
|
||||
" |--Allowed hostnames:",
|
||||
" |--Block malicious: disabled",
|
||||
" |--Block ads: disabled",
|
||||
" |--Block surveillance: disabled",
|
||||
" |--Update: deactivated",
|
||||
" |--Keep nameserver (disabled blocking): no",
|
||||
" |--DNS:",
|
||||
" |--Keep nameserver (disabled blocking): yes",
|
||||
" |--DNS over TLS:",
|
||||
" |--Unbound:",
|
||||
" |--DNS over TLS providers:",
|
||||
" |--cloudflare",
|
||||
" |--Listening port: 0",
|
||||
" |--Access control:",
|
||||
" |--Allowed:",
|
||||
" |--Caching: disabled",
|
||||
" |--IPv4 resolution: disabled",
|
||||
" |--IPv6 resolution: disabled",
|
||||
" |--Verbosity level: 0/5",
|
||||
" |--Verbosity details level: 0/4",
|
||||
" |--Validation log level: 0/2",
|
||||
" |--Blocked hostnames:",
|
||||
" |--Blocked IP addresses:",
|
||||
" |--Allowed hostnames:",
|
||||
" |--Block malicious: enabled",
|
||||
" |--Block ads: enabled",
|
||||
" |--Block surveillance: enabled",
|
||||
" |--Update: every 1h0m0s",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user