all: sync with master; upd chlog

This commit is contained in:
Ainar Garipov
2023-09-07 17:13:48 +03:00
parent 3be7676970
commit 7b93f5d7cf
306 changed files with 19770 additions and 4916 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,140 @@
// Package confmigrate provides a way to upgrade the YAML configuration file.
package confmigrate
import (
"bytes"
"fmt"
"github.com/AdguardTeam/golibs/log"
yaml "gopkg.in/yaml.v3"
)
// LastSchemaVersion is the most recent schema version.
const LastSchemaVersion uint = 27
// Config is a the configuration for initializing a [Migrator].
type Config struct {
// WorkingDir is an absolute path to the working directory of AdGuardHome.
WorkingDir string
}
// Migrator performs the YAML configuration file migrations.
type Migrator struct {
// workingDir is an absolute path to the working directory of AdGuardHome.
workingDir string
}
// New creates a new Migrator.
func New(cfg *Config) (m *Migrator) {
return &Migrator{
workingDir: cfg.WorkingDir,
}
}
// Migrate preforms necessary upgrade operations to upgrade file to target
// schema version, if needed. It returns the body of the upgraded config file,
// whether the file was upgraded, and an error, if any. If upgraded is false,
// the body is the same as the input.
func (m *Migrator) Migrate(body []byte, target uint) (newBody []byte, upgraded bool, err error) {
diskConf := yobj{}
err = yaml.Unmarshal(body, &diskConf)
if err != nil {
return body, false, fmt.Errorf("parsing config file for upgrade: %w", err)
}
currentInt, _, err := fieldVal[int](diskConf, "schema_version")
if err != nil {
// Don't wrap the error, since it's informative enough as is.
return body, false, err
}
current := uint(currentInt)
log.Debug("got schema version %v", current)
if err = validateVersion(current, target); err != nil {
// Don't wrap the error, since it's informative enough as is.
return body, false, err
} else if current == target {
return body, false, nil
}
if err = m.upgradeConfigSchema(current, target, diskConf); err != nil {
// Don't wrap the error, since it's informative enough as is.
return body, false, err
}
buf := bytes.NewBuffer(newBody)
enc := yaml.NewEncoder(buf)
enc.SetIndent(2)
if err = enc.Encode(diskConf); err != nil {
return body, false, fmt.Errorf("generating new config: %w", err)
}
return buf.Bytes(), true, nil
}
// validateVersion validates the current and desired schema versions.
func validateVersion(current, target uint) (err error) {
switch {
case current > target:
return fmt.Errorf("unknown current schema version %d", current)
case target > LastSchemaVersion:
return fmt.Errorf("unknown target schema version %d", target)
case target < current:
return fmt.Errorf("target schema version %d lower than current %d", target, current)
default:
return nil
}
}
// migrateFunc is a function that upgrades a config and returns an error.
type migrateFunc = func(diskConf yobj) (err error)
// upgradeConfigSchema upgrades the configuration schema in diskConf from
// current to target version. current must be less than target, and both must
// be non-negative and less or equal to [LastSchemaVersion].
func (m *Migrator) upgradeConfigSchema(current, target uint, diskConf yobj) (err error) {
upgrades := [LastSchemaVersion]migrateFunc{
0: m.migrateTo1,
1: m.migrateTo2,
2: migrateTo3,
3: migrateTo4,
4: migrateTo5,
5: migrateTo6,
6: migrateTo7,
7: migrateTo8,
8: migrateTo9,
9: migrateTo10,
10: migrateTo11,
11: migrateTo12,
12: migrateTo13,
13: migrateTo14,
14: migrateTo15,
15: migrateTo16,
16: migrateTo17,
17: migrateTo18,
18: migrateTo19,
19: migrateTo20,
20: migrateTo21,
21: migrateTo22,
22: migrateTo23,
23: migrateTo24,
24: migrateTo25,
25: migrateTo26,
26: migrateTo27,
}
for i, migrate := range upgrades[current:target] {
cur := current + uint(i)
next := current + uint(i) + 1
log.Printf("Upgrade yaml: %d to %d", cur, next)
if err = migrate(diskConf); err != nil {
return fmt.Errorf("migrating schema %d to %d: %w", cur, next, err)
}
}
return nil
}

View File

