-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable MDNS in server profile, move it out from init.go
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
- Loading branch information
Showing
2 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package config | ||
|
||
// ConfigProfiles is a map holding configuration transformers | ||
var ConfigProfiles = map[string]func(*Config) error{ | ||
"server": func(c *Config) error { | ||
|
||
// defaultServerFilters has a list of non-routable IPv4 prefixes | ||
// according to http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml | ||
defaultServerFilters := []string{ | ||
"/ip4/10.0.0.0/ipcidr/8", | ||
"/ip4/100.64.0.0/ipcidr/10", | ||
"/ip4/169.254.0.0/ipcidr/16", | ||
"/ip4/172.16.0.0/ipcidr/12", | ||
"/ip4/192.0.0.0/ipcidr/24", | ||
"/ip4/192.0.0.0/ipcidr/29", | ||
"/ip4/192.0.0.8/ipcidr/32", | ||
"/ip4/192.0.0.170/ipcidr/32", | ||
"/ip4/192.0.0.171/ipcidr/32", | ||
"/ip4/192.0.2.0/ipcidr/24", | ||
"/ip4/192.168.0.0/ipcidr/16", | ||
"/ip4/198.18.0.0/ipcidr/15", | ||
"/ip4/198.51.100.0/ipcidr/24", | ||
"/ip4/203.0.113.0/ipcidr/24", | ||
"/ip4/240.0.0.0/ipcidr/4", | ||
} | ||
|
||
c.Swarm.AddrFilters = append(c.Swarm.AddrFilters, defaultServerFilters...) | ||
c.Discovery.MDNS.Enabled = false | ||
return nil | ||
}, | ||
} | ||
|