diff --git a/linkease-common-bin/Makefile b/linkease-common-bin/Makefile index c3c9ac9dd..a33ef1cee 100644 --- a/linkease-common-bin/Makefile +++ b/linkease-common-bin/Makefile @@ -12,7 +12,7 @@ PKG_ARCH_LINKEASE:=$(ARCH) PKG_NAME:=linkease-common-bin # use PKG_SOURCE_DATE instead of PKG_VERSION for compitable PKG_SOURCE_DATE:=1.7.5 -PKG_RELEASE:=3 +PKG_RELEASE:=4 ARCH_HEXCODE:= ifeq ($(ARCH),x86_64) @@ -28,7 +28,7 @@ else ifeq ($(ARCH),mipsel) ARCH_HEXCODE=1b0c endif -PKG_SOURCE_VERSION:=8895348606dc6cab9b25a75576e5142f553dfa82 +PKG_SOURCE_VERSION:=b5383a43aa18185cc32c759d2b8536c235fe54aa PKG_SOURCE:=linkease-common-bin-$(PKG_SOURCE_DATE)-linux-$(PKG_ARCH_LINKEASE).tar.gz PKG_SOURCE_URL:=https://github.com/istoreos/istoreos-app-hub/releases/download/linkease-runtime-v$(PKG_SOURCE_DATE)/ PKG_BUILD_DIR:=$(BUILD_DIR)/linkease-common-bin-$(PKG_SOURCE_DATE)-linux-$(PKG_ARCH_LINKEASE) @@ -59,10 +59,11 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/uci-defaults $(INSTALL_BIN) $(PKG_BUILD_DIR)/heif-converter $(1)/usr/sbin/heif-converter $(INSTALL_BIN) $(PKG_BUILD_DIR)/linkease-media $(1)/usr/sbin/linkease-media $(INSTALL_BIN) ./files/linkease-config.sh $(1)/usr/sbin/linkease-config.sh + $(INSTALL_BIN) ./files/linkease-fw.uci-default $(1)/etc/uci-defaults/linkease-fw endef $(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/linkease-common-bin/files/linkease-fw.uci-default b/linkease-common-bin/files/linkease-fw.uci-default new file mode 100755 index 000000000..0aa409b4a --- /dev/null +++ b/linkease-common-bin/files/linkease-fw.uci-default @@ -0,0 +1,16 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete firewall.linkease + set firewall.linkease=rule + set firewall.linkease.name="linkease" + set firewall.linkease.target="ACCEPT" + set firewall.linkease.src="wan" + set firewall.linkease.proto="tcp" + set firewall.linkease.dest_port="8897" + commit firewall +EOF + +/etc/init.d/firewall reload 2>/dev/null + +exit 0 diff --git a/linkease/Makefile b/linkease/Makefile index d7cc56c3e..cd0628233 100644 --- a/linkease/Makefile +++ b/linkease/Makefile @@ -12,7 +12,7 @@ PKG_ARCH_LINKEASE:=$(ARCH) PKG_NAME:=linkease # use PKG_SOURCE_DATE instead of PKG_VERSION for compitable PKG_SOURCE_DATE:=1.7.5 -PKG_RELEASE:=6 +PKG_RELEASE:=7 ARCH_HEXCODE:= ifeq ($(ARCH),x86_64) @@ -28,7 +28,7 @@ else ifeq ($(ARCH),mipsel) ARCH_HEXCODE=1b0c endif -PKG_SOURCE_VERSION:=8895348606dc6cab9b25a75576e5142f553dfa82 +PKG_SOURCE_VERSION:=b5383a43aa18185cc32c759d2b8536c235fe54aa PKG_SOURCE:=linkease-bin-$(PKG_SOURCE_DATE)-linux-$(PKG_ARCH_LINKEASE).tar.gz PKG_SOURCE_URL:=https://github.com/istoreos/istoreos-app-hub/releases/download/linkease-runtime-v$(PKG_SOURCE_DATE)/ PKG_BUILD_DIR:=$(BUILD_DIR)/linkease-bin-$(PKG_SOURCE_DATE)-linux-$(PKG_ARCH_LINKEASE) diff --git a/linkease/files/linkease-config.sh b/linkease/files/linkease-config.sh deleted file mode 100644 index 62015a855..000000000 --- a/linkease/files/linkease-config.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh - -case "$1" in - save) - if [ ! -z "$2" ]; then - uci set "linkease.@linkease[0].preconfig=$2" - uci commit - fi - ;; - - load) - if [ -f "/usr/sbin/preconfig.data" ]; then - data="`cat /usr/sbin/preconfig.data`" - uci set "linkease.@linkease[0].preconfig=${data}" - uci commit - rm /usr/sbin/preconfig.data - else - data="`uci -q get linkease.@linkease[0].preconfig`" - fi - - if [ -z "${data}" ]; then - echo "nil" - else - echo "${data}" - fi - - ;; - - local_save) - if [ ! -z "$2" ]; then - uci set "linkease.@linkease[0].local_home=$2" - uci commit - ROOT_DIR="$2" - if [ -f "/etc/config/quickstart" ]; then - config_load quickstart - config_get MAIN_DIR main main_dir "" - config_get CONF_DIR main conf_dir "" - config_get PUB_DIR main pub_dir "" - config_get DL_DIR main dl_dir "" - config_get TMP_DIR main tmp_dir "" - if [ "$ROOT_DIR" = "$MAIN_DIR" ]; then - exit 0 - fi - uci set "quickstart.main.main_dir=$ROOT_DIR" - if [ -z "$CONF_DIR" -o "$CONF_DIR" = "$MAIN_DIR/Configs" ]; then - uci set "quickstart.main.conf_dir=$ROOT_DIR/Configs" - fi - if [ -z "$PUB_DIR" -o "$PUB_DIR" = "$MAIN_DIR/Public" ]; then - uci set "quickstart.main.pub_dir=$ROOT_DIR/Public" - fi - if [ -z "$DL_DIR" -o "$DL_DIR" = "$MAIN_DIR/Public/Downloads" ]; then - uci set "quickstart.main.dl_dir=$ROOT_DIR/Public/Downloads" - fi - if [ -z "$TMP_DIR" -o "$TMP_DIR" = "$MAIN_DIR/Caches" ]; then - uci set "quickstart.main.tmp_dir=$ROOT_DIR/Caches" - fi - uci commit - fi - fi - ;; - - local_load) - if [ -f "/etc/config/quickstart" ]; then - data="`uci -q get quickstart.main.main_dir`" - fi - if [ -z "$data" ]; then - data="`uci -q get linkease.@linkease[0].local_home`" - fi - - if [ -z "${data}" ]; then - echo "nil" - else - echo "${data}" - fi - - ;; - - status) - echo "TODO" - ;; - - *) - echo "Usage: $0 {save|load|local_save|local_load|status}" - exit 1 -esac diff --git a/linkease/files/linkease.uci-default b/linkease/files/linkease.uci-default index 225dd09e7..fa5e6146b 100644 --- a/linkease/files/linkease.uci-default +++ b/linkease/files/linkease.uci-default @@ -24,9 +24,6 @@ set_default enabled 1 set_default port 8897 set_default allowPublic 0 uci -q commit linkease -port="$(uci -q get linkease.@linkease[0].port 2>/dev/null || true)" -[ -n "$port" ] || port=8897 -allow_public="$(uci -q get linkease.@linkease[0].allowPublic 2>/dev/null || true)" uci -q batch <<-EOF >/dev/null delete ucitrack.@linkease[-1] @@ -35,25 +32,6 @@ uci -q batch <<-EOF >/dev/null commit ucitrack EOF -if [ "$allow_public" = "1" ]; then - uci -q batch <<-EOF >/dev/null - delete firewall.linkease - set firewall.linkease=rule - set firewall.linkease.name="linkease" - set firewall.linkease.target="ACCEPT" - set firewall.linkease.src="wan" - set firewall.linkease.proto="tcp" - set firewall.linkease.dest_port="$port" - commit firewall -EOF -else - uci -q batch <<-EOF >/dev/null - delete firewall.linkease - commit firewall -EOF -fi - /etc/init.d/linkease enable -/etc/init.d/linkease restart exit 0 diff --git a/linkeasefull/Makefile b/linkeasefull/Makefile index 469889179..4f163abf1 100644 --- a/linkeasefull/Makefile +++ b/linkeasefull/Makefile @@ -11,7 +11,7 @@ PKG_ARCH_LINKEASE:=$(ARCH) PKG_NAME:=linkeasefull # use PKG_SOURCE_DATE instead of PKG_VERSION for compitable PKG_SOURCE_DATE:=3.0.5 -PKG_RELEASE:=5 +PKG_RELEASE:=6 ARCH_HEXCODE:= ifeq ($(ARCH),x86_64) @@ -24,7 +24,7 @@ LINKEASE_RUNTIME_ARCH:=arm64 PKG_HASH:=skip endif -PKG_SOURCE_VERSION:=8895348606dc6cab9b25a75576e5142f553dfa82 +PKG_SOURCE_VERSION:=b5383a43aa18185cc32c759d2b8536c235fe54aa PKG_SOURCE:=linkease-runtime-$(PKG_SOURCE_DATE)-linux-$(LINKEASE_RUNTIME_ARCH).tar.gz PKG_SOURCE_URL:=https://github.com/istoreos/istoreos-app-hub/releases/download/linkeasefull-runtime-v$(PKG_SOURCE_DATE)/ PKG_BUILD_DIR:=$(BUILD_DIR)/linkease-runtime-$(PKG_SOURCE_DATE)-linux-$(LINKEASE_RUNTIME_ARCH) diff --git a/luci-app-daede/Makefile b/luci-app-daede/Makefile index 1ed00e196..7b3235639 100644 --- a/luci-app-daede/Makefile +++ b/luci-app-daede/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-daede PKG_VERSION:=1.14.7 -PKG_RELEASE:=38 +PKG_RELEASE:=39 PKG_MAINTAINER:=kenzok8 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/luci-app-daede/htdocs/luci-static/resources/view/daede/dae.js b/luci-app-daede/htdocs/luci-static/resources/view/daede/dae.js index 03e851401..c32f42ca7 100644 --- a/luci-app-daede/htdocs/luci-static/resources/view/daede/dae.js +++ b/luci-app-daede/htdocs/luci-static/resources/view/daede/dae.js @@ -429,6 +429,7 @@ function renderDaeForms(ctx) { .finally(function() { restoreLiveAccordions(); btns.forEach(function(b) { b.disabled = false; }); + window.setTimeout(function() { ui.changes.init(); }, 1800); }); } diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 7ba8a155f..e538f5774 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.8.1 -PKG_RELEASE:=203 +PKG_RELEASE:=204 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua index 8a4c2769c..6ad220eed 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua @@ -34,6 +34,10 @@ local tmp_lines = {} local USE_GEOVIEW = uci:get(appname, "@global_rules[0]", "enable_geoview") local IS_SHUNT_NODE = uci:get(appname, TCP_NODE, "protocol") == "_shunt" +if not api.is_finded("geoview") then + USE_GEOVIEW = "0" +end + local function log(...) if NO_LOGIC_LOG == "1" then return @@ -128,16 +132,20 @@ local file_block_host = TMP_ACL_PATH .. "/block_host" if USE_BLOCK_LIST == "1" and not fs.access(file_block_host) then local block_domain, lookup_block_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/block_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(block_domain, line, lookup_block_domain) + local f = io.open(RULES_PATH .. "/block_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(block_domain, line, lookup_block_domain) + end end end + f:close() end if #block_domain > 0 then local f_out = io.open(file_block_host, "w") @@ -146,11 +154,11 @@ if USE_BLOCK_LIST == "1" and not fs.access(file_block_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_block_host) == 0 then - log(" * 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)完成") + log(" - 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)完成") else - log(" * 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)失败!") + log(" - 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)失败!") end end end @@ -211,16 +219,20 @@ local file_direct_host = TMP_ACL_PATH .. "/direct_host" if USE_DIRECT_LIST == "1" and not fs.access(file_direct_host) then local direct_domain, lookup_direct_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/direct_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(direct_domain, line, lookup_direct_domain) + local f = io.open(RULES_PATH .. "/direct_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(direct_domain, line, lookup_direct_domain) + end end end + f:close() end if #direct_domain > 0 then local f_out = io.open(file_direct_host, "w") @@ -229,11 +241,11 @@ if USE_DIRECT_LIST == "1" and not fs.access(file_direct_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_direct_host) == 0 then - log(" * 解析[直连列表] Geosite 到域名白名单(whitelist)完成") + log(" - 解析[直连列表] Geosite 到域名白名单(whitelist)完成") else - log(" * 解析[直连列表] Geosite 到域名白名单(whitelist)失败!") + log(" - 解析[直连列表] Geosite 到域名白名单(whitelist)失败!") end end end @@ -257,16 +269,20 @@ local file_proxy_host = TMP_ACL_PATH .. "/proxy_host" if USE_PROXY_LIST == "1" and not fs.access(file_proxy_host) then local proxy_domain, lookup_proxy_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/proxy_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(proxy_domain, line, lookup_proxy_domain) + local f = io.open(RULES_PATH .. "/proxy_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(proxy_domain, line, lookup_proxy_domain) + end end end + f:close() end if #proxy_domain > 0 then local f_out = io.open(file_proxy_host, "w") @@ -275,11 +291,11 @@ if USE_PROXY_LIST == "1" and not fs.access(file_proxy_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_proxy_host) == 0 then - log(" * 解析[代理列表] Geosite 到代理域名表(blacklist)完成") + log(" - 解析[代理列表] Geosite 到代理域名表(blacklist)完成") else - log(" * 解析[代理列表] Geosite 到代理域名表(blacklist)失败!") + log(" - 解析[代理列表] Geosite 到代理域名表(blacklist)失败!") end end end @@ -432,7 +448,7 @@ if IS_SHUNT_NODE then end end - if GFWLIST == "1" and CHNLIST == "0" and USE_GEOVIEW == "1" and api.is_finded("geoview") then --仅GFW模式解析geosite + if GFWLIST == "1" and CHNLIST == "0" and USE_GEOVIEW == "1" then --仅GFW模式解析geosite local return_white, return_shunt if geosite_white_arg ~= "" then return_white = get_geosite(geosite_white_arg, file_white_host) @@ -441,9 +457,9 @@ if IS_SHUNT_NODE then return_shunt = get_geosite(geosite_shunt_arg, file_shunt_host) end if (return_white == nil or return_white == 0) and (return_shunt == nil or return_shunt == 0) then - log(" * 解析[分流节点] Geosite 完成") + log(" - 解析[分流节点] Geosite 完成") else - log(" * 解析[分流节点] Geosite 失败!") + log(" - 解析[分流节点] Geosite 失败!") end end diff --git a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua index 0571b8320..b96d27fe5 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua @@ -346,14 +346,16 @@ function add_rule(var) fs.mkdir(CACHE_DNS_PATH) --屏蔽列表 - if USE_CHINADNS_NG == "0" then - if USE_BLOCK_LIST == "1" then - for line in io.lines("/usr/share/passwall/rules/block_host") do + if USE_CHINADNS_NG == "0" and USE_BLOCK_LIST == "1" then + local f = io.open("/usr/share/passwall/rules/block_host") + if f then + for line in f:lines() do line = api.get_std_domain(line) if line ~= "" and not line:find("#") and not line:find(":") then set_domain_address(line, "") end end + f:close() end end diff --git a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua index e3a0ef20c..4011fc09c 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua @@ -40,6 +40,10 @@ local tmp_lines = {} local USE_GEOVIEW = uci:get(appname, "@global_rules[0]", "enable_geoview") local IS_SHUNT_NODE = uci:get(appname, TCP_NODE, "protocol") == "_shunt" +if not api.is_finded("geoview") then + USE_GEOVIEW = "0" +end + local function log(...) if NO_LOGIC_LOG == "1" then return @@ -286,16 +290,20 @@ local file_block_host = TMP_ACL_PATH .. "/block_host" if USE_BLOCK_LIST == "1" and not fs.access(file_block_host) then local block_domain, lookup_block_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/block_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(block_domain, line, lookup_block_domain) + local f = io.open(RULES_PATH .. "/block_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(block_domain, line, lookup_block_domain) + end end end + f:close() end if #block_domain > 0 then local f_out = io.open(file_block_host, "w") @@ -304,11 +312,11 @@ if USE_BLOCK_LIST == "1" and not fs.access(file_block_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_block_host) == 0 then - log(" * 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)完成") + log(" - 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)完成") else - log(" * 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)失败!") + log(" - 解析[屏蔽列表] Geosite 到屏蔽域名表(blocklist)失败!") end end end @@ -372,16 +380,20 @@ local file_direct_host = TMP_ACL_PATH .. "/direct_host" if USE_DIRECT_LIST == "1" and not fs.access(file_direct_host) then local direct_domain, lookup_direct_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/direct_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(direct_domain, line, lookup_direct_domain) + local f = io.open(RULES_PATH .. "/direct_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(direct_domain, line, lookup_direct_domain) + end end end + f:close() end if #direct_domain > 0 then local f_out = io.open(file_direct_host, "w") @@ -390,11 +402,11 @@ if USE_DIRECT_LIST == "1" and not fs.access(file_direct_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_direct_host) == 0 then - log(" * 解析[直连列表] Geosite 到域名白名单(whitelist)完成") + log(" - 解析[直连列表] Geosite 到域名白名单(whitelist)完成") else - log(" * 解析[直连列表] Geosite 到域名白名单(whitelist)失败!") + log(" - 解析[直连列表] Geosite 到域名白名单(whitelist)失败!") end end end @@ -420,16 +432,20 @@ local file_proxy_host = TMP_ACL_PATH .. "/proxy_host" if USE_PROXY_LIST == "1" and not fs.access(file_proxy_host) then local proxy_domain, lookup_proxy_domain = {}, {} local geosite_arg = "" - for line in io.lines(RULES_PATH .. "/proxy_host") do - if not line:find("#") and line:find("geosite:") then - line = string.match(line, ":([^:]+)$") - geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line - else - line = api.get_std_domain(line) - if line ~= "" and not line:find("#") then - insert_unique(proxy_domain, line, lookup_proxy_domain) + local f = io.open(RULES_PATH .. "/proxy_host") + if f then + for line in f:lines() do + if not line:find("#") and line:find("geosite:") then + line = string.match(line, ":([^:]+)$") + geosite_arg = geosite_arg .. (geosite_arg ~= "" and "," or "") .. line + else + line = api.get_std_domain(line) + if line ~= "" and not line:find("#") then + insert_unique(proxy_domain, line, lookup_proxy_domain) + end end end + f:close() end if #proxy_domain > 0 then local f_out = io.open(file_proxy_host, "w") @@ -438,11 +454,11 @@ if USE_PROXY_LIST == "1" and not fs.access(file_proxy_host) then end f_out:close() end - if USE_GEOVIEW == "1" and geosite_arg ~= "" and api.is_finded("geoview") then + if USE_GEOVIEW == "1" and geosite_arg ~= "" then if get_geosite(geosite_arg, file_proxy_host) == 0 then - log(" * 解析[代理列表] Geosite 到代理域名表(blacklist)完成") + log(" - 解析[代理列表] Geosite 到代理域名表(blacklist)完成") else - log(" * 解析[代理列表] Geosite 到代理域名表(blacklist)失败!") + log(" - 解析[代理列表] Geosite 到代理域名表(blacklist)失败!") end end end @@ -600,7 +616,7 @@ if IS_SHUNT_NODE then end end - if USE_GFW_LIST == "1" and CHN_LIST == "0" and USE_GEOVIEW == "1" and api.is_finded("geoview") then --仅GFW模式解析geosite + if USE_GFW_LIST == "1" and CHN_LIST == "0" and USE_GEOVIEW == "1" then --仅GFW模式解析geosite local return_white, return_shunt if geosite_white_arg ~= "" then return_white = get_geosite(geosite_white_arg, file_white_host) @@ -609,9 +625,9 @@ if IS_SHUNT_NODE then return_shunt = get_geosite(geosite_shunt_arg, file_shunt_host) end if (return_white == nil or return_white == 0) and (return_shunt == nil or return_shunt == 0) then - log(" * 解析[分流节点] Geosite 完成") + log(" - 解析[分流节点] Geosite 完成") else - log(" * 解析[分流节点] Geosite 失败!") + log(" - 解析[分流节点] Geosite 失败!") end end diff --git a/natflow/Makefile b/natflow/Makefile index 561b319e3..d598b8430 100644 --- a/natflow/Makefile +++ b/natflow/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=natflow PKG_VERSION:=20260531 -PKG_RELEASE:=61 +PKG_RELEASE:=62 PKG_SOURCE:=$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ptpt52/natflow.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=4e62e176dee1ee5d2bea09c40f5d515d6b8a3655 +PKG_SOURCE_VERSION:=00be1cea6bcdaf0d8e79b62dff533f08f49863e8 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Chen Minqiang PKG_LICENSE:=GPL-2.0