@@ -0,0 +1,208 @@
package confmigrate_test
import (
"io/fs"
"os"
"path/filepath"
"testing"
"github.com/AdguardTeam/AdGuardHome/internal/confmigrate"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/bcrypt"
yaml "gopkg.in/yaml.v3"
)
// getField returns the value located at the given indexes in the given object.
// It fails the test if the value is not found or of the expected type. The
// indexes can be either strings or integers, and are interpreted as map keys or
// array indexes, respectively.
func getField[T any](t require.TestingT, obj any, indexes ...any) (val T) {
for _, index := range indexes {
switch index := index.(type) {
case string:
require.IsType(t, map[string]any(nil), obj)
typedObj := obj.(map[string]any)
require.Contains(t, typedObj, index)
obj = typedObj[index]
case int:
require.IsType(t, []any(nil), obj)
typedObj := obj.([]any)
require.Less(t, index, len(typedObj))
obj = typedObj[index]
default:
t.Errorf("unexpected index type: %T", index)
t.FailNow()
}
}
require.IsType(t, val, obj)
return obj.(T)
}
// testdata is a virtual filesystem containing test data.
var testdata = os.DirFS("testdata")
func TestMigrateConfig_Migrate(t *testing.T) {
const (
inputFileName = "input.yml"
outputFileName = "output.yml"
)
testCases := []struct {
yamlEqFunc func(t require.TestingT, expected, actual string, msgAndArgs ...any)
name string
targetVersion uint
}{{
yamlEqFunc: require.YAMLEq,
name: "v1",
targetVersion: 1,
}, {
yamlEqFunc: require.YAMLEq,
name: "v2",
targetVersion: 2,
}, {
yamlEqFunc: require.YAMLEq,
name: "v3",
targetVersion: 3,
}, {
yamlEqFunc: require.YAMLEq,
name: "v4",
targetVersion: 4,
}, {
// Compare passwords separately because bcrypt hashes those with a
// different salt every time.
yamlEqFunc: func(t require.TestingT, expected, actual string, msgAndArgs ...any) {
if h, ok := t.(interface{ Helper() }); ok {
h.Helper()
}
var want, got map[string]any
err := yaml.Unmarshal([]byte(expected), &want)
require.NoError(t, err)
err = yaml.Unmarshal([]byte(actual), &got)
require.NoError(t, err)
gotPass := getField[string](t, got, "users", 0, "password")
wantPass := getField[string](t, want, "users", 0, "password")
require.NoError(t, bcrypt.CompareHashAndPassword([]byte(gotPass), []byte(wantPass)))
delete(getField[map[string]any](t, got, "users", 0), "password")
delete(getField[map[string]any](t, want, "users", 0), "password")
require.Equal(t, want, got, msgAndArgs...)
},
name: "v5",
targetVersion: 5,
}, {
yamlEqFunc: require.YAMLEq,
name: "v6",
targetVersion: 6,
}, {
yamlEqFunc: require.YAMLEq,
name: "v7",
targetVersion: 7,
}, {
yamlEqFunc: require.YAMLEq,
name: "v8",
targetVersion: 8,
}, {
yamlEqFunc: require.YAMLEq,
name: "v9",
targetVersion: 9,
}, {
yamlEqFunc: require.YAMLEq,
name: "v10",
targetVersion: 10,
}, {
yamlEqFunc: require.YAMLEq,
name: "v11",
targetVersion: 11,
}, {
yamlEqFunc: require.YAMLEq,
name: "v12",
targetVersion: 12,
}, {
yamlEqFunc: require.YAMLEq,
name: "v13",
targetVersion: 13,
}, {
yamlEqFunc: require.YAMLEq,
name: "v14",
targetVersion: 14,
}, {
yamlEqFunc: require.YAMLEq,
name: "v15",
targetVersion: 15,
}, {
yamlEqFunc: require.YAMLEq,
name: "v16",
targetVersion: 16,
}, {
yamlEqFunc: require.YAMLEq,
name: "v17",
targetVersion: 17,
}, {
yamlEqFunc: require.YAMLEq,
name: "v18",
targetVersion: 18,
}, {
yamlEqFunc: require.YAMLEq,
name: "v19",
targetVersion: 19,
}, {
yamlEqFunc: require.YAMLEq,
name: "v20",
targetVersion: 20,
}, {
yamlEqFunc: require.YAMLEq,
name: "v21",
targetVersion: 21,
}, {
yamlEqFunc: require.YAMLEq,
name: "v22",
targetVersion: 22,
}, {
yamlEqFunc: require.YAMLEq,
name: "v23",
targetVersion: 23,
}, {
yamlEqFunc: require.YAMLEq,
name: "v24",
targetVersion: 24,
}, {
yamlEqFunc: require.YAMLEq,
name: "v25",
targetVersion: 25,
}, {
yamlEqFunc: require.YAMLEq,
name: "v26",
targetVersion: 26,
}, {
yamlEqFunc: require.YAMLEq,
name: "v27",
targetVersion: 27,
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
body, err := fs.ReadFile(testdata, filepath.Join(t.Name(), inputFileName))
require.NoError(t, err)
wantBody, err := fs.ReadFile(testdata, filepath.Join(t.Name(), outputFileName))
require.NoError(t, err)
migrator := confmigrate.New(&confmigrate.Config{
WorkingDir: t.Name(),
})
newBody, upgraded, err := migrator.Migrate(body, tc.targetVersion)
require.NoError(t, err)
require.True(t, upgraded)
tc.yamlEqFunc(t, string(wantBody), string(newBody))
})
}
}

View File

@@ -0,0 +1,31 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
coredns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
user_rules: []

View File

@@ -0,0 +1,32 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
coredns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
schema_version: 1
user_rules: []

View File

@@ -0,0 +1,60 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 9
user_rules: []

View File

@@ -0,0 +1,60 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 10
user_rules: []

View File

@@ -0,0 +1,61 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 10
user_rules: []
rlimit_nofile: 123

View File

@@ -0,0 +1,64 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 11
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,65 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 30
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 11
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,65 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 720h
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 12
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,65 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 720h
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 12
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,65 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 720h
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 13
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,66 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 720h
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
resolve_clients: true
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 13
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,72 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_interval: 720h
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 14
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,74 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
querylog_file_enabled: true
querylog_interval: 720h
querylog_size_memory: 1000
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 14
user_rules: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,76 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 15
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,77 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
statistics_interval: 10
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 15
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,80 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 16
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,81 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet: true
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 16
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,84 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 17
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,84 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 17
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,91 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 18
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,91 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 18
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,98 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 19
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,34 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
coredns:
bind_host: 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns: 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
schema_version: 1
user_rules: []

View File

@@ -0,0 +1,34 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
bind_host: 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns: 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
schema_version: 2
user_rules: []

View File

@@ -0,0 +1,98 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 19
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 10
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,98 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 20
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,100 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 20
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,103 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 21
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,105 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 21
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,108 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 22
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,109 @@
bind_host: 127.0.0.1
bind_port: 3000
web_session_ttl: 3
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 22
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,109 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 23
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''

View File

@@ -0,0 +1,116 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 23
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ""
rlimit_nofile: 123
user: ""
log_file: ""
log_max_backups: 0
log_max_size: 100
log_max_age: 3
log_compress: true
log_localtime: false
verbose: true

View File

@@ -0,0 +1,117 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 24
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,118 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
debug_pprof: true
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 24
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,120 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
pprof:
enabled: true
port: 6060
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 25
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,120 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
pprof:
enabled: true
port: 6060
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 25
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,121 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
pprof:
enabled: true
port: 6060
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
parental_sensitivity: 0
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filtering:
filtering_enabled: true
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
protection_enabled: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
blocked_response_ttl: 10
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 26
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored: []
statistics:
enabled: true
interval: 240h
ignored: []
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,123 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
pprof:
enabled: true
port: 6060
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
parental_sensitivity: 0
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filtering:
filtering_enabled: true
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
protection_enabled: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
blocked_response_ttl: 10
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 26
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored:
- '.'
statistics:
enabled: true
interval: 240h
ignored:
- '.'
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,123 @@
http:
address: 127.0.0.1:3000
session_ttl: 3h
pprof:
enabled: true
port: 6060
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
parental_sensitivity: 0
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
- quic://8.8.8.8:784
bootstrap_dns:
- 8.8.8.8:53
edns_client_subnet:
enabled: true
use_custom: false
custom_ip: ""
filtering:
filtering_enabled: true
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: false
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
protection_enabled: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
blocked_response_ttl: 10
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
persistent:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safe_search:
enabled: true
bing: true
duckduckgo: true
google: true
pixabay: true
yandex: true
youtube: true
blocked_services:
schedule:
time_zone: Local
ids:
- 500px
runtime_sources:
whois: true
arp: true
rdns: true
dhcp: true
hosts: true
dhcp:
enabled: false
interface_name: vboxnet0
local_domain_name: local
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 27
user_rules: []
querylog:
enabled: true
file_enabled: true
interval: 720h
size_memory: 1000
ignored:
- '|.^'
statistics:
enabled: true
interval: 240h
ignored:
- '|.^'
os:
group: ''
rlimit_nofile: 123
user: ''
log:
file: ""
max_backups: 0
max_size: 100
max_age: 3
compress: true
local_time: false
verbose: true

