@@ -31,6 +31,26 @@ type path struct {
31
31
path string
32
32
}
33
33
34
+
35
+ var defaultServerFilters = []string {
36
+ "/ip4/10.0.0.0/ipcidr/8" ,
37
+ "/ip4/100.64.0.0/ipcidr/10" ,
38
+ "/ip4/169.254.0.0/ipcidr/16" ,
39
+ "/ip4/172.16.0.0/ipcidr/12" ,
40
+ "/ip4/192.0.0.0/ipcidr/24" ,
41
+ "/ip4/192.0.2.0/ipcidr/24" ,
42
+ "/ip4/192.168.0.0/ipcidr/16" ,
43
+ "/ip4/198.18.0.0/ipcidr/15" ,
44
+ "/ip4/198.51.100.0/ipcidr/24" ,
45
+ "/ip4/203.0.113.0/ipcidr/24" ,
46
+ "/ip4/240.0.0.0/ipcidr/4" ,
47
+ "/ip6/100::/ipcidr/64" ,
48
+ "/ip6/2001:2::/ipcidr/48" ,
49
+ "/ip6/2001:db8::/ipcidr/32" ,
50
+ "/ip6/fc00::/ipcidr/7" ,
51
+ "/ip6/fe80::/ipcidr/10" ,
52
+ }
53
+
34
54
func setupPlugins (externalPluginsPath string ) error {
35
55
// Load any external plugins if available on externalPluginsPath
36
56
plugins , err := loader .NewPluginLoader (filepath .Join (externalPluginsPath , "plugins" ))
@@ -63,6 +83,11 @@ func createTempRepo(ctx context.Context) (string, error) {
63
83
return "" , err
64
84
}
65
85
86
+ cfg .Addresses .NoAnnounce = defaultServerFilters
87
+ cfg .Swarm .AddrFilters = defaultServerFilters
88
+ cfg .Discovery .MDNS .Enabled = false
89
+ cfg .Swarm .DisableNatPortMap = true
90
+
66
91
// Create the repo with the config
67
92
err = fsrepo .Init (repoPath , cfg )
68
93
if err != nil {
0 commit comments