+ config: "statistics_interval" setting
This commit is contained in:
parent
cc2654c371
commit
fe23b33d7e
|
@ -107,6 +107,9 @@ type dnsConfig struct {
|
||||||
BindHost string `yaml:"bind_host"`
|
BindHost string `yaml:"bind_host"`
|
||||||
Port int `yaml:"port"`
|
Port int `yaml:"port"`
|
||||||
|
|
||||||
|
// time interval for statistics (in days)
|
||||||
|
StatsInterval uint `yaml:"statistics_interval"`
|
||||||
|
|
||||||
dnsforward.FilteringConfig `yaml:",inline"`
|
dnsforward.FilteringConfig `yaml:",inline"`
|
||||||
|
|
||||||
UpstreamDNS []string `yaml:"upstream_dns"`
|
UpstreamDNS []string `yaml:"upstream_dns"`
|
||||||
|
@ -161,8 +164,9 @@ var config = configuration{
|
||||||
BindPort: 3000,
|
BindPort: 3000,
|
||||||
BindHost: "0.0.0.0",
|
BindHost: "0.0.0.0",
|
||||||
DNS: dnsConfig{
|
DNS: dnsConfig{
|
||||||
BindHost: "0.0.0.0",
|
BindHost: "0.0.0.0",
|
||||||
Port: 53,
|
Port: 53,
|
||||||
|
StatsInterval: 1,
|
||||||
FilteringConfig: dnsforward.FilteringConfig{
|
FilteringConfig: dnsforward.FilteringConfig{
|
||||||
ProtectionEnabled: true, // whether or not use any of dnsfilter features
|
ProtectionEnabled: true, // whether or not use any of dnsfilter features
|
||||||
FilteringEnabled: true, // whether or not use filter lists
|
FilteringEnabled: true, // whether or not use filter lists
|
||||||
|
@ -264,6 +268,10 @@ func parseConfig() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !checkStatsInterval(config.DNS.StatsInterval) {
|
||||||
|
config.DNS.StatsInterval = 1
|
||||||
|
}
|
||||||
|
|
||||||
for _, cy := range config.Clients {
|
for _, cy := range config.Clients {
|
||||||
cli := Client{
|
cli := Client{
|
||||||
Name: cy.Name,
|
Name: cy.Name,
|
||||||
|
|
Loading…
Reference in New Issue