mirror of
https://github.com/gSpotx2f/ruantiblock_openwrt.git
synced 2026-05-14 14:40:58 +00:00
ruantiblock-mod-lua, ruantiblock-mod-py: BLLIST_ORG_EXCLUDED, fqdn-only mode.
This commit is contained in:
@@ -10,9 +10,9 @@ LUCI_APP=1
|
|||||||
HTTPS_DNS_PROXY=1
|
HTTPS_DNS_PROXY=1
|
||||||
|
|
||||||
OWRT_VERSION="current"
|
OWRT_VERSION="current"
|
||||||
RUAB_VERSION="2.1.8-r1"
|
RUAB_VERSION="2.1.9-r1"
|
||||||
RUAB_MOD_LUA_VERSION="2.1.8-r1"
|
RUAB_MOD_LUA_VERSION="2.1.9-r1"
|
||||||
RUAB_LUCI_APP_VERSION="2.1.8-r2"
|
RUAB_LUCI_APP_VERSION="2.1.9-r1"
|
||||||
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
|
BASE_URL="https://raw.githubusercontent.com/gSpotx2f/packages-openwrt/master"
|
||||||
PKG_DIR="/tmp"
|
PKG_DIR="/tmp"
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-ruantiblock
|
PKG_NAME:=luci-app-ruantiblock
|
||||||
PKG_VERSION:=2.1.8
|
PKG_VERSION:=2.1.9
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=1
|
||||||
LUCI_TITLE:=LuCI support for ruantiblock
|
LUCI_TITLE:=LuCI support for ruantiblock
|
||||||
LUCI_DEPENDS:=+ruantiblock
|
LUCI_DEPENDS:=+ruantiblock
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
|||||||
@@ -296,8 +296,8 @@ return view.extend({
|
|||||||
} else {
|
} else {
|
||||||
update_status.append(
|
update_status.append(
|
||||||
E('tr', { 'class': 'tr' }, [
|
E('tr', { 'class': 'tr' }, [
|
||||||
E('td', { 'class': 'td left' },
|
E('td', { 'class': 'td left', 'style': 'width:33%' },
|
||||||
_('Last blacklist update')),
|
_('Last blacklist update') + ':'),
|
||||||
E('td', { 'class': 'td left' }, _('No data')),
|
E('td', { 'class': 'td left' }, _('No data')),
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,9 +58,13 @@ return baseclass.extend({
|
|||||||
'ruantiblock-fqdn' : [ 'ruantiblock', 'fqdn', 'https://github.com/gSpotx2f/ruantiblock_blacklist' ],
|
'ruantiblock-fqdn' : [ 'ruantiblock', 'fqdn', 'https://github.com/gSpotx2f/ruantiblock_blacklist' ],
|
||||||
'ruantiblock-ip' : [ 'ruantiblock', 'ip', 'https://github.com/gSpotx2f/ruantiblock_blacklist' ],
|
'ruantiblock-ip' : [ 'ruantiblock', 'ip', 'https://github.com/gSpotx2f/ruantiblock_blacklist' ],
|
||||||
'zapret-info-fqdn' : [ '*zapret-info', 'fqdn', 'https://github.com/zapret-info/z-i' ],
|
'zapret-info-fqdn' : [ '*zapret-info', 'fqdn', 'https://github.com/zapret-info/z-i' ],
|
||||||
|
'zapret-info-fqdn-only': [ '*zapret-info', 'fqdn-only', 'https://github.com/zapret-info/z-i' ],
|
||||||
'zapret-info-ip' : [ '*zapret-info', 'ip', 'https://github.com/zapret-info/z-i' ],
|
'zapret-info-ip' : [ '*zapret-info', 'ip', 'https://github.com/zapret-info/z-i' ],
|
||||||
'rublacklist-fqdn' : [ '*rublacklist', 'fqdn', 'https://rublacklist.net' ],
|
'rublacklist-fqdn' : [ '*rublacklist', 'fqdn', 'https://rublacklist.net' ],
|
||||||
|
'rublacklist-fqdn-only': [ '*rublacklist', 'fqdn-only', 'https://rublacklist.net' ],
|
||||||
'rublacklist-ip' : [ '*rublacklist', 'ip', 'https://rublacklist.net' ],
|
'rublacklist-ip' : [ '*rublacklist', 'ip', 'https://rublacklist.net' ],
|
||||||
|
'antifilter-fqdn' : [ '*antifilter', 'fqdn', 'https://antifilter.download' ],
|
||||||
|
'antifilter-fqdn-only' : [ '*antifilter', 'fqdn-only', 'https://antifilter.download' ],
|
||||||
'antifilter-ip' : [ '*antifilter', 'ip', 'https://antifilter.download' ],
|
'antifilter-ip' : [ '*antifilter', 'ip', 'https://antifilter.download' ],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock-mod-lua
|
PKG_NAME:=ruantiblock-mod-lua
|
||||||
PKG_VERSION:=2.1.8
|
PKG_VERSION:=2.1.9
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ local Config = Class(nil, {
|
|||||||
["RBL_IP_URL"] = true,
|
["RBL_IP_URL"] = true,
|
||||||
["RBL_DPI_URL"] = true,
|
["RBL_DPI_URL"] = true,
|
||||||
["ZI_ALL_URL"] = true,
|
["ZI_ALL_URL"] = true,
|
||||||
|
["AF_IP_FULL_URL"] = true,
|
||||||
["AF_IP_URL"] = true,
|
["AF_IP_URL"] = true,
|
||||||
|
["AF_NET_URL"] = true,
|
||||||
["AF_FQDN_URL"] = true,
|
["AF_FQDN_URL"] = true,
|
||||||
["FZ_URL"] = true,
|
["FZ_URL"] = true,
|
||||||
["DL_IPSET_URL"] = true,
|
["DL_IPSET_URL"] = true,
|
||||||
@@ -85,6 +87,8 @@ local Config = Class(nil, {
|
|||||||
["BLLIST_IP_EXCLUDED_FILE"] = true,
|
["BLLIST_IP_EXCLUDED_FILE"] = true,
|
||||||
["BLLIST_CIDR_EXCLUDED_ENABLE"] = true,
|
["BLLIST_CIDR_EXCLUDED_ENABLE"] = true,
|
||||||
["BLLIST_CIDR_EXCLUDED_FILE"] = true,
|
["BLLIST_CIDR_EXCLUDED_FILE"] = true,
|
||||||
|
["BLLIST_ORG_EXCLUDED_ENABLE"] = true,
|
||||||
|
["BLLIST_ORG_EXCLUDED_FILE"] = true,
|
||||||
},
|
},
|
||||||
BLLIST_FQDN_FILTER_PATTERNS = {},
|
BLLIST_FQDN_FILTER_PATTERNS = {},
|
||||||
BLLIST_IP_FILTER_PATTERNS = {},
|
BLLIST_IP_FILTER_PATTERNS = {},
|
||||||
@@ -94,6 +98,7 @@ local Config = Class(nil, {
|
|||||||
BLLIST_FQDN_EXCLUDED_ITEMS = {},
|
BLLIST_FQDN_EXCLUDED_ITEMS = {},
|
||||||
BLLIST_IP_EXCLUDED_ITEMS = {},
|
BLLIST_IP_EXCLUDED_ITEMS = {},
|
||||||
BLLIST_CIDR_EXCLUDED_ITEMS = {},
|
BLLIST_CIDR_EXCLUDED_ITEMS = {},
|
||||||
|
BLLIST_ORG_EXCLUDED_ITEMS = {},
|
||||||
-- iconv type: standalone iconv or lua-iconv (standalone, lua)
|
-- iconv type: standalone iconv or lua-iconv (standalone, lua)
|
||||||
ICONV_TYPE = "standalone",
|
ICONV_TYPE = "standalone",
|
||||||
-- standalone iconv
|
-- standalone iconv
|
||||||
@@ -102,7 +107,7 @@ local Config = Class(nil, {
|
|||||||
encoding = "UTF-8",
|
encoding = "UTF-8",
|
||||||
site_encoding = "",
|
site_encoding = "",
|
||||||
http_send_headers = {
|
http_send_headers = {
|
||||||
["User-Agent"] = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/142.0",
|
["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0",
|
||||||
},
|
},
|
||||||
connect_timeout = nil,
|
connect_timeout = nil,
|
||||||
})
|
})
|
||||||
@@ -117,7 +122,9 @@ function Config:load_config(t)
|
|||||||
["RBL_IP_URL"] = true,
|
["RBL_IP_URL"] = true,
|
||||||
["RBL_DPI_URL"] = true,
|
["RBL_DPI_URL"] = true,
|
||||||
["ZI_ALL_URL"] = true,
|
["ZI_ALL_URL"] = true,
|
||||||
|
["AF_IP_FULL_URL"] = true,
|
||||||
["AF_IP_URL"] = true,
|
["AF_IP_URL"] = true,
|
||||||
|
["AF_NET_URL"] = true,
|
||||||
["AF_FQDN_URL"] = true,
|
["AF_FQDN_URL"] = true,
|
||||||
["FZ_URL"] = true,
|
["FZ_URL"] = true,
|
||||||
["DL_IPSET_URL"] = true,
|
["DL_IPSET_URL"] = true,
|
||||||
@@ -172,6 +179,7 @@ Config.BLLIST_SUMMARIZE_CIDR = remap_bool(Config.BLLIST_SUMMARIZE_CIDR)
|
|||||||
Config.BLLIST_FQDN_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_FQDN_EXCLUDED_ENABLE)
|
Config.BLLIST_FQDN_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_FQDN_EXCLUDED_ENABLE)
|
||||||
Config.BLLIST_IP_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_IP_EXCLUDED_ENABLE)
|
Config.BLLIST_IP_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_IP_EXCLUDED_ENABLE)
|
||||||
Config.BLLIST_CIDR_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_CIDR_EXCLUDED_ENABLE)
|
Config.BLLIST_CIDR_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_CIDR_EXCLUDED_ENABLE)
|
||||||
|
Config.BLLIST_ORG_EXCLUDED_ENABLE = remap_bool(Config.BLLIST_ORG_EXCLUDED_ENABLE)
|
||||||
|
|
||||||
-- Importing packages
|
-- Importing packages
|
||||||
|
|
||||||
@@ -281,6 +289,9 @@ function Config:load_filter_files()
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
if self.BLLIST_ORG_EXCLUDED_ENABLE then
|
||||||
|
load_file(self.BLLIST_ORG_EXCLUDED_FILE, self.BLLIST_ORG_EXCLUDED_ITEMS)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Config:check_filter(str, filter_patterns, reverse)
|
function Config:check_filter(str, filter_patterns, reverse)
|
||||||
@@ -329,7 +340,6 @@ end
|
|||||||
|
|
||||||
Config:load_filter_files()
|
Config:load_filter_files()
|
||||||
|
|
||||||
|
|
||||||
------------------------------ Classes -------------------------------
|
------------------------------ Classes -------------------------------
|
||||||
|
|
||||||
local BlackListParser = Class(Config, {
|
local BlackListParser = Class(Config, {
|
||||||
@@ -356,27 +366,42 @@ function BlackListParser:new(t)
|
|||||||
instance.fqdn_count = 0
|
instance.fqdn_count = 0
|
||||||
instance.fqdn_records_count = 0
|
instance.fqdn_records_count = 0
|
||||||
instance.fqdn_table = {}
|
instance.fqdn_table = {}
|
||||||
instance.iconv_handler = iconv and iconv.open(instance.encoding, instance.site_encoding) or nil
|
instance.iconv_handler_fqdn = iconv and iconv.open(instance.encoding, instance.site_encoding) or nil
|
||||||
|
instance.iconv_handler_org = iconv and iconv.open(instance.site_encoding, instance.encoding) or nil
|
||||||
instance.buff = ""
|
instance.buff = ""
|
||||||
instance.http_codes = {}
|
instance.http_codes = {}
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|
||||||
function BlackListParser:convert_encoding(input)
|
function BlackListParser:encoding_iconv(input, from, to)
|
||||||
local output
|
local output
|
||||||
if self.ICONV_TYPE == "lua" and self.iconv_handler then
|
local handler = assert(io.popen('printf \'%s\' \'' .. input .. '\' | ' .. self.ICONV_CMD .. ' -f "' .. from .. '" -t "' .. to .. '"', 'r'))
|
||||||
output = self.iconv_handler:iconv(input)
|
output = handler:read("*a")
|
||||||
|
handler:close()
|
||||||
|
return (output)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BlackListParser:encoding_lua(input, handler)
|
||||||
|
local output
|
||||||
|
if handler then
|
||||||
|
output = handler:iconv(input)
|
||||||
|
end
|
||||||
|
return (output)
|
||||||
|
end
|
||||||
|
|
||||||
|
function BlackListParser:convert_encoding(input, handler, from, to)
|
||||||
|
local output
|
||||||
|
if self.ICONV_TYPE == "lua" then
|
||||||
|
output = self:encoding_lua(input, handler)
|
||||||
elseif self.ICONV_TYPE == "standalone" and self.ICONV_CMD then
|
elseif self.ICONV_TYPE == "standalone" and self.ICONV_CMD then
|
||||||
local iconv_handler = assert(io.popen('printf \'%s\' \'' .. input .. '\' | ' .. self.ICONV_CMD .. ' -f "' .. self.site_encoding .. '" -t "' .. self.encoding .. '"', 'r'))
|
output = self:encoding_iconv(input, from, to)
|
||||||
output = iconv_handler:read("*a")
|
|
||||||
iconv_handler:close()
|
|
||||||
end
|
end
|
||||||
return (output)
|
return (output)
|
||||||
end
|
end
|
||||||
|
|
||||||
function BlackListParser:convert_to_punycode(input)
|
function BlackListParser:convert_to_punycode(input)
|
||||||
if self.site_encoding and self.site_encoding ~= "" then
|
if self.site_encoding and self.site_encoding ~= "" then
|
||||||
input = self:convert_encoding(input)
|
input = self:convert_encoding(input, self.iconv_handler_fqdn, self.site_encoding, self.encoding)
|
||||||
end
|
end
|
||||||
return input and (idn.encode(input))
|
return input and (idn.encode(input))
|
||||||
end
|
end
|
||||||
@@ -422,7 +447,7 @@ function BlackListParser:fqdn_value_processing(value)
|
|||||||
end
|
end
|
||||||
if not self.BLLIST_FQDN_FILTER or (self.BLLIST_FQDN_FILTER and not self:check_filter(value, self.BLLIST_FQDN_FILTER_PATTERNS, self.BLLIST_FQDN_FILTER_TYPE)) then
|
if not self.BLLIST_FQDN_FILTER or (self.BLLIST_FQDN_FILTER and not self:check_filter(value, self.BLLIST_FQDN_FILTER_PATTERNS, self.BLLIST_FQDN_FILTER_TYPE)) then
|
||||||
if value:match("^" .. self.fqdn_pattern .. "$") then
|
if value:match("^" .. self.fqdn_pattern .. "$") then
|
||||||
elseif self.BLLIST_ENABLE_IDN and value:match("^[^\\/&%?]-[^\\/&%?%.]+%.[^\\/&%?%.]+%.?$") then
|
elseif self.BLLIST_ENABLE_IDN and value:match('^[^",%%\\/&%?]-[^",%%\\/&%?%.]+%.[^",%%\\/&%?%.]+%.?$') then
|
||||||
value = self:convert_to_punycode(value)
|
value = self:convert_to_punycode(value)
|
||||||
if not value then
|
if not value then
|
||||||
return false
|
return false
|
||||||
@@ -440,6 +465,16 @@ function BlackListParser:fqdn_value_processing(value)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BlackListParser:org_value_processing(value)
|
||||||
|
if value == "" then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if self.BLLIST_ORG_EXCLUDED_ENABLE and self.BLLIST_ORG_EXCLUDED_ITEMS[value] then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
function BlackListParser:parser_func()
|
function BlackListParser:parser_func()
|
||||||
-- Must be overridden by a subclass
|
-- Must be overridden by a subclass
|
||||||
error("Method BlackListParser:parser_func() must be overridden by a subclass!")
|
error("Method BlackListParser:parser_func() must be overridden by a subclass!")
|
||||||
@@ -519,6 +554,16 @@ end
|
|||||||
|
|
||||||
function BlackListParser:run()
|
function BlackListParser:run()
|
||||||
local return_code = 0
|
local return_code = 0
|
||||||
|
if self.site_encoding and self.site_encoding ~= "" then
|
||||||
|
local t = {}
|
||||||
|
for i in pairs(self.BLLIST_ORG_EXCLUDED_ITEMS) do
|
||||||
|
local v = self:convert_encoding(i, self.iconv_handler_org, self.encoding, self.site_encoding)
|
||||||
|
if v then
|
||||||
|
t[v] = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.BLLIST_ORG_EXCLUDED_ITEMS = t
|
||||||
|
end
|
||||||
if self:download_files(self.url) then
|
if self:download_files(self.url) then
|
||||||
if (self.fqdn_count + self.ip_count + self.cidr_count) > self.BLLIST_MIN_ENTRIES then
|
if (self.fqdn_count + self.ip_count + self.cidr_count) > self.BLLIST_MIN_ENTRIES then
|
||||||
return_code = 0
|
return_code = 0
|
||||||
@@ -969,21 +1014,48 @@ local Rbl = Class(BlackListParser, {
|
|||||||
function Rbl:parser_func()
|
function Rbl:parser_func()
|
||||||
return function(chunk)
|
return function(chunk)
|
||||||
if chunk and chunk ~= "" then
|
if chunk and chunk ~= "" then
|
||||||
for fqdn_str, ip_str in chunk:gmatch('"domains": %["?(.-)"?%].-"ips": %[([a-f0-9/.:", ]*)%].-') do
|
for org_str, fqdn_str, ip_str in chunk:gmatch('"name": "(.-)".-"domains": %["?(.-)"?%].-"ips": %[([a-f0-9/.:", ]*)%].-') do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
fqdn_parser_func(self, ip_str, fqdn_str)
|
fqdn_parser_func(self, ip_str, fqdn_str)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local RblFQDN = Class(Rbl, {
|
||||||
|
})
|
||||||
|
|
||||||
|
function RblFQDN:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
for org_str, fqdn_str in chunk:gmatch('"name": "(.-)".-"domains": %["?(.-)"?%].-') do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
|
fqdn_parser_func(self, nil, fqdn_str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local RblIp = Class(Rbl, {
|
local RblIp = Class(Rbl, {
|
||||||
url = Config.RBL_IP_URL,
|
|
||||||
records_separator = ",",
|
|
||||||
ip_string_pattern = "([a-f0-9/.:]+)",
|
|
||||||
parser_func = ip_parser_func,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function RblIp:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
for org_str, ip_str in chunk:gmatch('"name": "(.-)".-"domains": %["?.-"?%].-"ips": %[([a-f0-9/.:", ]*)%].-') do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
|
self:ip_value_processing(ip_str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local RblDPI = Class(BlackListParser, {
|
local RblDPI = Class(BlackListParser, {
|
||||||
url = Config.RBL_DPI_URL,
|
url = Config.RBL_DPI_URL,
|
||||||
BLLIST_MIN_ENTRIES = 0,
|
BLLIST_MIN_ENTRIES = 0,
|
||||||
@@ -1050,19 +1122,48 @@ end
|
|||||||
function Zi:parser_func()
|
function Zi:parser_func()
|
||||||
return function(chunk)
|
return function(chunk)
|
||||||
if chunk and chunk ~= "" then
|
if chunk and chunk ~= "" then
|
||||||
for ip_str, fqdn_str in chunk:gmatch("([^;]-);([^;]-);.-" .. self.records_separator) do
|
for ip_str, fqdn_str, org_str in chunk:gmatch("([^;]-);([^;]-);[^;]-;([^;]-);.-" .. self.records_separator) do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
fqdn_parser_func(self, ip_str, fqdn_str)
|
fqdn_parser_func(self, ip_str, fqdn_str)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local ZiFQDN = Class(Zi, {
|
||||||
|
})
|
||||||
|
|
||||||
|
function ZiFQDN:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
for fqdn_str, org_str in chunk:gmatch("[^;]-;([^;]-);[^;]-;([^;]-);.-" .. self.records_separator) do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
|
fqdn_parser_func(self, nil, fqdn_str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local ZiIp = Class(Zi, {
|
local ZiIp = Class(Zi, {
|
||||||
ip_string_pattern = "([a-f0-9%.:/ |]+);.-\n",
|
|
||||||
parser_func = ip_parser_func,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function ZiIp:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
for ip_str, org_str in chunk:gmatch("([^;]-);[^;]-;[^;]-;([^;]-);.-" .. self.records_separator) do
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
|
self:ip_value_processing(ip_str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- antifilter
|
-- antifilter
|
||||||
|
|
||||||
local Af = Class(BlackListParser, {
|
local Af = Class(BlackListParser, {
|
||||||
@@ -1081,12 +1182,36 @@ function Af:parser_func()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local AfIp = Class(Af, {
|
local AfIpFull = Class(BlackListParser, {
|
||||||
|
url = Config.AF_IP_FULL_URL,
|
||||||
|
ip_string_pattern = "(.-)\n",
|
||||||
|
})
|
||||||
|
|
||||||
|
function AfIpFull:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
chunk = chunk:gsub("/32", "")
|
||||||
|
for ip_string in chunk:gmatch(self.ip_string_pattern) do
|
||||||
|
self:ip_value_processing(ip_string)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local AfIp = Class(BlackListParser, {
|
||||||
url = Config.AF_IP_URL,
|
url = Config.AF_IP_URL,
|
||||||
ip_string_pattern = "(.-)\n",
|
ip_string_pattern = "(.-)\n",
|
||||||
parser_func = ip_parser_func,
|
parser_func = ip_parser_func,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local AfNet = Class(BlackListParser, {
|
||||||
|
url = Config.AF_NET_URL,
|
||||||
|
BLLIST_MIN_ENTRIES = 0,
|
||||||
|
ip_string_pattern = "(.-)\n",
|
||||||
|
parser_func = ip_parser_func,
|
||||||
|
})
|
||||||
|
|
||||||
-- fz139
|
-- fz139
|
||||||
|
|
||||||
local Fz = Class(BlackListParser, {
|
local Fz = Class(BlackListParser, {
|
||||||
@@ -1099,6 +1224,8 @@ function Fz:parser_func()
|
|||||||
return function(chunk)
|
return function(chunk)
|
||||||
if chunk and chunk ~= "" then
|
if chunk and chunk ~= "" then
|
||||||
for entry in chunk:gmatch("(.-)" .. self.records_separator) do
|
for entry in chunk:gmatch("(.-)" .. self.records_separator) do
|
||||||
|
local org_str = entry:match('org="(.-)"')
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
local fqdn_str = entry:match("<domain><%!%[CDATA%[(.-)%]%]></domain>")
|
local fqdn_str = entry:match("<domain><%!%[CDATA%[(.-)%]%]></domain>")
|
||||||
if fqdn_str ~= nil and #fqdn_str > 0 and not fqdn_str:match("^" .. self.ip_pattern .. "$") and self:fqdn_value_processing(fqdn_str) then
|
if fqdn_str ~= nil and #fqdn_str > 0 and not fqdn_str:match("^" .. self.ip_pattern .. "$") and self:fqdn_value_processing(fqdn_str) then
|
||||||
else
|
else
|
||||||
@@ -1111,6 +1238,27 @@ function Fz:parser_func()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local FzFQDN = Class(Fz, {
|
||||||
|
})
|
||||||
|
|
||||||
|
function FzFQDN:parser_func()
|
||||||
|
return function(chunk)
|
||||||
|
if chunk and chunk ~= "" then
|
||||||
|
for entry in chunk:gmatch("(.-)" .. self.records_separator) do
|
||||||
|
local org_str = entry:match('org="(.-)"')
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
|
local fqdn_str = entry:match("<domain><%!%[CDATA%[(.-)%]%]></domain>")
|
||||||
|
if fqdn_str ~= nil and #fqdn_str > 0 and not fqdn_str:match("^" .. self.ip_pattern .. "$") then
|
||||||
|
self:fqdn_value_processing(fqdn_str)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1122,6 +1270,8 @@ function FzIp:parser_func()
|
|||||||
return function(chunk)
|
return function(chunk)
|
||||||
if chunk and chunk ~= "" then
|
if chunk and chunk ~= "" then
|
||||||
for entry in chunk:gmatch("(.-)" .. self.records_separator) do
|
for entry in chunk:gmatch("(.-)" .. self.records_separator) do
|
||||||
|
local org_str = entry:match('org="(.-)"')
|
||||||
|
if org_str == "" or not self:org_value_processing(org_str) then
|
||||||
for ip_str in entry:gmatch("<ip>(.-)</ip>") do
|
for ip_str in entry:gmatch("<ip>(.-)</ip>") do
|
||||||
self:ip_value_processing(ip_str)
|
self:ip_value_processing(ip_str)
|
||||||
end
|
end
|
||||||
@@ -1130,6 +1280,7 @@ function FzIp:parser_func()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1199,8 +1350,18 @@ end
|
|||||||
----------------------------- Main section ------------------------------
|
----------------------------- Main section ------------------------------
|
||||||
|
|
||||||
local parsers_table = {
|
local parsers_table = {
|
||||||
["ip"] = {["rublacklist"] = {RblIp}, ["zapret-info"] = {ZiIp}, ["antifilter"] = {AfIp}, ["fz"] = {FzIp}, ["ruantiblock"] = {Ra}},
|
["ip"] = {
|
||||||
["fqdn"] = {["rublacklist"] = {Rbl, RblDPI}, ["zapret-info"] = {Zi}, ["antifilter"] = {Af}, ["fz"] = {Fz}, ["ruantiblock"] = {Ra}},
|
["rublacklist"] = {RblIp}, ["zapret-info"] = {ZiIp},
|
||||||
|
["antifilter"] = {AfIpFull, AfNet}, ["fz"] = {FzIp}, ["ruantiblock"] = {Ra},
|
||||||
|
},
|
||||||
|
["fqdn"] = {
|
||||||
|
["rublacklist"] = {Rbl, RblDPI}, ["zapret-info"] = {Zi},
|
||||||
|
["antifilter"] = {Af, AfNet}, ["fz"] = {Fz}, ["ruantiblock"] = {Ra},
|
||||||
|
},
|
||||||
|
["fqdn-only"] = {
|
||||||
|
["rublacklist"] = {RblFQDN, RblDPI}, ["zapret-info"] = {ZiFQDN},
|
||||||
|
["antifilter"] = {Af}, ["fz"] = {FzFQDN}, ["ruantiblock"] = {Ra},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local ret_list = {}
|
local ret_list = {}
|
||||||
@@ -1213,7 +1374,6 @@ if parser_classes then
|
|||||||
for _, i in ipairs(parser_instances) do
|
for _, i in ipairs(parser_instances) do
|
||||||
ret_list[i:run()] = true
|
ret_list[i:run()] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local return_sum = 0
|
local return_sum = 0
|
||||||
for i, _ in pairs(ret_list) do
|
for i, _ in pairs(ret_list) do
|
||||||
return_sum = return_sum + i
|
return_sum = return_sum + i
|
||||||
@@ -1229,5 +1389,4 @@ if parser_classes then
|
|||||||
else
|
else
|
||||||
error("Wrong configuration! (Config.BLLIST_MODE, Config.BLLIST_SOURCE)")
|
error("Wrong configuration! (Config.BLLIST_MODE, Config.BLLIST_SOURCE)")
|
||||||
end
|
end
|
||||||
|
|
||||||
os.exit(ret_list[1] and 1 or (ret_list[2] and 2 or 0))
|
os.exit(ret_list[1] and 1 or (ret_list[2] and 2 or 0))
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock-mod-py
|
PKG_NAME:=ruantiblock-mod-py
|
||||||
PKG_VERSION:=2.1.8
|
PKG_VERSION:=2.1.9
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ class Config:
|
|||||||
"RBL_IP_URL",
|
"RBL_IP_URL",
|
||||||
"RBL_DPI_URL",
|
"RBL_DPI_URL",
|
||||||
"ZI_ALL_URL",
|
"ZI_ALL_URL",
|
||||||
|
"AF_IP_FULL_URL",
|
||||||
"AF_IP_URL",
|
"AF_IP_URL",
|
||||||
|
"AF_NET_URL",
|
||||||
"AF_FQDN_URL",
|
"AF_FQDN_URL",
|
||||||
"FZ_URL",
|
"FZ_URL",
|
||||||
"DL_IPSET_URL",
|
"DL_IPSET_URL",
|
||||||
@@ -71,6 +73,8 @@ class Config:
|
|||||||
"BLLIST_IP_EXCLUDED_FILE",
|
"BLLIST_IP_EXCLUDED_FILE",
|
||||||
"BLLIST_CIDR_EXCLUDED_ENABLE",
|
"BLLIST_CIDR_EXCLUDED_ENABLE",
|
||||||
"BLLIST_CIDR_EXCLUDED_FILE",
|
"BLLIST_CIDR_EXCLUDED_FILE",
|
||||||
|
"BLLIST_ORG_EXCLUDED_ENABLE",
|
||||||
|
"BLLIST_ORG_EXCLUDED_FILE",
|
||||||
]
|
]
|
||||||
BLLIST_FQDN_FILTER_PATTERNS = []
|
BLLIST_FQDN_FILTER_PATTERNS = []
|
||||||
BLLIST_IP_FILTER_PATTERNS = []
|
BLLIST_IP_FILTER_PATTERNS = []
|
||||||
@@ -80,12 +84,13 @@ class Config:
|
|||||||
BLLIST_FQDN_EXCLUDED_ITEMS = set()
|
BLLIST_FQDN_EXCLUDED_ITEMS = set()
|
||||||
BLLIST_IP_EXCLUDED_ITEMS = set()
|
BLLIST_IP_EXCLUDED_ITEMS = set()
|
||||||
BLLIST_CIDR_EXCLUDED_ITEMS = []
|
BLLIST_CIDR_EXCLUDED_ITEMS = []
|
||||||
|
BLLIST_ORG_EXCLUDED_ITEMS = set()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _load_config(cls, cfg_dict):
|
def _load_config(cls, cfg_dict):
|
||||||
|
|
||||||
def normalize_string(string):
|
def normalize_string(string):
|
||||||
return re.sub('"', '', string)
|
return string.replace('"', '')
|
||||||
|
|
||||||
config_sets = set()
|
config_sets = set()
|
||||||
config_arrays = {
|
config_arrays = {
|
||||||
@@ -93,7 +98,9 @@ class Config:
|
|||||||
"RBL_IP_URL",
|
"RBL_IP_URL",
|
||||||
"RBL_DPI_URL",
|
"RBL_DPI_URL",
|
||||||
"ZI_ALL_URL",
|
"ZI_ALL_URL",
|
||||||
|
"AF_IP_FULL_URL",
|
||||||
"AF_IP_URL",
|
"AF_IP_URL",
|
||||||
|
"AF_NET_URL",
|
||||||
"AF_FQDN_URL",
|
"AF_FQDN_URL",
|
||||||
"FZ_URL",
|
"FZ_URL",
|
||||||
"DL_IPSET_URL",
|
"DL_IPSET_URL",
|
||||||
@@ -198,6 +205,12 @@ class Config:
|
|||||||
cls.BLLIST_CIDR_EXCLUDED_ITEMS, is_array=True,
|
cls.BLLIST_CIDR_EXCLUDED_ITEMS, is_array=True,
|
||||||
func=cls.makeIPv4Network)
|
func=cls.makeIPv4Network)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def load_org_excluded(cls, file_path=None):
|
||||||
|
if cls.BLLIST_ORG_EXCLUDED_ENABLE:
|
||||||
|
cls._load_filter(file_path or cls.BLLIST_ORG_EXCLUDED_FILE,
|
||||||
|
cls.BLLIST_ORG_EXCLUDED_ITEMS)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _check_filter(string, filter_patterns, reverse=False):
|
def _check_filter(string, filter_patterns, reverse=False):
|
||||||
if filter_patterns and string:
|
if filter_patterns and string:
|
||||||
@@ -257,7 +270,7 @@ class BlackListParser(Config):
|
|||||||
self.output_fqdn_count = 0
|
self.output_fqdn_count = 0
|
||||||
self.ssl_unverified = False
|
self.ssl_unverified = False
|
||||||
self.send_headers_dict = {
|
self.send_headers_dict = {
|
||||||
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/142.0",
|
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0",
|
||||||
}
|
}
|
||||||
### Proxies (ex.: self.proxies = {"http": "http://192.168.0.1:8080", "https": "http://192.168.0.1:8080"})
|
### Proxies (ex.: self.proxies = {"http": "http://192.168.0.1:8080", "https": "http://192.168.0.1:8080"})
|
||||||
self.proxies = None
|
self.proxies = None
|
||||||
@@ -411,6 +424,12 @@ class BlackListParser(Config):
|
|||||||
else:
|
else:
|
||||||
raise FieldValueError()
|
raise FieldValueError()
|
||||||
|
|
||||||
|
def org_value_processing(self, value):
|
||||||
|
if not value:
|
||||||
|
return
|
||||||
|
if self.BLLIST_ORG_EXCLUDED_ENABLE and value in self.BLLIST_ORG_EXCLUDED_ITEMS:
|
||||||
|
return True
|
||||||
|
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
"""Must be overridden by a subclass"""
|
"""Must be overridden by a subclass"""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
@@ -669,17 +688,21 @@ class WriteConfigFiles(Config):
|
|||||||
f"{cidr_count} {ip_count} {fqdn_count}")
|
f"{cidr_count} {ip_count} {fqdn_count}")
|
||||||
|
|
||||||
|
|
||||||
class RblFQDN(BlackListParser):
|
class RblHybrid(BlackListParser):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.url = self.RBL_ALL_URL
|
self.url = self.RBL_ALL_URL
|
||||||
self.records_separator = '{"appearDate": '
|
self.records_separator = '{"appearDate": '
|
||||||
self.ips_separator = ", "
|
self.ips_separator = ", "
|
||||||
|
self.entry_regexp = re.compile(r'"domains": \["?(.*?)"?\].*?"ips": \[([a-f0-9/.:", ]*)\]')
|
||||||
|
self.org_value_regexp = re.compile(r'"name": "(.*?)"')
|
||||||
|
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
res = re.search(r'"domains": \["?(.*?)"?\].*?"ips": \[([a-f0-9/.:", ]*)\]', entry)
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
|
res = self.entry_regexp.search(entry)
|
||||||
if not res:
|
if not res:
|
||||||
continue
|
continue
|
||||||
ip_string = res.group(2).replace('"', "")
|
ip_string = res.group(2).replace('"', "")
|
||||||
@@ -700,11 +723,12 @@ class RblDPI(BlackListParser):
|
|||||||
self.url = self.RBL_DPI_URL
|
self.url = self.RBL_DPI_URL
|
||||||
self.BLLIST_MIN_ENTRIES = 0
|
self.BLLIST_MIN_ENTRIES = 0
|
||||||
self.records_separator = '{"domains"'
|
self.records_separator = '{"domains"'
|
||||||
|
self.entry_regexp = re.compile(r': \[(.*?)\]')
|
||||||
|
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
res = re.search(r': \[(.*?)\]', entry)
|
res = self.entry_regexp.search(entry)
|
||||||
if not res:
|
if not res:
|
||||||
continue
|
continue
|
||||||
fqdn_string = res.group(1)
|
fqdn_string = res.group(1)
|
||||||
@@ -715,19 +739,40 @@ class RblDPI(BlackListParser):
|
|||||||
except FieldValueError:
|
except FieldValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class RblIp(BlackListParser):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
self.url = self.RBL_IP_URL
|
|
||||||
self.records_separator = ","
|
|
||||||
|
|
||||||
|
class RblFQDN(RblHybrid):
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
self.ip_value_processing(re.sub(r'[\[\]" ]', "", entry))
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
|
res = self.entry_regexp.search(entry)
|
||||||
|
if not res:
|
||||||
|
continue
|
||||||
|
fqdn_string = res.group(1)
|
||||||
|
if fqdn_string:
|
||||||
|
try:
|
||||||
|
self.fqdn_value_processing(fqdn_string)
|
||||||
|
except FieldValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ZiFQDN(BlackListParser):
|
class RblIp(RblHybrid):
|
||||||
|
def parser_func(self):
|
||||||
|
for url in self.url:
|
||||||
|
for entry in self._split_entries(url):
|
||||||
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
|
res = self.entry_regexp.search(entry)
|
||||||
|
if not res:
|
||||||
|
continue
|
||||||
|
ip_string = res.group(2).replace('"', "")
|
||||||
|
if ip_string:
|
||||||
|
for i in ip_string.split(self.ips_separator):
|
||||||
|
self.ip_value_processing(i)
|
||||||
|
|
||||||
|
|
||||||
|
class ZiHybrid(BlackListParser):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.url = self.ZI_ALL_URL
|
self.url = self.ZI_ALL_URL
|
||||||
@@ -750,6 +795,7 @@ class ZiFQDN(BlackListParser):
|
|||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
entry_list = entry.split(self.fields_separator)
|
entry_list = entry.split(self.fields_separator)
|
||||||
try:
|
try:
|
||||||
|
if not entry_list[3] or not self.org_value_processing(entry_list[3]):
|
||||||
if entry_list[1]:
|
if entry_list[1]:
|
||||||
try:
|
try:
|
||||||
self.fqdn_value_processing(entry_list[1])
|
self.fqdn_value_processing(entry_list[1])
|
||||||
@@ -763,13 +809,34 @@ class ZiFQDN(BlackListParser):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ZiIp(ZiFQDN):
|
class ZiFQDN(ZiHybrid):
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
entry_list = entry.split(self.fields_separator)
|
entry_list = entry.split(self.fields_separator)
|
||||||
|
try:
|
||||||
|
if not entry_list[3] or not self.org_value_processing(entry_list[3]):
|
||||||
|
if entry_list[1]:
|
||||||
|
try:
|
||||||
|
self.fqdn_value_processing(entry_list[1])
|
||||||
|
except FieldValueError:
|
||||||
|
pass
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ZiIp(ZiHybrid):
|
||||||
|
def parser_func(self):
|
||||||
|
for url in self.url:
|
||||||
|
for entry in self._split_entries(url):
|
||||||
|
entry_list = entry.split(self.fields_separator)
|
||||||
|
try:
|
||||||
|
if not entry_list[3] or not self.org_value_processing(entry_list[3]):
|
||||||
for i in entry_list[0].split(self.ips_separator):
|
for i in entry_list[0].split(self.ips_separator):
|
||||||
self.ip_value_processing(i)
|
self.ip_value_processing(i)
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class AfFQDN(BlackListParser):
|
class AfFQDN(BlackListParser):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -782,7 +849,19 @@ class AfFQDN(BlackListParser):
|
|||||||
try:
|
try:
|
||||||
self.fqdn_value_processing(entry)
|
self.fqdn_value_processing(entry)
|
||||||
except FieldValueError:
|
except FieldValueError:
|
||||||
self.ip_value_processing(entry)
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class AfIpFull(BlackListParser):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.url = self.AF_IP_FULL_URL
|
||||||
|
self.entry_regexp = re.compile(r"/32$")
|
||||||
|
|
||||||
|
def parser_func(self):
|
||||||
|
for url in self.url:
|
||||||
|
for entry in self._split_entries(url):
|
||||||
|
self.ip_value_processing(self.entry_regexp.sub("", entry))
|
||||||
|
|
||||||
|
|
||||||
class AfIp(BlackListParser):
|
class AfIp(BlackListParser):
|
||||||
@@ -796,7 +875,19 @@ class AfIp(BlackListParser):
|
|||||||
self.ip_value_processing(entry)
|
self.ip_value_processing(entry)
|
||||||
|
|
||||||
|
|
||||||
class FzFQDN(BlackListParser):
|
class AfNet(BlackListParser):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.BLLIST_MIN_ENTRIES = 0
|
||||||
|
self.url = self.AF_NET_URL
|
||||||
|
|
||||||
|
def parser_func(self):
|
||||||
|
for url in self.url:
|
||||||
|
for entry in self._split_entries(url):
|
||||||
|
self.ip_value_processing(entry)
|
||||||
|
|
||||||
|
|
||||||
|
class FzHybrid(BlackListParser):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.url = self.FZ_URL
|
self.url = self.FZ_URL
|
||||||
@@ -805,10 +896,13 @@ class FzFQDN(BlackListParser):
|
|||||||
self.fqdn_value_regexp = re.compile(r"<domain><\!\[CDATA\[(.*?)\]\]></domain>", re.U)
|
self.fqdn_value_regexp = re.compile(r"<domain><\!\[CDATA\[(.*?)\]\]></domain>", re.U)
|
||||||
self.ip_value_regexp = re.compile(r"<ip>(.*?)</ip>")
|
self.ip_value_regexp = re.compile(r"<ip>(.*?)</ip>")
|
||||||
self.cidr_value_regexp = re.compile(r"<ipSubnet>(.*?)</ipSubnet>")
|
self.cidr_value_regexp = re.compile(r"<ipSubnet>(.*?)</ipSubnet>")
|
||||||
|
self.org_value_regexp = re.compile(r'org="(.*?)"')
|
||||||
|
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
res = self.fqdn_value_regexp.search(entry)
|
res = self.fqdn_value_regexp.search(entry)
|
||||||
if res and res.group(1):
|
if res and res.group(1):
|
||||||
try:
|
try:
|
||||||
@@ -825,10 +919,26 @@ class FzFQDN(BlackListParser):
|
|||||||
self.ip_value_processing(i.group(1))
|
self.ip_value_processing(i.group(1))
|
||||||
|
|
||||||
|
|
||||||
class FzIp(FzFQDN):
|
class FzFQDN(FzHybrid):
|
||||||
def parser_func(self):
|
def parser_func(self):
|
||||||
for url in self.url:
|
for url in self.url:
|
||||||
for entry in self._split_entries(url):
|
for entry in self._split_entries(url):
|
||||||
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
|
res = self.fqdn_value_regexp.search(entry)
|
||||||
|
if res and res.group(1):
|
||||||
|
try:
|
||||||
|
self.fqdn_value_processing(res.group(1))
|
||||||
|
except FieldValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class FzIp(FzHybrid):
|
||||||
|
def parser_func(self):
|
||||||
|
for url in self.url:
|
||||||
|
for entry in self._split_entries(url):
|
||||||
|
org = self.org_value_regexp.search(entry)
|
||||||
|
if not org or not self.org_value_processing(org.group(1)):
|
||||||
for i in self.ip_value_regexp.finditer(entry):
|
for i in self.ip_value_regexp.finditer(entry):
|
||||||
if i.group(1):
|
if i.group(1):
|
||||||
self.ip_value_processing(i.group(1))
|
self.ip_value_processing(i.group(1))
|
||||||
@@ -883,9 +993,20 @@ if __name__ == "__main__":
|
|||||||
Config.load_fqdn_excluded()
|
Config.load_fqdn_excluded()
|
||||||
Config.load_ip_excluded()
|
Config.load_ip_excluded()
|
||||||
Config.load_cidr_excluded()
|
Config.load_cidr_excluded()
|
||||||
|
Config.load_org_excluded()
|
||||||
parsers_dict = {
|
parsers_dict = {
|
||||||
"ip": {"rublacklist": [RblIp], "zapret-info": [ZiIp], "antifilter": [AfIp], "fz": [FzIp], "ruantiblock": [Ra]},
|
"ip": {
|
||||||
"fqdn": {"rublacklist": [RblFQDN, RblDPI], "zapret-info": [ZiFQDN], "antifilter": [AfFQDN], "fz": [FzFQDN], "ruantiblock": [Ra]},
|
"rublacklist": [RblIp], "zapret-info": [ZiIp],
|
||||||
|
"antifilter": [AfIpFull, AfNet], "fz": [FzIp], "ruantiblock": [Ra],
|
||||||
|
},
|
||||||
|
"fqdn": {
|
||||||
|
"rublacklist": [RblHybrid, RblDPI], "zapret-info": [ZiHybrid],
|
||||||
|
"antifilter": [AfFQDN, AfNet], "fz": [FzHybrid], "ruantiblock": [Ra],
|
||||||
|
},
|
||||||
|
"fqdn-only": {
|
||||||
|
"rublacklist": [RblFQDN, RblDPI], "zapret-info": [ZiFQDN],
|
||||||
|
"antifilter": [AfFQDN], "fz": [FzFQDN], "ruantiblock": [Ra],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
parser_classes = parsers_dict[Config.BLLIST_MODE][Config.BLLIST_SOURCE]
|
parser_classes = parsers_dict[Config.BLLIST_MODE][Config.BLLIST_SOURCE]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ruantiblock
|
PKG_NAME:=ruantiblock
|
||||||
PKG_VERSION:=2.1.8
|
PKG_VERSION:=2.1.9
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,13 @@ al[ck]o
|
|||||||
[cs]pravk
|
[cs]pravk
|
||||||
bets?
|
bets?
|
||||||
igr[ova]+
|
igr[ova]+
|
||||||
olimp
|
ol[iy]mp
|
||||||
p[o0]ker
|
p[o0]ker
|
||||||
leon
|
leon
|
||||||
jackpot
|
jackpot
|
||||||
spin
|
spin
|
||||||
loto
|
loto
|
||||||
bcity
|
bcity
|
||||||
stavka
|
|
||||||
lotery
|
lotery
|
||||||
fortuna
|
fortuna
|
||||||
blackja
|
blackja
|
||||||
@@ -36,6 +35,8 @@ cash
|
|||||||
market
|
market
|
||||||
kupit
|
kupit
|
||||||
drug
|
drug
|
||||||
|
mefedron
|
||||||
|
narco
|
||||||
farma
|
farma
|
||||||
apteka
|
apteka
|
||||||
drop
|
drop
|
||||||
@@ -53,14 +54,15 @@ putan
|
|||||||
intim
|
intim
|
||||||
escort
|
escort
|
||||||
feya
|
feya
|
||||||
^1[-]?win
|
1[-]?win[-]
|
||||||
|
[.]win
|
||||||
|
#[.-]win
|
||||||
vegas
|
vegas
|
||||||
gamble
|
gamble
|
||||||
fishka
|
fishka
|
||||||
vavada
|
vavada
|
||||||
gold
|
gold
|
||||||
avtomat
|
avtomat
|
||||||
[.]win
|
|
||||||
pin[-]?up
|
pin[-]?up
|
||||||
stav[ko]
|
stav[ko]
|
||||||
luck
|
luck
|
||||||
@@ -84,3 +86,27 @@ kraken
|
|||||||
zerkalo
|
zerkalo
|
||||||
^1w
|
^1w
|
||||||
^1x
|
^1x
|
||||||
|
pin[ck]o
|
||||||
|
^gamm?a[0-9-]
|
||||||
|
^zooma
|
||||||
|
^flagman[0-9-]
|
||||||
|
cactus[0-9-]
|
||||||
|
^stake[0-9-]
|
||||||
|
arkada[0-9-]
|
||||||
|
^selector[0-9-]
|
||||||
|
^7k[0-9-]
|
||||||
|
gizbo
|
||||||
|
^888
|
||||||
|
^monro[0-9-]
|
||||||
|
^martin[0-9-]
|
||||||
|
^kometa[0-9-]
|
||||||
|
^kush[0-9-]
|
||||||
|
clubnika
|
||||||
|
vodka
|
||||||
|
syka
|
||||||
|
shot[0-9-]
|
||||||
|
twin[0-9-]
|
||||||
|
irwin[c0-9-]
|
||||||
|
columbus
|
||||||
|
cryptoboss
|
||||||
|
#lord
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ dyndns.org
|
|||||||
dynsip.org
|
dynsip.org
|
||||||
mydns.jp
|
mydns.jp
|
||||||
mooo.com
|
mooo.com
|
||||||
|
github.io
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ BLLIST_MODULE=""
|
|||||||
|
|
||||||
### Настройки модулей-парсеров ###
|
### Настройки модулей-парсеров ###
|
||||||
|
|
||||||
### Режим обхода блокировок: ruantiblock-fqdn, ruantiblock-ip, zapret-info-fqdn, zapret-info-ip, rublacklist-fqdn, rublacklist-ip, antifilter-ip, fz-fqdn, fz-ip
|
### Режим обхода блокировок: ruantiblock-ip, ruantiblock-fqdn, ruantiblock-fqdn-only, zapret-info-ip, zapret-info-fqdn, zapret-info-fqdn-only, rublacklist-ip, rublacklist-fqdn, rublacklist-fqdn-only, antifilter-ip, antifilter-fqdn, antifilter-fqdn-only, fz-ip, fz-fqdn, fz-fqdn-only
|
||||||
BLLIST_PRESET=""
|
BLLIST_PRESET=""
|
||||||
### В случае если из источника получено менее указанного кол-ва записей, то обновления списков не происходит
|
### В случае если из источника получено менее указанного кол-ва записей, то обновления списков не происходит
|
||||||
BLLIST_MIN_ENTRIES=3000
|
BLLIST_MIN_ENTRIES=3000
|
||||||
@@ -141,6 +141,10 @@ BLLIST_FQDN_FILTER_FILE="/etc/ruantiblock/fqdn_filter"
|
|||||||
BLLIST_FQDN_EXCLUDED_ENABLE=0
|
BLLIST_FQDN_EXCLUDED_ENABLE=0
|
||||||
### Файл с записями FQDN для опции BLLIST_FQDN_EXCLUDED_ENABLE
|
### Файл с записями FQDN для опции BLLIST_FQDN_EXCLUDED_ENABLE
|
||||||
BLLIST_FQDN_EXCLUDED_FILE="/etc/ruantiblock/fqdn_excluded"
|
BLLIST_FQDN_EXCLUDED_FILE="/etc/ruantiblock/fqdn_excluded"
|
||||||
|
### Включение опции исключения записей определённых гос.органов из блэклиста
|
||||||
|
BLLIST_ORG_EXCLUDED_ENABLE=0
|
||||||
|
### Файл с записями для опции BLLIST_ORG_EXCLUDED_ENABLE
|
||||||
|
BLLIST_ORG_EXCLUDED_FILE="/etc/ruantiblock/org_excluded"
|
||||||
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
||||||
BLLIST_STRIP_WWW=1
|
BLLIST_STRIP_WWW=1
|
||||||
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ export BLLIST_MODULE=""
|
|||||||
|
|
||||||
##############################
|
##############################
|
||||||
|
|
||||||
### Режим обхода блокировок: ruantiblock-fqdn, ruantiblock-ip, zapret-info-fqdn, zapret-info-ip, rublacklist-fqdn, rublacklist-ip, antifilter-ip, fz-fqdn, fz-ip
|
### Режим обхода блокировок: ruantiblock-ip, ruantiblock-fqdn, zapret-info-ip, zapret-info-fqdn, zapret-info-fqdn-only, rublacklist-ip, rublacklist-fqdn, rublacklist-fqdn-only, antifilter-ip, antifilter-fqdn, antifilter-fqdn-only, fz-ip, fz-fqdn, fz-fqdn-only
|
||||||
export BLLIST_PRESET=""
|
export BLLIST_PRESET=""
|
||||||
### В случае если из источника получено менее указанного кол-ва записей, то обновления списков не происходит
|
### В случае если из источника получено менее указанного кол-ва записей, то обновления списков не происходит
|
||||||
export BLLIST_MIN_ENTRIES=3000
|
export BLLIST_MIN_ENTRIES=3000
|
||||||
@@ -177,6 +177,10 @@ export BLLIST_FQDN_FILTER_FILE="${CONFIG_DIR}/fqdn_filter"
|
|||||||
export BLLIST_FQDN_EXCLUDED_ENABLE=0
|
export BLLIST_FQDN_EXCLUDED_ENABLE=0
|
||||||
### Файл с записями FQDN для опции BLLIST_FQDN_EXCLUDED_ENABLE
|
### Файл с записями FQDN для опции BLLIST_FQDN_EXCLUDED_ENABLE
|
||||||
export BLLIST_FQDN_EXCLUDED_FILE="${CONFIG_DIR}/fqdn_excluded"
|
export BLLIST_FQDN_EXCLUDED_FILE="${CONFIG_DIR}/fqdn_excluded"
|
||||||
|
### Включение опции исключения записей определённых гос.органов из блэклиста
|
||||||
|
export BLLIST_ORG_EXCLUDED_ENABLE=0
|
||||||
|
### Файл с записями для опции BLLIST_ORG_EXCLUDED_ENABLE
|
||||||
|
export BLLIST_ORG_EXCLUDED_FILE="${CONFIG_DIR}/org_excluded"
|
||||||
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
### Обрезка www[0-9]. в FQDN (0 - выкл, 1 - вкл)
|
||||||
export BLLIST_STRIP_WWW=1
|
export BLLIST_STRIP_WWW=1
|
||||||
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
### Преобразование кириллических доменов в punycode (0 - выкл, 1 - вкл)
|
||||||
|
|||||||
@@ -6,10 +6,13 @@ export RBL_DPI_URL="https://reestr.rublacklist.net/api/v3/dpi/"
|
|||||||
export RBL_ENCODING=""
|
export RBL_ENCODING=""
|
||||||
## zapret-info
|
## zapret-info
|
||||||
export ZI_ALL_URL="https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-00.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-01.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-02.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-03.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-04.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-05.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-06.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-07.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-08.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-09.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-10.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-11.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-12.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-13.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-14.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-15.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-16.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-17.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-18.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-19.csv"
|
export ZI_ALL_URL="https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-00.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-01.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-02.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-03.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-04.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-05.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-06.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-07.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-08.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-09.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-10.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-11.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-12.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-13.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-14.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-15.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-16.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-17.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-18.csv https://raw.githubusercontent.com/zapret-info/z-i/refs/heads/master/dump-19.csv"
|
||||||
|
# export ZI_ALL_URL="https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-00.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-01.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-02.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-03.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-04.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-05.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-06.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-07.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-08.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-09.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-10.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-11.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-12.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-13.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-14.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-15.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-16.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-17.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-18.csv?format=raw https://sourceforge.net/p/zapret-info/code/HEAD/tree/dump-19.csv?format=raw"
|
||||||
#export ZI_ALL_URL="https://app.assembla.com/spaces/z-i/git/source/master/dump.csv?_format=raw"
|
#export ZI_ALL_URL="https://app.assembla.com/spaces/z-i/git/source/master/dump.csv?_format=raw"
|
||||||
export ZI_ENCODING="CP1251"
|
export ZI_ENCODING="CP1251"
|
||||||
## antifilter
|
## antifilter
|
||||||
export AF_IP_URL="https://antifilter.download/list/allyouneed.lst"
|
export AF_IP_FULL_URL="https://antifilter.download/list/ipresolve.lst"
|
||||||
|
export AF_IP_URL="https://antifilter.download/list/ip.lst"
|
||||||
|
export AF_NET_URL="https://antifilter.download/list/subnet.lst"
|
||||||
export AF_FQDN_URL="https://antifilter.download/list/domains.lst"
|
export AF_FQDN_URL="https://antifilter.download/list/domains.lst"
|
||||||
export AF_ENCODING=""
|
export AF_ENCODING=""
|
||||||
## fz
|
## fz
|
||||||
@@ -21,13 +24,17 @@ case "$BLLIST_PRESET" in
|
|||||||
zapret-info-ip)
|
zapret-info-ip)
|
||||||
### Источник для обновления списка блокировок (zapret-info, rublacklist, antifilter, fz, ruantiblock)
|
### Источник для обновления списка блокировок (zapret-info, rublacklist, antifilter, fz, ruantiblock)
|
||||||
export BLLIST_SOURCE="zapret-info"
|
export BLLIST_SOURCE="zapret-info"
|
||||||
### Режим обхода блокировок: ip, fqdn
|
### Режим обхода блокировок: ip, fqdn, fqdn-only
|
||||||
export BLLIST_MODE="ip"
|
export BLLIST_MODE="ip"
|
||||||
;;
|
;;
|
||||||
zapret-info-fqdn)
|
zapret-info-fqdn)
|
||||||
export BLLIST_SOURCE="zapret-info"
|
export BLLIST_SOURCE="zapret-info"
|
||||||
export BLLIST_MODE="fqdn"
|
export BLLIST_MODE="fqdn"
|
||||||
;;
|
;;
|
||||||
|
zapret-info-fqdn-only)
|
||||||
|
export BLLIST_SOURCE="zapret-info"
|
||||||
|
export BLLIST_MODE="fqdn-only"
|
||||||
|
;;
|
||||||
rublacklist-ip)
|
rublacklist-ip)
|
||||||
export BLLIST_SOURCE="rublacklist"
|
export BLLIST_SOURCE="rublacklist"
|
||||||
export BLLIST_MODE="ip"
|
export BLLIST_MODE="ip"
|
||||||
@@ -36,10 +43,22 @@ case "$BLLIST_PRESET" in
|
|||||||
export BLLIST_SOURCE="rublacklist"
|
export BLLIST_SOURCE="rublacklist"
|
||||||
export BLLIST_MODE="fqdn"
|
export BLLIST_MODE="fqdn"
|
||||||
;;
|
;;
|
||||||
|
rublacklist-fqdn-only)
|
||||||
|
export BLLIST_SOURCE="rublacklist"
|
||||||
|
export BLLIST_MODE="fqdn-only"
|
||||||
|
;;
|
||||||
antifilter-ip)
|
antifilter-ip)
|
||||||
export BLLIST_SOURCE="antifilter"
|
export BLLIST_SOURCE="antifilter"
|
||||||
export BLLIST_MODE="ip"
|
export BLLIST_MODE="ip"
|
||||||
;;
|
;;
|
||||||
|
antifilter-fqdn)
|
||||||
|
export BLLIST_SOURCE="antifilter"
|
||||||
|
export BLLIST_MODE="fqdn"
|
||||||
|
;;
|
||||||
|
antifilter-fqdn-only)
|
||||||
|
export BLLIST_SOURCE="antifilter"
|
||||||
|
export BLLIST_MODE="fqdn-only"
|
||||||
|
;;
|
||||||
fz-ip)
|
fz-ip)
|
||||||
export BLLIST_SOURCE="fz"
|
export BLLIST_SOURCE="fz"
|
||||||
export BLLIST_MODE="ip"
|
export BLLIST_MODE="ip"
|
||||||
@@ -48,6 +67,10 @@ case "$BLLIST_PRESET" in
|
|||||||
export BLLIST_SOURCE="fz"
|
export BLLIST_SOURCE="fz"
|
||||||
export BLLIST_MODE="fqdn"
|
export BLLIST_MODE="fqdn"
|
||||||
;;
|
;;
|
||||||
|
fz-fqdn-only)
|
||||||
|
export BLLIST_SOURCE="fz"
|
||||||
|
export BLLIST_MODE="fqdn-only"
|
||||||
|
;;
|
||||||
ruantiblock-ip)
|
ruantiblock-ip)
|
||||||
export BLLIST_SOURCE="ruantiblock"
|
export BLLIST_SOURCE="ruantiblock"
|
||||||
export BLLIST_MODE="ip"
|
export BLLIST_MODE="ip"
|
||||||
|
|||||||
Reference in New Issue
Block a user