View File

@@ -0,0 +1,33 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns: 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
schema_version: 2
user_rules: []

View File

@@ -0,0 +1,34 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
schema_version: 3
user_rules: []

View File

@@ -0,0 +1,43 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ip: 127.0.0.1
mac: ""
use_global_settings: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 3
user_rules: []

View File

@@ -0,0 +1,44 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ip: 127.0.0.1
mac: ""
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 4
user_rules: []

View File

@@ -0,0 +1,44 @@
bind_host: 127.0.0.1
bind_port: 3000
auth_name: testuser
auth_pass: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ip: 127.0.0.1
mac: ""
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 4
user_rules: []

View File

@@ -0,0 +1,45 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ip: 127.0.0.1
mac: ""
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 5
user_rules: []

View File

@@ -0,0 +1,45 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ip: 127.0.0.1
mac: aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 5
user_rules: []

View File

@@ -0,0 +1,48 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
ip: 127.0.0.1
mac: aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
schema_version: 6
user_rules: []

View File

@@ -0,0 +1,53 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 6
user_rules: []

View File

@@ -0,0 +1,54 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 7
user_rules: []

View File

@@ -0,0 +1,57 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_host: 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 7
user_rules: []

View File

@@ -0,0 +1,58 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 8
user_rules: []

View File

@@ -0,0 +1,59 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
autohost_tld: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 8
user_rules: []

View File

@@ -0,0 +1,59 @@
bind_host: 127.0.0.1
bind_port: 3000
users:
- name: testuser
password: testpassword
dns:
bind_hosts:
- 127.0.0.1
port: 53
local_domain_name: local
protection_enabled: true
filtering_enabled: true
safebrowsing_enabled: false
safesearch_enabled: false
parental_enabled: false
parental_sensitivity: 0
blocked_response_ttl: 10
querylog_enabled: true
upstream_dns:
- tls://1.1.1.1
- tls://1.0.0.1
bootstrap_dns:
- 8.8.8.8:53
filters:
- url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: ""
enabled: true
- url: https://adaway.org/hosts.txt
name: AdAway
enabled: false
- url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
enabled: false
- url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
enabled: false
clients:
- name: localhost
ids:
- 127.0.0.1
- aa:aa:aa:aa:aa:aa
use_global_settings: true
use_global_blocked_services: true
filtering_enabled: false
parental_enabled: false
safebrowsing_enabled: false
safesearch_enabled: false
dhcp:
enabled: false
interface_name: vboxnet0
dhcpv4:
gateway_ip: 192.168.0.1
subnet_mask: 255.255.255.0
range_start: 192.168.0.10
range_end: 192.168.0.250
lease_duration: 1234
icmp_timeout_msec: 10
schema_version: 9
user_rules: []

View File

@@ -0,0 +1,35 @@
package confmigrate
import (
"os"
"path/filepath"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/log"
)
// migrateTo1 performs the following changes:
//
// # BEFORE:
// # …
//
// # AFTER:
// 'schema_version': 1
// # …
//
// It also deletes the unused dnsfilter.txt file, since the following versions
// store filters in data/filters/.
func (m *Migrator) migrateTo1(diskConf yobj) (err error) {
diskConf["schema_version"] = 1
dnsFilterPath := filepath.Join(m.workingDir, "dnsfilter.txt")
log.Printf("deleting %s as we don't need it anymore", dnsFilterPath)
err = os.Remove(dnsFilterPath)
if err != nil && !errors.Is(err, os.ErrNotExist) {
log.Info("warning: %s", err)
// Go on.
}
return nil
}

118
internal/confmigrate/v10.go Normal file
View File

@@ -0,0 +1,118 @@
package confmigrate
import (
"fmt"
"net/url"
"strconv"
"strings"
"github.com/AdguardTeam/golibs/netutil"
)
// migrateTo10 performs the following changes:
//
// # BEFORE:
// 'schema_version': 9
// 'dns':
// 'upstream_dns':
// - 'quic://some-upstream.com'
// 'local_ptr_upstreams':
// - 'quic://some-upstream.com'
// # …
// # …
//
// # AFTER:
// 'schema_version': 10
// 'dns':
// 'upstream_dns':
// - 'quic://some-upstream.com:784'
// 'local_ptr_upstreams':
// - 'quic://some-upstream.com:784'
// # …
// # …
func migrateTo10(diskConf yobj) (err error) {
diskConf["schema_version"] = 10
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
const quicPort = 784
ups, ok, err := fieldVal[yarr](dns, "upstream_dns")
if err != nil {
return err
} else if ok {
if err = addQUICPorts(ups, quicPort); err != nil {
return err
}
dns["upstream_dns"] = ups
}
ups, ok, err = fieldVal[yarr](dns, "local_ptr_upstreams")
if err != nil {
return err
} else if ok {
if err = addQUICPorts(ups, quicPort); err != nil {
return err
}
dns["local_ptr_upstreams"] = ups
}
return nil
}
// addQUICPorts inserts a port into each QUIC upstream's hostname in ups if
// those are missing.
func addQUICPorts(ups yarr, port int) (err error) {
for i, uVal := range ups {
u, ok := uVal.(string)
if !ok {
return fmt.Errorf("unexpected type of upstream field: %T", uVal)
}
ups[i] = addQUICPort(u, port)
}
return nil
}
// addQUICPort inserts a port into QUIC upstream's hostname if it is missing.
func addQUICPort(ups string, port int) (withPort string) {
if ups == "" || ups[0] == '#' {
return ups
}
var doms string
withPort = ups
if strings.HasPrefix(ups, "[/") {
domsAndUps := strings.Split(strings.TrimPrefix(ups, "[/"), "/]")
if len(domsAndUps) != 2 {
return ups
}
doms, withPort = "[/"+domsAndUps[0]+"/]", domsAndUps[1]
}
if !strings.Contains(withPort, "://") {
return ups
}
upsURL, err := url.Parse(withPort)
if err != nil || upsURL.Scheme != "quic" {
return ups
}
var host string
host, err = netutil.SplitHost(upsURL.Host)
if err != nil || host != upsURL.Host {
return ups
}
upsURL.Host = strings.Join([]string{host, strconv.Itoa(port)}, ":")
return doms + upsURL.String()
}

View File

@@ -0,0 +1,33 @@
package confmigrate
// migrateTo11 performs the following changes:
//
// # BEFORE:
// 'schema_version': 10
// 'rlimit_nofile': 42
// # …
//
// # AFTER:
// 'schema_version': 11
// 'os':
// 'group': ''
// 'rlimit_nofile': 42
// 'user': ''
// # …
func migrateTo11(diskConf yobj) (err error) {
diskConf["schema_version"] = 11
rlimit, _, err := fieldVal[int](diskConf, "rlimit_nofile")
if err != nil {
return err
}
delete(diskConf, "rlimit_nofile")
diskConf["os"] = yobj{
"group": "",
"rlimit_nofile": rlimit,
"user": "",
}
return nil
}

View File

@@ -0,0 +1,43 @@
package confmigrate
import (
"time"
"github.com/AdguardTeam/golibs/timeutil"
)
// migrateTo12 performs the following changes:
//
// # BEFORE:
// 'schema_version': 11
// 'querylog_interval': 90
// # …
//
// # AFTER:
// 'schema_version': 12
// 'querylog_interval': '2160h'
// # …
func migrateTo12(diskConf yobj) (err error) {
diskConf["schema_version"] = 12
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
const field = "querylog_interval"
qlogIvl, ok, err := fieldVal[int](dns, field)
if !ok {
if err != nil {
return err
}
// Set the initial value from home.initConfig function.
qlogIvl = 90
}
dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day}
return nil
}

View File

@@ -0,0 +1,32 @@
package confmigrate
// migrateTo13 performs the following changes:
//
// # BEFORE:
// 'schema_version': 12
// 'dns':
// 'local_domain_name': 'lan'
// # …
// # …
//
// # AFTER:
// 'schema_version': 13
// 'dhcp':
// 'local_domain_name': 'lan'
// # …
// # …
func migrateTo13(diskConf yobj) (err error) {
diskConf["schema_version"] = 13
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
dhcp, ok, err := fieldVal[yobj](diskConf, "dhcp")
if !ok {
return err
}
return moveSameVal[string](dns, dhcp, "local_domain_name")
}

View File

@@ -0,0 +1,62 @@
package confmigrate
// migrateTo14 performs the following changes:
//
// # BEFORE:
// 'schema_version': 13
// 'dns':
// 'resolve_clients': true
// # …
// 'clients':
// - 'name': 'client-name'
// # …
// # …
//
// # AFTER:
// 'schema_version': 14
// 'dns':
// # …
// 'clients':
// 'persistent':
// - 'name': 'client-name'
// # …
// 'runtime_sources':
// 'whois': true
// 'arp': true
// 'rdns': true
// 'dhcp': true
// 'hosts': true
// # …
func migrateTo14(diskConf yobj) (err error) {
diskConf["schema_version"] = 14
persistent, ok, err := fieldVal[yarr](diskConf, "clients")
if !ok {
if err != nil {
return err
}
persistent = yarr{}
}
runtimeClients := yobj{
"whois": true,
"arp": true,
"rdns": false,
"dhcp": true,
"hosts": true,
}
diskConf["clients"] = yobj{
"persistent": persistent,
"runtime_sources": runtimeClients,
}
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if err != nil {
return err
} else if !ok {
return nil
}
return moveVal[bool](dns, runtimeClients, "resolve_clients", "rdns")
}

View File

@@ -0,0 +1,52 @@
package confmigrate
// migrateTo15 performs the following changes:
//
// # BEFORE:
// 'schema_version': 14
// 'dns':
// # …
// 'querylog_enabled': true
// 'querylog_file_enabled': true
// 'querylog_interval': '2160h'
// 'querylog_size_memory': 1000
// 'querylog':
// # …
// # …
//
// # AFTER:
// 'schema_version': 15
// 'dns':
// # …
// 'querylog':
// 'enabled': true
// 'file_enabled': true
// 'interval': '2160h'
// 'size_memory': 1000
// 'ignored': []
// # …
// # …
func migrateTo15(diskConf yobj) (err error) {
diskConf["schema_version"] = 15
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
qlog := map[string]any{
"ignored": yarr{},
"enabled": true,
"file_enabled": true,
"interval": "2160h",
"size_memory": 1000,
}
diskConf["querylog"] = qlog
return coalesceError(
moveVal[bool](dns, qlog, "querylog_enabled", "enabled"),
moveVal[bool](dns, qlog, "querylog_file_enabled", "file_enabled"),
moveVal[any](dns, qlog, "querylog_interval", "interval"),
moveVal[int](dns, qlog, "querylog_size_memory", "size_memory"),
)
}

View File

@@ -0,0 +1,78 @@
package confmigrate
// migrateTo16 performs the following changes:
//
// # BEFORE:
// 'schema_version': 15
// 'dns':
// # …
// 'statistics_interval': 1
// 'statistics':
// # …
// # …
//
// # AFTER:
// 'schema_version': 16
// 'dns':
// # …
// 'statistics':
// 'enabled': true
// 'interval': 1
// 'ignored': []
// # …
// # …
//
// If statistics were disabled:
//
// # BEFORE:
// 'schema_version': 15
// 'dns':
// # …
// 'statistics_interval': 0
// 'statistics':
// # …
// # …
//
// # AFTER:
// 'schema_version': 16
// 'dns':
// # …
// 'statistics':
// 'enabled': false
// 'interval': 1
// 'ignored': []
// # …
// # …
func migrateTo16(diskConf yobj) (err error) {
diskConf["schema_version"] = 16
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
stats := yobj{
"enabled": true,
"interval": 1,
"ignored": yarr{},
}
diskConf["statistics"] = stats
const field = "statistics_interval"
statsIvl, ok, err := fieldVal[int](dns, field)
if !ok {
return err
}
if statsIvl == 0 {
// Set the interval to the default value of one day to make sure
// that it passes the validations.
stats["enabled"] = false
} else {
stats["interval"] = statsIvl
}
delete(dns, field)
return nil
}

