提交 c595cf8a 作者: Juan Batiz-Benet

config: DialBlocklist -> Swarm.AddrFilters

This commit changes the DialBlocklist key to be under the key
Swarm.AddrFilters instead.

License: MIT
Signed-off-by: 's avatarJuan Batiz-Benet <juan@benet.ai>
上级 a119b722
......@@ -378,7 +378,7 @@ Where the above is equivalent to the standard CIDR:
192.168.0.0/16
Filters default to those specified under the "DialBlocklist" config key.
Filters default to those specified under the "Swarm.AddrFilters" config key.
`,
},
Subcommands: map[string]*cmds.Command{
......
......@@ -258,7 +258,7 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
// get undialable addrs from config
cfg := n.Repo.Config()
var addrfilter []*net.IPNet
for _, s := range cfg.DialBlocklist {
for _, s := range cfg.Swarm.AddrFilters {
f, err := mamask.NewMask(s)
if err != nil {
return fmt.Errorf("incorrectly formatter address filter in config: %s", s)
......
......@@ -26,7 +26,7 @@ type Config struct {
Tour Tour // local node's tour position
Gateway Gateway // local node's gateway server options
SupernodeRouting SupernodeClientConfig // local node's routing servers (if SupernodeRouting enabled)
DialBlocklist []string
Swarm SwarmConfig
Log Log
}
......
package config
type SwarmConfig struct {
AddrFilters []string
}
......@@ -72,7 +72,7 @@ test_expect_success "init without any filters" '
'
test_expect_success "adding addresses to the config to filter succeeds" '
ipfs config --json DialBlocklist "[\"$AF1\", \"$AF4\"]"
ipfs config --json Swarm.AddrFilters "[\"$AF1\", \"$AF4\"]"
'
test_launch_ipfs_daemon
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论