diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-05 14:59:30 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-05 14:59:30 +0300 |
| commit | 2001d96148b04e00d53593ad20951f6d07cd0cea (patch) | |
| tree | b798891c5095ec634468cf8c3e035bd1c7e555c5 | |
| parent | 5c390341fbcb54f5de9c9110208f7c337542883c (diff) | |
iplimit - ipv6 support
| -rw-r--r-- | web/job/check_client_ip_job.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index e5e51c24..0b567d9b 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -122,13 +122,13 @@ func (j *CheckClientIpJob) processLogFile() bool { for scanner.Scan() { line := scanner.Text() - ipRegx, _ := regexp.Compile(`(\d+\.\d+\.\d+\.\d+).* accepted`) + ipRegx, _ := regexp.Compile(`from \[?([0-9a-fA-F:.]+)\]?:\d+ accepted`) emailRegx, _ := regexp.Compile(`email:.+`) matches := ipRegx.FindStringSubmatch(line) if len(matches) > 1 { ip := matches[1] - if ip == "127.0.0.1" { + if ip == "127.0.0.1" || ip == "::1" { continue } |