View File

@@ -0,0 +1,39 @@
package confmigrate
// migrateTo17 performs the following changes:
//
// # BEFORE:
// 'schema_version': 16
// 'dns':
// 'edns_client_subnet': false
// # …
// # …
//
// # AFTER:
// 'schema_version': 17
// 'dns':
// 'edns_client_subnet':
// 'enabled': false
// 'use_custom': false
// 'custom_ip': ""
// # …
// # …
func migrateTo17(diskConf yobj) (err error) {
diskConf["schema_version"] = 17
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
const field = "edns_client_subnet"
enabled, _, _ := fieldVal[bool](dns, field)
dns[field] = yobj{
"enabled": enabled,
"use_custom": false,
"custom_ip": "",
}
return nil
}

View File

@@ -0,0 +1,45 @@
package confmigrate
// migrateTo18 performs the following changes:
//
// # BEFORE:
// 'schema_version': 17
// 'dns':
// 'safesearch_enabled': true
// # …
// # …
//
// # AFTER:
// 'schema_version': 18
// 'dns':
// 'safe_search':
// 'enabled': true
// 'bing': true
// 'duckduckgo': true
// 'google': true
// 'pixabay': true
// 'yandex': true
// 'youtube': true
// # …
// # …
func migrateTo18(diskConf yobj) (err error) {
diskConf["schema_version"] = 18
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
safeSearch := yobj{
"enabled": true,
"bing": true,
"duckduckgo": true,
"google": true,
"pixabay": true,
"yandex": true,
"youtube": true,
}
dns["safe_search"] = safeSearch
return moveVal[bool](dns, safeSearch, "safesearch_enabled", "enabled")
}

View File

@@ -0,0 +1,72 @@
package confmigrate
import "github.com/AdguardTeam/golibs/log"
// migrateTo19 performs the following changes:
//
// # BEFORE:
// 'schema_version': 18
// 'clients':
// 'persistent':
// - 'name': 'client-name'
// 'safesearch_enabled': true
// # …
// # …
// # …
//
// # AFTER:
// 'schema_version': 19
// 'clients':
// 'persistent':
// - 'name': 'client-name'
// 'safe_search':
// 'enabled': true
// 'bing': true
// 'duckduckgo': true
// 'google': true
// 'pixabay': true
// 'yandex': true
// 'youtube': true
// # …
// # …
// # …
func migrateTo19(diskConf yobj) (err error) {
diskConf["schema_version"] = 19
clients, ok, err := fieldVal[yobj](diskConf, "clients")
if !ok {
return err
}
persistent, ok, _ := fieldVal[yarr](clients, "persistent")
if !ok {
return nil
}
for _, p := range persistent {
var c yobj
c, ok = p.(yobj)
if !ok {
continue
}
safeSearch := yobj{
"enabled": true,
"bing": true,
"duckduckgo": true,
"google": true,
"pixabay": true,
"yandex": true,
"youtube": true,
}
err = moveVal[bool](c, safeSearch, "safesearch_enabled", "enabled")
if err != nil {
log.Debug("migrating to version 19: %s", err)
}
c["safe_search"] = safeSearch
}
return nil
}

View File

@@ -0,0 +1,37 @@
package confmigrate
import (
"os"
"path/filepath"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/log"
)
// migrateTo2 performs the following changes:
//
// # BEFORE:
// 'schema_version': 1
// 'coredns':
// # …
//
// # AFTER:
// 'schema_version': 2
// 'dns':
// # …
//
// It also deletes the Corefile file, since it isn't used anymore.
func (m *Migrator) migrateTo2(diskConf yobj) (err error) {
diskConf["schema_version"] = 2
coreFilePath := filepath.Join(m.workingDir, "Corefile")
log.Printf("deleting %s as we don't need it anymore", coreFilePath)
err = os.Remove(coreFilePath)
if err != nil && !errors.Is(err, os.ErrNotExist) {
log.Info("warning: %s", err)
// Go on.
}
return moveVal[any](diskConf, diskConf, "coredns", "dns")
}

View File

@@ -0,0 +1,44 @@
package confmigrate
import (
"time"
"github.com/AdguardTeam/golibs/timeutil"
)
// migrateTo20 performs the following changes:
//
// # BEFORE:
// 'schema_version': 19
// 'statistics':
// 'interval': 1
// # …
// # …
//
// # AFTER:
// 'schema_version': 20
// 'statistics':
// 'interval': 24h
// # …
// # …
func migrateTo20(diskConf yobj) (err error) {
diskConf["schema_version"] = 20
stats, ok, err := fieldVal[yobj](diskConf, "statistics")
if !ok {
return err
}
const field = "interval"
ivl, ok, err := fieldVal[int](stats, field)
if err != nil {
return err
} else if !ok || ivl == 0 {
ivl = 1
}
stats[field] = timeutil.Duration{Duration: time.Duration(ivl) * timeutil.Day}
return nil
}

View File

@@ -0,0 +1,49 @@
package confmigrate
// migrateTo21 performs the following changes:
//
// # BEFORE:
// 'schema_version': 20
// 'dns':
// 'blocked_services':
// - 'svc_name'
// - # …
// # …
// # …
//
// # AFTER:
// 'schema_version': 21
// 'dns':
// 'blocked_services':
// 'ids':
// - 'svc_name'
// - # …
// 'schedule':
// 'time_zone': 'Local'
// # …
// # …
func migrateTo21(diskConf yobj) (err error) {
diskConf["schema_version"] = 21
const field = "blocked_services"
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
svcs := yobj{
"schedule": yobj{
"time_zone": "Local",
},
}
err = moveVal[yarr](dns, svcs, field, "ids")
if err != nil {
return err
}
dns[field] = svcs
return nil
}

