@cryptotaxi247 / kubo / commits / c475d31c6

go-ipfs-config: Disable MDNS in server profile, move it out from init.go

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>

Łukasz Magiera committed Jun 21, 2017 at 20:37 UTC c475d31c6163b21cbc9da4add93fe74f4a3b2406
1 file changed +31
config/profile.go new
+31
@@ -0,0 +1,31 @@
1 +package config
2 +
3 +// ConfigProfiles is a map holding configuration transformers
4 +var ConfigProfiles = map[string]func(*Config) error{
5 + "server": func(c *Config) error {
6 +
7 + // defaultServerFilters has a list of non-routable IPv4 prefixes
8 + // according to http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
9 + defaultServerFilters := []string{
10 + "/ip4/10.0.0.0/ipcidr/8",
11 + "/ip4/100.64.0.0/ipcidr/10",
12 + "/ip4/169.254.0.0/ipcidr/16",
13 + "/ip4/172.16.0.0/ipcidr/12",
14 + "/ip4/192.0.0.0/ipcidr/24",
15 + "/ip4/192.0.0.0/ipcidr/29",
16 + "/ip4/192.0.0.8/ipcidr/32",
17 + "/ip4/192.0.0.170/ipcidr/32",
18 + "/ip4/192.0.0.171/ipcidr/32",
19 + "/ip4/192.0.2.0/ipcidr/24",
20 + "/ip4/192.168.0.0/ipcidr/16",
21 + "/ip4/198.18.0.0/ipcidr/15",
22 + "/ip4/198.51.100.0/ipcidr/24",
23 + "/ip4/203.0.113.0/ipcidr/24",
24 + "/ip4/240.0.0.0/ipcidr/4",
25 + }
26 +
27 + c.Swarm.AddrFilters = append(c.Swarm.AddrFilters, defaultServerFilters...)
28 + c.Discovery.MDNS.Enabled = false
29 + return nil
30 + },
31 +}