From 87a3df3645896b20760c898ce7c58b0c703c88a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 16 Mar 2022 20:48:00 +0800 Subject: [PATCH] =?UTF-8?q?IPSet=E6=94=AF=E6=8C=81IPv6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../firewallconfigs/firewall_actions.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkg/serverconfigs/firewallconfigs/firewall_actions.go b/pkg/serverconfigs/firewallconfigs/firewall_actions.go index dbae0e1..0c3617b 100644 --- a/pkg/serverconfigs/firewallconfigs/firewall_actions.go +++ b/pkg/serverconfigs/firewallconfigs/firewall_actions.go @@ -62,12 +62,17 @@ func FindFirewallActionTypeName(actionType FirewallActionType) string { } type FirewallActionIPSetConfig struct { - Path string `json:"path"` // 命令路径 TODO 暂时不实现 - WhiteName string `json:"whiteName"` // IPSet白名单名称 - BlackName string `json:"blackName"` // IPSet黑名单名称 - MaxElements int `json:"maxElements"` // 最多IP数量 TODO 暂时不实现 - AutoAddToIPTables bool `json:"autoAddToIPTables"` // 是否自动创建IPTables规则 - AutoAddToFirewalld bool `json:"autoAddToFirewalld"` // 是否自动加入到Firewalld + Path string `json:"path"` // 命令路径 TODO 暂时不实现 + + WhiteName string `json:"whiteName"` // IPSet白名单名称 + BlackName string `json:"blackName"` // IPSet黑名单名称 + + WhiteNameIPv6 string `json:"whiteNameIPv6"` // IPv6白名单名称 + BlackNameIPv6 string `json:"blackNameIPv6"` // IPv6黑名单名称 + + MaxElements int `json:"maxElements"` // 最多IP数量 TODO 暂时不实现 + AutoAddToIPTables bool `json:"autoAddToIPTables"` // 是否自动创建IPTables规则 + AutoAddToFirewalld bool `json:"autoAddToFirewalld"` // 是否自动加入到Firewalld // TODO 添加需要阻止的端口列表 } @@ -92,7 +97,7 @@ type FirewallActionScriptConfig struct { // TODO 添加需要阻止的端口列表 } -// HTTP API配置 +// FirewallActionHTTPAPIConfig HTTP API配置 type FirewallActionHTTPAPIConfig struct { URL string `json:"url"` // URL路径 TimeoutSeconds int `json:"timeoutSeconds"` // 超时时间 TODO 暂时不实现 @@ -101,7 +106,7 @@ type FirewallActionHTTPAPIConfig struct { // TODO 添加需要阻止的端口列表 } -// HTML配置 +// FirewallActionHTMLConfig HTML配置 type FirewallActionHTMLConfig struct { Content string `json:"content"` // 完整的HTML内容 }