View File

@@ -0,0 +1,72 @@
package confmigrate
import (
"fmt"
)
// migrateTo22 performs the following changes:
//
// # BEFORE:
// 'schema_version': 21
// 'persistent':
// - 'name': 'client_name'
// 'blocked_services':
// - 'svc_name'
// - # …
// # …
// # …
// # …
//
// # AFTER:
// 'schema_version': 22
// 'persistent':
// - 'name': 'client_name'
// 'blocked_services':
// 'ids':
// - 'svc_name'
// - # …
// 'schedule':
// 'time_zone': 'Local'
// # …
// # …
// # …
func migrateTo22(diskConf yobj) (err error) {
diskConf["schema_version"] = 22
const field = "blocked_services"
clients, ok, err := fieldVal[yobj](diskConf, "clients")
if !ok {
return err
}
persistent, ok, err := fieldVal[yarr](clients, "persistent")
if !ok {
return err
}
for i, p := range persistent {
var c yobj
c, ok = p.(yobj)
if !ok {
return fmt.Errorf("persistent client at index %d: unexpected type %T", i, p)
}
var services yarr
services, ok, err = fieldVal[yarr](c, field)
if err != nil {
return fmt.Errorf("persistent client at index %d: %w", i, err)
} else if !ok {
continue
}
c[field] = yobj{
"ids": services,
"schedule": yobj{
"time_zone": "Local",
},
}
}
return nil
}

View File

@@ -0,0 +1,59 @@
package confmigrate
import (
"fmt"
"net/netip"
"time"
"github.com/AdguardTeam/golibs/timeutil"
)
// migrateTo23 performs the following changes:
//
// # BEFORE:
// 'schema_version': 22
// 'bind_host': '1.2.3.4'
// 'bind_port': 8080
// 'web_session_ttl': 720
// # …
//
// # AFTER:
// 'schema_version': 23
// 'http':
// 'address': '1.2.3.4:8080'
// 'session_ttl': '720h'
// # …
func migrateTo23(diskConf yobj) (err error) {
diskConf["schema_version"] = 23
bindHost, ok, err := fieldVal[string](diskConf, "bind_host")
if !ok {
return err
}
bindHostAddr, err := netip.ParseAddr(bindHost)
if err != nil {
return fmt.Errorf("invalid bind_host value: %s", bindHost)
}
bindPort, _, err := fieldVal[int](diskConf, "bind_port")
if err != nil {
return err
}
sessionTTL, _, err := fieldVal[int](diskConf, "web_session_ttl")
if err != nil {
return err
}
diskConf["http"] = yobj{
"address": netip.AddrPortFrom(bindHostAddr, uint16(bindPort)).String(),
"session_ttl": timeutil.Duration{Duration: time.Duration(sessionTTL) * time.Hour}.String(),
}
delete(diskConf, "bind_host")
delete(diskConf, "bind_port")
delete(diskConf, "web_session_ttl")
return nil
}

View File

@@ -0,0 +1,50 @@
package confmigrate
// migrateTo24 performs the following changes:
//
// # BEFORE:
// 'schema_version': 23
// 'log_file': ""
// 'log_max_backups': 0
// 'log_max_size': 100
// 'log_max_age': 3
// 'log_compress': false
// 'log_localtime': false
// 'verbose': false
// # …
//
// # AFTER:
// 'schema_version': 24
// 'log':
// 'file': ""
// 'max_backups': 0
// 'max_size': 100
// 'max_age': 3
// 'compress': false
// 'local_time': false
// 'verbose': false
// # …
func migrateTo24(diskConf yobj) (err error) {
diskConf["schema_version"] = 24
logObj := yobj{}
err = coalesceError(
moveVal[string](diskConf, logObj, "log_file", "file"),
moveVal[int](diskConf, logObj, "log_max_backups", "max_backups"),
moveVal[int](diskConf, logObj, "log_max_size", "max_size"),
moveVal[int](diskConf, logObj, "log_max_age", "max_age"),
moveVal[bool](diskConf, logObj, "log_compress", "compress"),
moveVal[bool](diskConf, logObj, "log_localtime", "local_time"),
moveVal[bool](diskConf, logObj, "verbose", "verbose"),
)
if err != nil {
// Don't wrap the error, because it's informative enough as is.
return err
}
if len(logObj) != 0 {
diskConf["log"] = logObj
}
return nil
}

View File

@@ -0,0 +1,38 @@
package confmigrate
// migrateTo25 performs the following changes:
//
// # BEFORE:
// 'schema_version': 24
// 'debug_pprof': true
// # …
//
// # AFTER:
// 'schema_version': 25
// 'http':
// 'pprof':
// 'enabled': true
// 'port': 6060
// # …
func migrateTo25(diskConf yobj) (err error) {
diskConf["schema_version"] = 25
httpObj, ok, err := fieldVal[yobj](diskConf, "http")
if !ok {
return err
}
pprofObj := yobj{
"enabled": false,
"port": 6060,
}
err = moveVal[bool](diskConf, pprofObj, "debug_pprof", "enabled")
if err != nil {
return err
}
httpObj["pprof"] = pprofObj
return nil
}

111
internal/confmigrate/v26.go Normal file
View File

