mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
IP Limit Tweaks to reduce false bans (#850)
* IP Limit Tweaks to reduce false bans 1) Check IPs every 10s instead of 20s 2) F2B jail: maxretry 3 -> 4, findtime 100 -> 60 * USERS SHOULD UPDATE BANTIME ONCE AFTER UPDATE to recreate jail for Ip Limit
This commit is contained in:
parent
b805bf6222
commit
dd0217b46b
3 changed files with 6 additions and 6 deletions
|
@ -130,8 +130,8 @@ func (j *CheckClientIpJob) processLogFile() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// added 3 seconds delay before cleaning logs to reduce chance of logging IP that already has been banned
|
// added delay before cleaning logs to reduce chance of logging IP that already has been banned
|
||||||
time.Sleep(time.Second * 3)
|
time.Sleep(time.Second * 2)
|
||||||
|
|
||||||
if shouldCleanLog {
|
if shouldCleanLog {
|
||||||
// copy access log to persistent file
|
// copy access log to persistent file
|
||||||
|
|
|
@ -250,8 +250,8 @@ func (s *Server) startTask() {
|
||||||
// Check the inbound traffic every 30 seconds that the traffic exceeds and expires
|
// Check the inbound traffic every 30 seconds that the traffic exceeds and expires
|
||||||
s.cron.AddJob("@every 30s", job.NewCheckInboundJob())
|
s.cron.AddJob("@every 30s", job.NewCheckInboundJob())
|
||||||
|
|
||||||
// check client ips from log file every 20 sec
|
// check client ips from log file every 10 sec
|
||||||
s.cron.AddJob("@every 20s", job.NewCheckClientIpJob())
|
s.cron.AddJob("@every 10s", job.NewCheckClientIpJob())
|
||||||
|
|
||||||
// check client ips from log file every 3 day
|
// check client ips from log file every 3 day
|
||||||
s.cron.AddJob("@every 3d", job.NewClearLogsJob())
|
s.cron.AddJob("@every 3d", job.NewClearLogsJob())
|
||||||
|
|
4
x-ui.sh
4
x-ui.sh
|
@ -713,8 +713,8 @@ enabled=true
|
||||||
filter=3x-ipl
|
filter=3x-ipl
|
||||||
action=3x-ipl
|
action=3x-ipl
|
||||||
logpath=${iplimit_log_path}
|
logpath=${iplimit_log_path}
|
||||||
maxretry=3
|
maxretry=4
|
||||||
findtime=100
|
findtime=60
|
||||||
bantime=${bantime}m
|
bantime=${bantime}m
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue