v0.9.4. Short names for ipsets

This commit is contained in:
gSpot
2022-05-10 20:37:10 +03:00
parent 2cc644f003
commit 6c68144ca7
11 changed files with 27 additions and 27 deletions
+3 -3
View File
@@ -8,9 +8,9 @@ LUA_MODULE=1
LUCI_APP=1 LUCI_APP=1
OWRT_VERSION="current" OWRT_VERSION="current"
RUAB_VERSION="0.9.3-0" RUAB_VERSION="0.9.4-0"
RUAB_MOD_LUA_VERSION="0.9.3-0" RUAB_MOD_LUA_VERSION="0.9.4-0"
RUAB_LUCI_APP_VERSION="0.9.3-0" RUAB_LUCI_APP_VERSION="0.9.4-0"
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"
+1 -1
View File
@@ -4,7 +4,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_VERSION:=0.9.3-0 PKG_VERSION:=0.9.4-0
LUCI_TITLE:=LuCI support for ruantiblock LUCI_TITLE:=LuCI support for ruantiblock
LUCI_DEPENDS:=+ruantiblock LUCI_DEPENDS:=+ruantiblock
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
@@ -113,18 +113,18 @@ return view.extend({
'id': 'last_blacklist_update.date' }, 'id': 'last_blacklist_update.date' },
data.last_blacklist_update.date), data.last_blacklist_update.date),
]), ]),
E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left' }, 'IP:'),
E('td', { 'class': 'td left',
'id': 'last_blacklist_update.ip' },
data.last_blacklist_update.ip),
]),
E('tr', { 'class': 'tr' }, [ E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left' }, 'CIDR:'), E('td', { 'class': 'td left' }, 'CIDR:'),
E('td', { 'class': 'td left', E('td', { 'class': 'td left',
'id': 'last_blacklist_update.cidr' }, 'id': 'last_blacklist_update.cidr' },
data.last_blacklist_update.cidr), data.last_blacklist_update.cidr),
]), ]),
E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left' }, 'IP:'),
E('td', { 'class': 'td left',
'id': 'last_blacklist_update.ip' },
data.last_blacklist_update.ip),
]),
E('tr', { 'class': 'tr' }, [ E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td left' }, 'FQDN:'), E('td', { 'class': 'td left' }, 'FQDN:'),
E('td', { 'class': 'td left', E('td', { 'class': 'td left',
+1 -1
View File
@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-lua PKG_NAME:=ruantiblock-mod-lua
PKG_VERSION:=0.9.3 PKG_VERSION:=0.9.4
PKG_RELEASE:=0 PKG_RELEASE:=0
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
@@ -412,7 +412,7 @@ end
function BlackListParser:write_update_status() function BlackListParser:write_update_status()
local file_handler = assert(io.open(self.UPDATE_STATUS_FILE, "w"), "Could not open 'update_status' file") local file_handler = assert(io.open(self.UPDATE_STATUS_FILE, "w"), "Could not open 'update_status' file")
file_handler:write(string.format("%d %d %d", self.ip_records_count, self.cidr_count, self.fqdn_records_count)) file_handler:write(string.format("%d %d %d", self.cidr_count, self.ip_records_count, self.fqdn_records_count))
file_handler:close() file_handler:close()
end end
+1 -1
View File
@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock-mod-py PKG_NAME:=ruantiblock-mod-py
PKG_VERSION:=0.9.3 PKG_VERSION:=0.9.4
PKG_RELEASE:=0 PKG_RELEASE:=0
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
@@ -503,7 +503,7 @@ class WriteConfigFiles(Config):
def write_update_status_file(self, ip_count, cidr_count, output_fqdn_count): def write_update_status_file(self, ip_count, cidr_count, output_fqdn_count):
with open(self.UPDATE_STATUS_FILE, "wt") as file_handler: with open(self.UPDATE_STATUS_FILE, "wt") as file_handler:
file_handler.write( file_handler.write(
f"{ip_count} {cidr_count} {output_fqdn_count}") f"{cidr_count} {ip_count} {output_fqdn_count}")
if __name__ == "__main__": if __name__ == "__main__":
+1 -1
View File
@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=ruantiblock PKG_NAME:=ruantiblock
PKG_VERSION:=0.9.3 PKG_VERSION:=0.9.4
PKG_RELEASE:=0 PKG_RELEASE:=0
PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt> PKG_MAINTAINER:=gSpot <https://github.com/gSpotx2f/ruantiblock_openwrt>
@@ -7,7 +7,7 @@ Info() {
if(NF < 4) if(NF < 4)
print "\"status\":false"; print "\"status\":false";
else else
print "\"status\":true,\"date\":\""$4"\",\"ip\":\""$1"\",\"cidr\":\""$2"\",\"fqdn\":\""$3"\""; print "\"status\":true,\"date\":\""$4"\",\"cidr\":\""$1"\",\"ip\":\""$2"\",\"fqdn\":\""$3"\"";
}' "$UPDATE_STATUS_FILE" }' "$UPDATE_STATUS_FILE"
else else
printf "\"status\":false" printf "\"status\":false"
@@ -25,7 +25,7 @@ Info() {
printf "\"_dummy\":false},"; printf "\"_dummy\":false},";
}' }'
printf "\"ipset\":{"; printf "\"ipset\":{";
for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_ONION" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ"
do do
$IPSET_CMD list "$_set" -terse | $AWK_CMD -F ": " ' $IPSET_CMD list "$_set" -terse | $AWK_CMD -F ": " '
{ {
+10 -10
View File
@@ -185,13 +185,13 @@ if [ $ENABLE_LOGGING = "1" -a $? -ne 0 ]; then
fi fi
LOGGER_PARAMS="-t `basename $0` -p user.notice" LOGGER_PARAMS="-t `basename $0` -p user.notice"
export IP_DATA_FILE="${DATA_DIR}/${NAME}.ip" export IP_DATA_FILE="${DATA_DIR}/${NAME}.ip"
export IPSET_ALLOWED_HOSTS="${NAME}_allowed_ip" export IPSET_ALLOWED_HOSTS="r_allowed_ip"
export IPSET_IP="${NAME}_ip" export IPSET_ONION="r_onion"
export IPSET_IP_TMP="${IPSET_IP}_tmp" export IPSET_CIDR="rc"
export IPSET_CIDR="${NAME}_cidr" export IPSET_CIDR_TMP="${IPSET_CIDR}t"
export IPSET_CIDR_TMP="${IPSET_CIDR}_tmp" export IPSET_IP="ri"
export IPSET_DNSMASQ="${NAME}_dnsmasq" export IPSET_IP_TMP="${IPSET_IP}t"
export IPSET_ONION="${NAME}_onion" export IPSET_DNSMASQ="rd"
export UPDATE_STATUS_FILE="${DATA_DIR}/update_status" export UPDATE_STATUS_FILE="${DATA_DIR}/update_status"
UPDATE_PID_FILE="/var/run/${NAME}_update.pid" UPDATE_PID_FILE="/var/run/${NAME}_update.pid"
START_PID_FILE="/var/run/${NAME}_start.pid" START_PID_FILE="/var/run/${NAME}_start.pid"
@@ -422,7 +422,7 @@ GetDataFiles() {
AddUserEntries AddUserEntries
if [ $_return_code -eq 0 ]; then if [ $_return_code -eq 0 ]; then
_update_string=`$AWK_CMD '{ _update_string=`$AWK_CMD '{
printf "Received entries: %s\n", (NF < 3) ? "No data" : "IP: "$1", CIDR: "$2", FQDN: "$3; printf "Received entries: %s\n", (NF < 3) ? "No data" : "CIDR: "$1", IP: "$2", FQDN: "$3;
exit; exit;
}' "$UPDATE_STATUS_FILE"` }' "$UPDATE_STATUS_FILE"`
### STDOUT ### STDOUT
@@ -564,7 +564,7 @@ Status() {
printf "\n \033[1m${NAME} status\033[m: \033[1;32mEnabled\033[m\n\n PROXY_MODE: ${PROXY_MODE}\n PROXY_LOCAL_CLIENTS: ${PROXY_LOCAL_CLIENTS}\n BLLIST_MODULE: ${BLLIST_MODULE}\n" printf "\n \033[1m${NAME} status\033[m: \033[1;32mEnabled\033[m\n\n PROXY_MODE: ${PROXY_MODE}\n PROXY_LOCAL_CLIENTS: ${PROXY_LOCAL_CLIENTS}\n BLLIST_MODULE: ${BLLIST_MODULE}\n"
if [ -f "$UPDATE_STATUS_FILE" ]; then if [ -f "$UPDATE_STATUS_FILE" ]; then
$AWK_CMD '{ $AWK_CMD '{
update_string=(NF < 4) ? "No data" : $4" (IP: "$1" | CIDR: "$2" | FQDN: "$3")"; update_string=(NF < 4) ? "No data" : $4" (CIDR: "$1" | IP: "$2" | FQDN: "$3")";
printf "\n Last blacklist update: %s\n", update_string; printf "\n Last blacklist update: %s\n", update_string;
}' "$UPDATE_STATUS_FILE" }' "$UPDATE_STATUS_FILE"
else else
@@ -581,7 +581,7 @@ Status() {
}; };
}' }'
printf " \033[4mIp sets\033[m:\n\n" printf " \033[4mIp sets\033[m:\n\n"
for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ" "$IPSET_ONION" for _set in "$IPSET_ALLOWED_HOSTS" "$IPSET_ONION" "$IPSET_CIDR_TMP" "$IPSET_CIDR" "$IPSET_IP_TMP" "$IPSET_IP" "$IPSET_DNSMASQ"
do do
$IPSET_CMD list "$_set" -terse | $AWK_CMD -F ":" ' $IPSET_CMD list "$_set" -terse | $AWK_CMD -F ":" '
{ {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 136 KiB