@@ -0,0 +1,111 @@
package confmigrate
// migrateTo26 performs the following changes:
//
// # BEFORE:
// 'schema_version': 25
// 'dns':
// 'filtering_enabled': true
// 'filters_update_interval': 24
// 'parental_enabled': false
// 'safebrowsing_enabled': false
// 'safebrowsing_cache_size': 1048576
// 'safesearch_cache_size': 1048576
// 'parental_cache_size': 1048576
// 'safe_search':
// 'enabled': false
// 'bing': true
// 'duckduckgo': true
// 'google': true
// 'pixabay': true
// 'yandex': true
// 'youtube': true
// 'rewrites': []
// 'blocked_services':
// 'schedule':
// 'time_zone': 'Local'
// 'ids': []
// 'protection_enabled': true,
// 'blocking_mode': 'custom_ip',
// 'blocking_ipv4': '1.2.3.4',
// 'blocking_ipv6': '1:2:3::4',
// 'blocked_response_ttl': 10,
// 'protection_disabled_until': 'null',
// 'parental_block_host': 'p.dns.adguard.com',
// 'safebrowsing_block_host': 's.dns.adguard.com',
// # …
//
// # AFTER:
// 'schema_version': 26
// 'filtering':
// 'filtering_enabled': true
// 'filters_update_interval': 24
// 'parental_enabled': false
// 'safebrowsing_enabled': false
// 'safebrowsing_cache_size': 1048576
// 'safesearch_cache_size': 1048576
// 'parental_cache_size': 1048576
// 'safe_search':
// 'enabled': false
// 'bing': true
// 'duckduckgo': true
// 'google': true
// 'pixabay': true
// 'yandex': true
// 'youtube': true
// 'rewrites': []
// 'blocked_services':
// 'schedule':
// 'time_zone': 'Local'
// 'ids': []
// 'protection_enabled': true,
// 'blocking_mode': 'custom_ip',
// 'blocking_ipv4': '1.2.3.4',
// 'blocking_ipv6': '1:2:3::4',
// 'blocked_response_ttl': 10,
// 'protection_disabled_until': 'null',
// 'parental_block_host': 'p.dns.adguard.com',
// 'safebrowsing_block_host': 's.dns.adguard.com',
// 'dns'
// # …
// # …
func migrateTo26(diskConf yobj) (err error) {
diskConf["schema_version"] = 26
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
filteringObj := yobj{}
err = coalesceError(
moveSameVal[bool](dns, filteringObj, "filtering_enabled"),
moveSameVal[int](dns, filteringObj, "filters_update_interval"),
moveSameVal[bool](dns, filteringObj, "parental_enabled"),
moveSameVal[bool](dns, filteringObj, "safebrowsing_enabled"),
moveSameVal[int](dns, filteringObj, "safebrowsing_cache_size"),
moveSameVal[int](dns, filteringObj, "safesearch_cache_size"),
moveSameVal[int](dns, filteringObj, "parental_cache_size"),
moveSameVal[yobj](dns, filteringObj, "safe_search"),
moveSameVal[yarr](dns, filteringObj, "rewrites"),
moveSameVal[yobj](dns, filteringObj, "blocked_services"),
moveSameVal[bool](dns, filteringObj, "protection_enabled"),
moveSameVal[string](dns, filteringObj, "blocking_mode"),
moveSameVal[string](dns, filteringObj, "blocking_ipv4"),
moveSameVal[string](dns, filteringObj, "blocking_ipv6"),
moveSameVal[int](dns, filteringObj, "blocked_response_ttl"),
moveSameVal[any](dns, filteringObj, "protection_disabled_until"),
moveSameVal[string](dns, filteringObj, "parental_block_host"),
moveSameVal[string](dns, filteringObj, "safebrowsing_block_host"),
)
if err != nil {
// Don't wrap the error, because it's informative enough as is.
return err
}
if len(filteringObj) != 0 {
diskConf["filtering"] = filteringObj
}
return nil
}

View File

@@ -0,0 +1,77 @@
package confmigrate
// migrateTo27 performs the following changes:
//
// # BEFORE:
// 'querylog':
// 'ignored':
// - '.'
// - # …
// # …
// 'statistics':
// 'ignored':
// - '.'
// - # …
// # …
// # …
//
// # AFTER:
// 'querylog':
// 'ignored':
// - '|.^'
// - # …
// # …
// 'statistics':
// 'ignored':
// - '|.^'
// - # …
// # …
// # …
func migrateTo27(diskConf yobj) (err error) {
diskConf["schema_version"] = 27
keys := []string{"querylog", "statistics"}
for _, k := range keys {
err = replaceDot(diskConf, k)
if err != nil {
return err
}
}
return nil
}
// replaceDot replaces rules blocking root domain "." with AdBlock style syntax
// "|.^".
func replaceDot(diskConf yobj, key string) (err error) {
var obj yobj
var ok bool
obj, ok, err = fieldVal[yobj](diskConf, key)
if err != nil {
return err
} else if !ok {
return nil
}
var ignored yarr
ignored, ok, err = fieldVal[yarr](obj, "ignored")
if err != nil {
return err
} else if !ok {
return nil
}
for i, hostVal := range ignored {
var host string
host, ok = hostVal.(string)
if !ok {
continue
}
if host == "." {
ignored[i] = "|.^"
}
}
return nil
}

View File

@@ -0,0 +1,31 @@
package confmigrate
// migrateTo3 performs the following changes:
//
// # BEFORE:
// 'schema_version': 2
// 'dns':
// 'bootstrap_dns': '1.1.1.1'
// # …
//
// # AFTER:
// 'schema_version': 3
// 'dns':
// 'bootstrap_dns':
// - '1.1.1.1'
// # …
func migrateTo3(diskConf yobj) (err error) {
diskConf["schema_version"] = 3
dnsConfig, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
bootstrapDNS, ok, err := fieldVal[any](dnsConfig, "bootstrap_dns")
if ok {
dnsConfig["bootstrap_dns"] = yarr{bootstrapDNS}
}
return err
}

View File

@@ -0,0 +1,30 @@
package confmigrate
// migrateTo4 performs the following changes:
//
// # BEFORE:
// 'schema_version': 3
// 'clients':
// - # …
// # …
//
// # AFTER:
// 'schema_version': 4
// 'clients':
// - 'use_global_blocked_services': true
// # …
// # …
func migrateTo4(diskConf yobj) (err error) {
diskConf["schema_version"] = 4
clients, ok, _ := fieldVal[yarr](diskConf, "clients")
if ok {
for i := range clients {
if c, isYobj := clients[i].(yobj); isYobj {
c["use_global_blocked_services"] = true
}
}
}
return nil
}

View File

@@ -0,0 +1,47 @@
package confmigrate
import (
"fmt"
"golang.org/x/crypto/bcrypt"
)
// migrateTo5 performs the following changes:
//
// # BEFORE:
// 'schema_version': 4
// 'auth_name': …
// 'auth_pass': …
// # …
//
// # AFTER:
// 'schema_version': 5
// 'users':
// - 'name': …
// 'password': <hashed>
// # …
func migrateTo5(diskConf yobj) (err error) {
diskConf["schema_version"] = 5
user := yobj{}
if err = moveVal[string](diskConf, user, "auth_name", "name"); err != nil {
return err
}
pass, ok, err := fieldVal[string](diskConf, "auth_pass")
if !ok {
return err
}
delete(diskConf, "auth_pass")
hash, err := bcrypt.GenerateFromPassword([]byte(pass), bcrypt.DefaultCost)
if err != nil {
return fmt.Errorf("generating password hash: %w", err)
}
user["password"] = string(hash)
diskConf["users"] = yarr{user}
return nil
}

View File

@@ -0,0 +1,56 @@
package confmigrate
import "fmt"
// migrateTo6 performs the following changes:
//
// # BEFORE:
// 'schema_version': 5
// 'clients':
// - # …
// 'ip': '127.0.0.1'
// 'mac': 'AA:AA:AA:AA:AA:AA'
// # …
// # …
//
// # AFTER:
// 'schema_version': 6
// 'clients':
// - # …
// 'ip': '127.0.0.1'
// 'mac': 'AA:AA:AA:AA:AA:AA'
// 'ids':
// - '127.0.0.1'
// - 'AA:AA:AA:AA:AA:AA'
// # …
// # …
func migrateTo6(diskConf yobj) (err error) {
diskConf["schema_version"] = 6
clients, ok, err := fieldVal[yarr](diskConf, "clients")
if !ok {
return err
}
for i, client := range clients {
var c yobj
c, ok = client.(yobj)
if !ok {
return fmt.Errorf("unexpected type of client at index %d: %T", i, client)
}
ids := yarr{}
for _, id := range []string{"ip", "mac"} {
val, _, valErr := fieldVal[string](c, id)
if valErr != nil {
return fmt.Errorf("client at index %d: %w", i, valErr)
} else if val != "" {
ids = append(ids, val)
}
}
c["ids"] = ids
}
return nil
}

View File

@@ -0,0 +1,55 @@
package confmigrate
// migrateTo7 performs the following changes:
//
// # BEFORE:
// 'schema_version': 6
// 'dhcp':
// 'enabled': false
// 'interface_name': vboxnet0
// 'gateway_ip': '192.168.56.1'
// 'subnet_mask': '255.255.255.0'
// 'range_start': '192.168.56.10'
// 'range_end': '192.168.56.240'
// 'lease_duration': 86400
// 'icmp_timeout_msec': 1000
// # …
//
// # AFTER:
// 'schema_version': 7
// 'dhcp':
// 'enabled': false
// 'interface_name': vboxnet0
// 'dhcpv4':
// 'gateway_ip': '192.168.56.1'
// 'subnet_mask': '255.255.255.0'
// 'range_start': '192.168.56.10'
// 'range_end': '192.168.56.240'
// 'lease_duration': 86400
// 'icmp_timeout_msec': 1000
// # …
func migrateTo7(diskConf yobj) (err error) {
diskConf["schema_version"] = 7
dhcp, ok, _ := fieldVal[yobj](diskConf, "dhcp")
if !ok {
return nil
}
dhcpv4 := yobj{}
err = coalesceError(
moveSameVal[string](dhcp, dhcpv4, "gateway_ip"),
moveSameVal[string](dhcp, dhcpv4, "subnet_mask"),
moveSameVal[string](dhcp, dhcpv4, "range_start"),
moveSameVal[string](dhcp, dhcpv4, "range_end"),
moveSameVal[int](dhcp, dhcpv4, "lease_duration"),
moveSameVal[int](dhcp, dhcpv4, "icmp_timeout_msec"),
)
if err != nil {
return err
}
dhcp["dhcpv4"] = dhcpv4
return nil
}

View File

@@ -0,0 +1,36 @@
package confmigrate
// migrateTo8 performs the following changes:
//
// # BEFORE:
// 'schema_version': 7
// 'dns':
// 'bind_host': '127.0.0.1'
// # …
// # …
//
// # AFTER:
// 'schema_version': 8
// 'dns':
// 'bind_hosts':
// - '127.0.0.1'
// # …
// # …
func migrateTo8(diskConf yobj) (err error) {
diskConf["schema_version"] = 8
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
bindHost, ok, err := fieldVal[string](dns, "bind_host")
if !ok {
return err
}
delete(dns, "bind_host")
dns["bind_hosts"] = yarr{bindHost}
return nil
}

View File

@@ -0,0 +1,27 @@
package confmigrate
// migrateTo9 performs the following changes:
//
// # BEFORE:
// 'schema_version': 8
// 'dns':
// 'autohost_tld': 'lan'
// # …
// # …
//
// # AFTER:
// 'schema_version': 9
// 'dns':
// 'local_domain_name': 'lan'
// # …
// # …
func migrateTo9(diskConf yobj) (err error) {
diskConf["schema_version"] = 9
dns, ok, err := fieldVal[yobj](diskConf, "dns")
if !ok {
return err
}
return moveVal[string](dns, dns, "autohost_tld", "local_domain_name")
}

View File

@@ -0,0 +1,68 @@
package confmigrate
import (
"fmt"
)
type (
// yarr is the convenience alias for YAML array.
yarr = []any
// yobj is the convenience alias for YAML key-value object.
yobj = map[string]any
)
// fieldVal returns the value of type T for key from obj. Use [any] if the
// field's type doesn't matter.
func fieldVal[T any](obj yobj, key string) (v T, ok bool, err error) {
val, ok := obj[key]
if !ok {
return v, false, nil
}
if val == nil {
return v, true, nil
}
v, ok = val.(T)
if !ok {
return v, false, fmt.Errorf("unexpected type of %q: %T", key, val)
}
return v, true, nil
}
// moveVal copies the value for srcKey from src into dst for dstKey and deletes
// it from src.
func moveVal[T any](src, dst yobj, srcKey, dstKey string) (err error) {
newVal, ok, err := fieldVal[T](src, srcKey)
if !ok {
return err
}
dst[dstKey] = newVal
delete(src, srcKey)
return nil
}
// moveSameVal moves the value for key from src into dst.
func moveSameVal[T any](src, dst yobj, key string) (err error) {
return moveVal[T](src, dst, key, key)
}
// coalesceError returns the first non-nil error. It is named after function
// COALESCE in SQL. If all errors are nil, it returns nil.
//
// TODO(e.burkov): Replace with [errors.Join].
//
// TODO(a.garipov): Think of ways to merge with [aghalg.Coalesce].
func coalesceError(errors ...error) (res error) {
for _, err := range errors {
if err != nil {
return err
}
}
return nil
}