mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-09-17 17:07:15 +08:00
防爆增加全局黑名单功能
增加防爆测试用例 优化防爆检查逻辑
This commit is contained in:
@@ -97,7 +97,8 @@ type ServerConfig struct {
|
||||
EncryptionPassword bool `json:"encryption_password"`
|
||||
|
||||
AntiBruteForce bool `json:"anti_brute_force"`
|
||||
IPWhitelist string `json:"ip_whitelist"`
|
||||
IPWhiteList string `json:"ip_whitelist"`
|
||||
IPBlackList string `json:"ip_blacklist"`
|
||||
|
||||
MaxBanCount int `json:"max_ban_score"`
|
||||
BanResetTime int `json:"ban_reset_time"`
|
||||
|
@@ -82,6 +82,7 @@ var configs = []config{
|
||||
|
||||
{Typ: cfgBool, Name: "anti_brute_force", Usage: "是否开启防爆功能", ValBool: true},
|
||||
{Typ: cfgStr, Name: "ip_whitelist", Usage: "全局IP白名单,多个用逗号分隔,支持单IP和CIDR范围", ValStr: "192.168.90.1,172.16.0.0/24"},
|
||||
{Typ: cfgStr, Name: "ip_blacklist", Usage: "全局IP黑名单,多个用逗号分隔,支持单IP和CIDR范围", ValStr: ""},
|
||||
|
||||
{Typ: cfgInt, Name: "max_ban_score", Usage: "单位时间内最大尝试次数,0为关闭该功能", ValInt: 5},
|
||||
{Typ: cfgInt, Name: "ban_reset_time", Usage: "设置单位时间(秒),超过则重置计数", ValInt: 10},
|
||||
|
Reference in New Issue
Block a user