+ disabled_server_names

Fixes #735
This commit is contained in:
Frank Denis 2019-02-23 14:54:22 +01:00
parent d0ca608cb7
commit c10fbb2aa7
2 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,7 @@ type Config struct {
LogFile *string `toml:"log_file"`
UseSyslog bool `toml:"use_syslog"`
ServerNames []string `toml:"server_names"`
DisabledServerNames []string `toml:"disabled_server_names"`
ListenAddresses []string `toml:"listen_addresses"`
Daemonize bool
UserName string `toml:"user_name"`
@ -399,6 +400,7 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
if *listAll {
config.ServerNames = nil
config.DisabledServerNames = nil
config.SourceRequireDNSSEC = false
config.SourceRequireNoFilter = false
config.SourceRequireNoLog = false
@ -552,6 +554,9 @@ func (config *Config) loadSource(proxy *Proxy, requiredProps stamps.ServerInform
} else if registeredServer.stamp.Props&requiredProps != requiredProps {
continue
}
if includesName(config.DisabledServerNames, registeredServer.name) {
continue
}
if config.SourceIPv4 || config.SourceIPv6 {
isIPv4, isIPv6 := true, false
if registeredServer.stamp.Proto == stamps.StampProtoTypeDoH {

View File

@ -30,6 +30,11 @@
# server_names = ['scaleway-fr', 'google', 'yandex', 'cloudflare']
## Server names to avoid even if they match all criteria.
# disabled_server_names = []
## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6.
## Note: When using systemd socket activation, choose an empty set (i.e. [] ).