From d02708c1aeb8f3f2f6eb03484a10ddd4a1be7896 Mon Sep 17 00:00:00 2001 From: Sascha Leib Date: Tue, 23 Sep 2025 16:31:08 +0200 Subject: [PATCH] Getting ready for 23.09 release --- config/default-config.json | 29 ++++++++++++++++++++--------- config/known-bots.json | 6 ++++++ config/known-clients.json | 4 ++-- plugin.info.txt | 2 +- script.js | 34 ++++++---------------------------- style.less | 10 +++++----- 6 files changed, 40 insertions(+), 45 deletions(-) diff --git a/config/default-config.json b/config/default-config.json index 78d4ce9..59ae26e 100644 --- a/config/default-config.json +++ b/config/default-config.json @@ -67,7 +67,8 @@ {"from": "5.161.0.0", "to": "5.161.255.255", "m": 16, "label": "Hetzner [US]"}, {"from": "8.127.0.0", "to": "8.223.255.254", "label": "Alibaba [CN]"}, {"from": "14.160.0.0", "to": "14.191.255.254", "m": 11, "label": "VNPT [VN]"}, - {"from": "24.240.0.0", "to": "24.247.255.255", "m": 13, "label": "Charter [US]"}, + {"from": "14.192.0.0", "to": "14.255.255.254", "m": 10, "label": "VNPT [VN]"}, + {"from": "14.224.0.0", "to": "24.255.255.254", "m": 11, "label": "Charter [US]"}, {"from": "27.106.0.0", "to": "27.106.127.254", "m": 17, "label": "Huawei [US]"}, {"from": "34.0.0.0", "to": "34.191.255.254", "label": "Google LLC"}, {"from": "43.132.0.0", "to": "43.132.255.254", "m": 16, "label": "Tencent [CN]"}, @@ -75,31 +76,37 @@ {"from": "45.0.0.0", "to": "45.255.255.254", "label": "Various small ISPs, mostly BR"}, {"from": "46.250.160.0", "to": "46.250.191.254", "m": 19, "label": "Huawei [MX]"}, {"from": "47.200.0.0", "to": "47.203.255.254", "m": 14, "label": "Frontier Communications [US]"}, - {"from": "49.0.192.0", "to": "49.0.255.255", "m": 18, "label": "Huawei [SG]"}, + {"from": "49.0.192.0", "to": "49.0.255.254", "m": 18, "label": "Huawei [SG]"}, {"from": "52.220.0.0", "to": "52.222.255.254", "label": "Amazon Data Services"}, {"from": "66.249.64.0", "to": "66.249.95.254", "m": 19, "label": "Google LLC"}, {"from": "84.37.35.0", "to": "84.37.255.254", "label": "GTT.net [US]"}, {"from": "94.74.64.0", "to": "94.74.127.254", "m": 18, "label": "Huawei [HK]"}, - {"from": "101.0.0.0", "to": "101.255.255.254", "label": "ChinaNet [CN]"}, + {"from": "101.0.0.0", "to": "101.255.255.254", "m": 8,"label": "ChinaNet [CN]"}, {"from": "104.196.0.0", "to": "104.199.255.254", "m": 14, "label": "Google LLC"}, {"from": "110.238.64.0", "to": "110.238.127.254", "m": 18, "label": "Huawei [SG]"}, {"from": "111.119.192.0", "to": "111.119.255.254", "m": 18, "label": "Huawei [SG]"}, {"from": "113.160.0.0", "to": "113.191.255.254", "m": 11, "label": "VNPT [VN]"}, {"from": "119.8.0.0", "to": "119.8.255.254", "m": 16, "label": "Huawei [HK]"}, + {"from": "119.13.0.0", "to": "119.13.255.254", "m": 16, "label": "Huawei [HK]"}, {"from": "121.91.168.0", "to": "121.91.175.254", "m": 21, "label": "Huawei [HK]"}, {"from": "122.8.0.0", "to": "122.8.255.254", "label": "CN-ISP [CN]"}, {"from": "122.9.0.0", "to": "122.9.255.254", "m": 16, "label": "Huawei [CN]"}, {"from": "123.16.0.0", "to": "123.31.255.254", "m": 12, "label": "VNPT [VN]"}, {"from": "124.243.128.0", "to": "124.243.191.254", "m": 18, "label": "Huawei [SG]"}, + {"from": "138.59.0.0", "to": "138.59.225.254", "m": 16, "label": "South-American ISPs (138.59.x)"}, + {"from": "138.121.0.0", "to": "138.121.225.254", "m": 16, "label": "South-American ISPs (138.121.x)"}, {"from": "142.147.128.0", "to": "1142.147.255.254", "m": 17, "label": "Web2Objects LLC [US]"}, {"from": "146.174.128.0", "to": "146.174.191.254", "m": 18, "label": "Huawei [SG]"}, {"from": "150.40.128.0", "to": "150.40.255.254", "m": 17, "label": "Huawei [HK]"}, {"from": "159.138.0.0", "to": "159.138.225.254", "m": 16, "label": "Huawei [TH]"}, - {"from": "162.128.0.0", "to": "162.128.255.254", "label": "Zenlayer [SG]"}, + {"from": "162.128.0.0", "to": "162.128.255.254", "m": 16, "label": "Zenlayer [SG]"}, {"from": "166.108.192.0", "to": "166.108.255.254", "m": 18, "label": "Huawei [SG]"}, - {"from": "171.224.0.0", "to": "171.239.255.255", "m": 12, "label": "Viettel [VN]"}, - {"from": "177.0.0.0", "to": "177.255.255.254", "label": "BrasilNET [BR]"}, - {"from": "179.0.0.0", "to": "179.255.255.254", "label": "BrasilNET [BR]"}, + {"from": "168.232.192.0", "to": "168.232.255.254", "m": 16, "label": "South-American ISPs (168.232.x)"}, + {"from": "170.82.0.0", "to": "170.82.255.254", "m": 16, "label": "South-American ISPs (170.254.x)"}, + {"from": "170.254.0.0", "to": "170.254.255.254", "m": 16, "label": "South-American ISPs (170.82.x)"}, + {"from": "171.224.0.0", "to": "171.239.255.254", "m": 12, "label": "Viettel [VN]"}, + {"from": "177.0.0.0", "to": "177.255.255.254", "m": 8, "label": "BrasilNET [BR]"}, + {"from": "179.0.0.0", "to": "179.255.255.254", "m": 8, "label": "BrasilNET [BR]"}, {"from": "183.87.32.0", "to": "183.87.63.254", "label": "Huawei [HK]"}, {"from": "186.0.0.0", "to": "186.255.255.254", "m": 8, "label": "South-American ISPs (186.x)"}, {"from": "187.0.0.0", "to": "187.255.255.254", "m": 8, "label": "South-American ISPs (187.x)"}, @@ -108,11 +115,15 @@ {"from": "190.0.0.0", "to": "190.255.255.254", "m": 8, "label": "South-American ISPs (190.x)"}, {"from": "191.0.0.0", "to": "191.255.255.254", "m": 8, "label": "South-American ISPs (191.x)"}, {"from": "192.124.170.0", "to": "192.124.182.254", "label": "Relcom [CZ]"}, - {"from": "195.37.0.0", "to": "195.37.255.255", "m": 16, "label": "DFN [DE]"}, + {"from": "195.37.0.0", "to": "195.37.255.254", "m": 16, "label": "DFN [DE]"}, + {"from": "200.0.0.0", "to": "200.255.255.254", "m": 8, "label": "South-American ISPs (200.x)"}, + {"from": "201.0.0.0", "to": "201.255.255.254", "m": 8, "label": "South-American ISPs (201.x)"}, + {"from": "212.95.128.0", "to": "212.95.159.254", "m": 19, "label": "Asiacell [IQ]"}, + {"from": "222.252.0.0", "to": "222.252.255.254", "m": 14, "label": "VNPT [VN]"}, {"from": "2001:4860::::::", "to": "2001:4860:ffff:ffff:ffff:ffff:ffff:ffff", "m": 32, "label": "Google LLC [US]"}, {"from": "2001:0ee0::::::", "to": "2001:ee3:ffff:ffff:ffff:ffff:ffff:ffff", "m": 30, "label": "VNPT [VN]"}, {"from": "2408:8210::::::", "to": "2408:8210:ffff:ffff:ffff:ffff:ffff:ffff", "m": 30, "label": "China Unicom [CN]"}, - {"from": "2600:1f00::::::", "to": "2600:1fff:ffff:ffff:ffff:ffff:ffff:ffff", "m": "Amazon Cloud"}, + {"from": "2600:1f00::::::", "to": "2600:1fff:ffff:ffff:ffff:ffff:ffff:ffff", "m": 24, "label": "Amazon Cloud"}, {"from": "2603:6010::::::", "to": "2603:6010:ffff:ffff:ffff:ffff:ffff:ffff", "m": 32, "label": "Charter [US]"}, {"from": "2603:8000::::::", "to": "2603:80ff:ffff:ffff:ffff:ffff:ffff:ffff", "m": 24, "label": "Charter [US]"}, {"from": "2607:a400::::::", "to": "2607:a400:ffff:ffff:ffff:ffff:ffff:ffff", "m": 32, "label": "Zenlayer Inc. [US]"}, diff --git a/config/known-bots.json b/config/known-bots.json index 74be01e..0fb0cd5 100644 --- a/config/known-bots.json +++ b/config/known-bots.json @@ -52,6 +52,12 @@ "rx": ["Slurp[\\s;\\)]"], "url": "http://help.yahoo.com/help/us/ysearch/slurp" }, + {"id": "yahoo", + "n": "Yahoo! Link Preview", + "r": [], + "rx": ["Yahoo Link Preview;"], + "url": "https://help.yahoo.com/kb/mail/yahoo-link-preview-SLN23615.html" + }, {"id": "ddg", "n": "DuckDuck Bot", "r": ["DuckDuckBot","DuckAssistBot","DuckDuckGo-Favicons-Bot"], diff --git a/config/known-clients.json b/config/known-clients.json index f1d94c0..80adefc 100644 --- a/config/known-clients.json +++ b/config/known-clients.json @@ -8,8 +8,8 @@ "rx": [ "\\sOpera\\/.*?Version\\/(\\d\\d)\\.", "Opera\\/(\\d\\d?)\\.", "\\sOPR\\/(\\d\\d?)\\." ] }, {"n": "Firefox on iOS", - "id": "firefox", - "rx": [ "\\sFxiOS\\/(\\d+)\\." ] + "id": "ffios", + "rx": [ "\\sFxiOS\\/(\\d+)[\\.\\s;]" ] }, {"n": "AOL Explorer", "id": "aol", diff --git a/plugin.info.txt b/plugin.info.txt index 9e8331d..fc1b918 100644 --- a/plugin.info.txt +++ b/plugin.info.txt @@ -1,7 +1,7 @@ base botmon author Sascha Leib email ad@hominem.com -date 2025-09-21 +date 2025-09-23 name Bot Monitoring desc A tool for monitoring and analysing bot traffic to your wiki (under development) url https://www.dokuwiki.org/plugin:botmon diff --git a/script.js b/script.js index 1d49113..02e481e 100644 --- a/script.js +++ b/script.js @@ -1329,8 +1329,9 @@ BotMon.live = { // is the IP address from a known bot network? fromKnownBotIP: function(visitor) { + //console.info('fromKnownBotIP()', visitor.ip); - const ipInfo = BotMon.live.data.rules.getBotIPInfo(visitor.ip); + const ipInfo = BotMon.live.data.ipRanges.match(visitor.ip); if (ipInfo) { visitor._ipInKnownBotRange = true; @@ -1406,32 +1407,7 @@ BotMon.live = { } return false; } - }, - - /* known bot IP ranges: */ - _botIPs: [], - - // return information on a bot IP range: - getBotIPInfo: function(ip) { - - // shortcut to make code more readable: - const me = BotMon.live.data.rules; - - // convert IP address to easier comparable form: - const ipNum = BotMon.t._ip2Num(ip); - - for (let i=0; i < me._botIPs.length; i++) { - const ipRange = me._botIPs[i]; - - if (ipNum >= ipRange.from && ipNum <= ipRange.to) { - return ipRange; - } - - }; - return null; - } - }, /** @@ -2164,8 +2140,10 @@ BotMon.live = { const row1 = make('div', {'class': 'row'}); - row1.appendChild(make('span', { // page id is the left group - 'data-lang': page.lang, + row1.appendChild(make('a', { // page id is the left group + 'href': DOKU_BASE + 'doku.php?id=' + encodeURIComponent(page.pg), + 'target': 'preview', + 'hreflang': page.lang, 'title': "PageID: " + page.pg }, page.pg)); /* DW Page ID */ diff --git a/style.less b/style.less index 64d74c6..6ef52ab 100644 --- a/style.less +++ b/style.less @@ -78,7 +78,7 @@ /* browser icons */ &.client::before { background-image: url('img/clients.png') } - &.cl_firefox::before { background-position-y: -20px } + &.cl_firefox::before, &.cl_ffios::before { background-position-y: -20px } &.cl_safari::before { background-position-y: -40px } &.cl_chrome::before { background-position-y: -60px } &.cl_msedge::before { background-position-y: -80px } @@ -199,7 +199,7 @@ &.ctry_hr::before { background-position-y: -2181px } &.ctry_ht::before { background-position-y: -2201px } &.ctry_hu::before { background-position-y: -2221px } - &.ctry_mc::before { background-position-y: -2241px } + &.ctry_id::before, &.ctry_mc::before { background-position-y: -2241px } &.ctry_ie::before { background-position-y: -2261px } &.ctry_il::before { background-position-y: -2281px } &.ctry_im::before { background-position-y: -2301px } @@ -600,14 +600,14 @@ } } } - span[data-lang] { + a[hreflang] { overflow: hidden; text-overflow: ellipsis; padding: 2pt 0 0 2pt; } - span[data-lang]::after { - content: attr(data-lang); + a[hreflang]::after { + content: attr(hreflang); font-size: smaller; color: #666; border: #666 solid 1px;