diff --git a/luci-app-flowproxy/Makefile b/luci-app-flowproxy/Makefile index 76d0db09e..91c9427a5 100644 --- a/luci-app-flowproxy/Makefile +++ b/luci-app-flowproxy/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-flowproxy PKG_VERSION:=1.0.3 -PKG_RELEASE:=8 +PKG_RELEASE:=9 LUCI_TITLE:=LuCI Support for FlowProxy Traffic Diversion LUCI_DEPENDS:=+luci-base +nftables +ip-full +iputils-arping diff --git a/luci-app-flowproxy/htdocs/luci-static/resources/view/flowproxy/flowproxy.js b/luci-app-flowproxy/htdocs/luci-static/resources/view/flowproxy/flowproxy.js index 7df7819f6..600e86909 100644 --- a/luci-app-flowproxy/htdocs/luci-static/resources/view/flowproxy/flowproxy.js +++ b/luci-app-flowproxy/htdocs/luci-static/resources/view/flowproxy/flowproxy.js @@ -114,7 +114,7 @@ return L.view.extend({ var dcontent = []; if (status.dns_running == 1) { var ip = status.proxy_server_ip_addr || '-'; - var port = status.proxy_server_dns_port || '5353'; + var port = status.proxy_server_dns_port || '53'; dcontent.push(E('span', { 'style': 'color: green; font-weight: bold;' }, [ _('running') ])); dcontent.push(' (' + ip + ':'); dcontent.push(E('span', { 'style': 'color: #FF9800; font-weight: bold;' }, [ port ])); @@ -124,6 +124,26 @@ return L.view.extend({ } L.dom.content(dnsEl, dcontent); } + + var wdEl = container.querySelector('#watchdog-status'); + if (wdEl) { + var wcontent = []; + if (status.monitor_enabled != 1) { + wcontent.push(E('span', { 'style': 'color: #888;' }, [ _('not enabled') ])); + } else if (!isRunning) { + wcontent.push(E('span', { 'style': 'color: red; font-weight: bold;' }, [ _('stopped') ])); + } else if (status.watchdog_running == 1 && isDegraded) { + wcontent.push(E('span', { 'style': 'color: #FF9800; font-weight: bold;' }, [ _('running - degraded direct fallback') ])); + } else if (status.watchdog_running == 1) { + var wip = status.proxy_server_ip_addr || '-'; + var interval = status.monitor_interval || 5; + wcontent.push(E('span', { 'style': 'color: green; font-weight: bold;' }, [ _('running') ])); + wcontent.push(' (' + wip + ' / ' + interval + 's)'); + } else { + wcontent.push(E('span', { 'style': 'color: red; font-weight: bold;' }, [ _('not running') ])); + } + L.dom.content(wdEl, wcontent); + } }, this)); }, @@ -194,6 +214,10 @@ return L.view.extend({ o.rawhtml = true; o.cfgvalue = function() { return '
-
'; }; + o = s.taboption('settings', form.DummyValue, '_watchdog_status', _('Watchdog Status')); + o.rawhtml = true; + o.cfgvalue = function() { return '
-
'; }; + s.taboption('settings', form.Flag, 'enabled', _('Enable FlowProxy')).rmempty = false; s.taboption('settings', form.Flag, 'dns_proxy_enabled', _('Force upstream DNS to proxy server')).rmempty = false; o = s.taboption('settings', form.Flag, 'monitor_enabled', _('Enable proxy server monitoring')); @@ -319,7 +343,7 @@ return L.view.extend({ }; o = s.taboption('settings', form.Value, 'proxy_server_dns_port', _('Proxy server DNS port')); - o.datatype = 'port'; o.default = '5353'; o.rmempty = false; + o.datatype = 'port'; o.default = '53'; o.rmempty = false; o = s.taboption('settings', form.ListValue, 'interface', _('Proxy server interface')); o.value('auto', _('Auto detect')); diff --git a/luci-app-flowproxy/po/templates/flowproxy.pot b/luci-app-flowproxy/po/templates/flowproxy.pot index d1a3daa79..3eb1ae8fd 100644 --- a/luci-app-flowproxy/po/templates/flowproxy.pot +++ b/luci-app-flowproxy/po/templates/flowproxy.pot @@ -271,3 +271,15 @@ msgstr "" msgid "Auto detect" msgstr "" +msgid "Watchdog Status" +msgstr "" + +msgid "not enabled" +msgstr "" + +msgid "not running" +msgstr "" + +msgid "running - degraded direct fallback" +msgstr "" + diff --git a/luci-app-flowproxy/po/zh_Hans/flowproxy.po b/luci-app-flowproxy/po/zh_Hans/flowproxy.po index c43cfe214..111916dc6 100644 --- a/luci-app-flowproxy/po/zh_Hans/flowproxy.po +++ b/luci-app-flowproxy/po/zh_Hans/flowproxy.po @@ -271,3 +271,15 @@ msgstr "自动检测" msgid "The proxy server IP address must be within a local interface subnet (%s)." msgstr "代理服务器 IP 地址必须在本地网络接口的子网网段之内 (%s)。" +msgid "Watchdog Status" +msgstr "监控状态" + +msgid "not enabled" +msgstr "未启用" + +msgid "not running" +msgstr "未运行" + +msgid "running - degraded direct fallback" +msgstr "运行中 - 已降级直连" + diff --git a/luci-app-flowproxy/root/etc/config/flowproxy b/luci-app-flowproxy/root/etc/config/flowproxy index 0e16a7bdc..69cde7322 100644 --- a/luci-app-flowproxy/root/etc/config/flowproxy +++ b/luci-app-flowproxy/root/etc/config/flowproxy @@ -12,7 +12,7 @@ config flowproxy 'global' option monitor_interval '5' option monitor_fail_threshold '3' option monitor_recover_threshold '2' - option proxy_server_dns_port '5353' + option proxy_server_dns_port '53' option log_level 'info' option log_size '1024' option log_count '3' diff --git a/luci-app-flowproxy/root/etc/init.d/flowproxy b/luci-app-flowproxy/root/etc/init.d/flowproxy index a4d275603..3ef4db2c9 100755 --- a/luci-app-flowproxy/root/etc/init.d/flowproxy +++ b/luci-app-flowproxy/root/etc/init.d/flowproxy @@ -5,7 +5,10 @@ START=99 STOP=10 USE_PROCD=1 -. /usr/share/flowproxy/common.sh +# 离线镜像打包阶段(IPKG_INSTROOT 非空)仅执行 enable/disable,跳过加载运行时依赖 +if [ -z "$IPKG_INSTROOT" ]; then + . /usr/share/flowproxy/common.sh +fi _stop_unlocked() { local mode="$1" diff --git a/luci-app-flowproxy/root/usr/share/flowproxy/common.sh b/luci-app-flowproxy/root/usr/share/flowproxy/common.sh index 67bac1af0..a6701f323 100755 --- a/luci-app-flowproxy/root/usr/share/flowproxy/common.sh +++ b/luci-app-flowproxy/root/usr/share/flowproxy/common.sh @@ -506,7 +506,7 @@ _apply_dnsmasq_config() { setup_dns() { local enabled=$(uci -q get "$UCI_CONFIG.global.enabled") local dns_proxy_enabled=$(uci -q get "$UCI_CONFIG.global.dns_proxy_enabled") - local proxy_server_dns_port=$(uci -q get "$UCI_CONFIG.global.proxy_server_dns_port"); proxy_server_dns_port="${proxy_server_dns_port:-5353}" + local proxy_server_dns_port=$(uci -q get "$UCI_CONFIG.global.proxy_server_dns_port"); proxy_server_dns_port="${proxy_server_dns_port:-53}" local proxy_server_ip_addr=$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr") # Only apply DNS proxy if BOTH main service and DNS proxy are enabled diff --git a/luci-app-flowproxy/root/usr/share/rpcd/ucode/luci.flowproxy b/luci-app-flowproxy/root/usr/share/rpcd/ucode/luci.flowproxy index 04d0544c7..4b998c31d 100755 --- a/luci-app-flowproxy/root/usr/share/rpcd/ucode/luci.flowproxy +++ b/luci-app-flowproxy/root/usr/share/rpcd/ucode/luci.flowproxy @@ -93,10 +93,12 @@ const methods = { running: (real_running || degraded_active) ? 1 : 0, degraded: degraded_active, dns_running: dns_running, + watchdog_running: watchdog_running ? 1 : 0, enabled: int(uci_cursor.get(UCI_CONFIG, 'global', 'enabled') || '0'), monitor_enabled: monitor_enabled, + monitor_interval: int(uci_cursor.get(UCI_CONFIG, 'global', 'monitor_interval') || '5'), proxy_server_ip_addr: proxy_server_ip_addr, - proxy_server_dns_port: uci_cursor.get(UCI_CONFIG, 'global', 'proxy_server_dns_port') || '5353', + proxy_server_dns_port: uci_cursor.get(UCI_CONFIG, 'global', 'proxy_server_dns_port') || '53', lan_ip: safe_trim(lan_ip), interface: uci_cursor.get(UCI_CONFIG, 'global', 'interface') || 'auto', traffic_mark: uci_cursor.get(UCI_CONFIG, 'global', 'traffic_mark') || '0x666', diff --git a/luci-app-frpc-next/Makefile b/luci-app-frpc-next/Makefile index e27f6dc7d..191ba781b 100644 --- a/luci-app-frpc-next/Makefile +++ b/luci-app-frpc-next/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-frpc-next PKG_VERSION:=1.0.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=MIT PKG_MAINTAINER:=Dante @@ -10,7 +10,6 @@ PKG_MAINTAINER:=Dante LUCI_TITLE:=LuCI support for frp client (v0.68.x/v0.69.x+) LUCI_DEPENDS:=+frpc-next +curl LUCI_PKGARCH:=all -PKG_PROVIDES:=luci-app-frpc define Package/$(PKG_NAME)/postinst #!/bin/sh diff --git a/luci-app-ghfu/Makefile b/luci-app-ghfu/Makefile index c385c891f..3137f9742 100644 --- a/luci-app-ghfu/Makefile +++ b/luci-app-ghfu/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ghfu PKG_VERSION:=1.6.1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-3.0-only PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Kiddin' diff --git a/luci-app-ghfu/luasrc/controller/ghfu.lua b/luci-app-ghfu/luasrc/controller/ghfu.lua index 6b72b2b96..ec9e0b742 100644 --- a/luci-app-ghfu/luasrc/controller/ghfu.lua +++ b/luci-app-ghfu/luasrc/controller/ghfu.lua @@ -141,7 +141,17 @@ local function parse_version_token(ver_str) local epoch = os.time({ year = y, month = m, day = d, hour = 0, min = 0, sec = 0 }) or 0 return string.format("%02d.%02d.%04d", m, d, y), epoch, num_str, iso end - return ver_str, 0, ver_str, "" + local yyyy3, mm3, dd3 = ver_str:match("(20%d%d)(%d%d)(%d%d)") + if yyyy3 and mm3 and dd3 then + local y, m, d = tonumber(yyyy3), tonumber(mm3), tonumber(dd3) + if m >= 1 and m <= 12 and d >= 1 and d <= 31 then + local num_str = string.format("%04d%02d%02d", y, m, d) + local iso = string.format("%04d-%02d-%02dT00:00:00Z", y, m, d) + local epoch = os.time({ year = y, month = m, day = d, hour = 0, min = 0, sec = 0 }) or 0 + return string.format("%02d.%02d.%04d", m, d, y), epoch, num_str, iso + end + end + return "", 0, "", "" end local function normalize_date_str(date_str, filename) @@ -624,36 +634,6 @@ local function url_decode(s) end)) end -local function parse_version_txt(raw) - raw = trim(raw or "") - if raw == "" or raw:match("^= 2) and parts[#parts] or "0" - local now_ts = os.time() or 0 - local is_formal = (fnotice == "1") or (ver_epoch > 0 and (now_ts - 172800) > ver_epoch) - return { - version = ver_str, - epoch = ver_epoch, - ver_num = ver_num, - date_iso = ver_iso, - fnotice = fnotice, - notice = is_formal - } -end - local function parse_directory_json(raw, dir_url, sha256_map) local obj = jsonc.parse(raw) if not obj or type(obj) ~= "table" then @@ -818,48 +798,15 @@ local function parse_directory_html(html, dir_url, sha256_map) return items end -local function build_gpsysupgrade_fallback_items(dir_url, subpath, ver_info, dev_info) - if not ver_info or not ver_info.version or ver_info.version == "" then - return nil - end - local v = ver_info.version - local t_dash = (dev_info and dev_info.target or ""):gsub("/", "-") - local b_norm = (dev_info and dev_info.board_dir) or subpath:match("([^/]+)$") or "" - local items = {} - - if subpath == "x86_64" or b_norm == "x86_64" then - local efi_name = "kwrt-" .. v .. "-x86-64-generic-squashfs-combined-efi.img.gz" - local bios_name = "kwrt-" .. v .. "-x86-64-generic-squashfs-combined.img.gz" - items[#items + 1] = { name = efi_name, url = dir_url .. "/" .. efi_name, size = 0, sha256 = "", date_iso = ver_info.date_iso } - items[#items + 1] = { name = bios_name, url = dir_url .. "/" .. bios_name, size = 0, sha256 = "", date_iso = ver_info.date_iso } - elseif subpath == "x86_32" or b_norm == "x86_generic" then - local efi_name = "kwrt-" .. v .. "-x86-generic-squashfs-combined-efi.img.gz" - local bios_name = "kwrt-" .. v .. "-x86-generic-squashfs-combined.img.gz" - items[#items + 1] = { name = efi_name, url = dir_url .. "/" .. efi_name, size = 0, sha256 = "", date_iso = ver_info.date_iso } - items[#items + 1] = { name = bios_name, url = dir_url .. "/" .. bios_name, size = 0, sha256 = "", date_iso = ver_info.date_iso } - elseif b_norm:match("phicomm_k3$") or b_norm:match("rt%-ac88u$") then - local fn = "kwrt-" .. v .. "-" .. t_dash .. "-" .. b_norm .. "-squashfs.trx" - items[#items + 1] = { name = fn, url = dir_url .. "/" .. fn, size = 0, sha256 = "", date_iso = ver_info.date_iso } - elseif t_dash:match("sunxi") then - local fn = "kwrt-" .. v .. "-" .. t_dash .. "-" .. b_norm .. "-squashfs-sdcard.img.gz" - items[#items + 1] = { name = fn, url = dir_url .. "/" .. fn, size = 0, sha256 = "", date_iso = ver_info.date_iso } - elseif t_dash:match("rockchip") or b_norm:match("rpi%-") then - local fn = "kwrt-" .. v .. "-" .. t_dash .. "-" .. b_norm .. "-squashfs-sysupgrade.img.gz" - items[#items + 1] = { name = fn, url = dir_url .. "/" .. fn, size = 0, sha256 = "", date_iso = ver_info.date_iso } - elseif t_dash ~= "" and b_norm ~= "" then - local fn = "kwrt-" .. v .. "-" .. t_dash .. "-" .. b_norm .. "-squashfs-sysupgrade.bin" - items[#items + 1] = { name = fn, url = dir_url .. "/" .. fn, size = 0, sha256 = "", date_iso = ver_info.date_iso } - end - - return (#items > 0) and items or nil -end - -local function build_release_from_items(items, dir_url, resolved_subpath, ver_info, dev_info) +local function build_release_from_items(items, dir_url, resolved_subpath, dev_info) local sys_ver = (dev_info and dev_info.system_version) or get_system_version() local _, _, sys_ver_num = parse_version_token(sys_ver) for _, item in ipairs(items) do local vtag, vepoch, vnum, viso = parse_version_token(item.name) + if vtag == "" and item.date_iso and item.date_iso ~= "" then + vtag, vepoch, vnum, viso = parse_version_token(item.date_iso) + end if (not item.date_iso or item.date_iso == "") and viso ~= "" then item.date_iso = viso end @@ -883,29 +830,23 @@ local function build_release_from_items(items, dir_url, resolved_subpath, ver_in end) local newest = items[1] - local latest_ver = (ver_info and ver_info.version ~= "") and ver_info.version - or ((newest and newest.version_tag ~= "") and newest.version_tag or "") - local latest_ver_num = (ver_info and ver_info.ver_num ~= "") and ver_info.ver_num - or ((newest and newest.version_num ~= "") and newest.version_num or "") - local latest_epoch = (ver_info and ver_info.epoch and ver_info.epoch > 0) and ver_info.epoch - or ((newest and newest.version_epoch) or 0) + local latest_ver = (newest and newest.version_tag ~= "") and newest.version_tag or "" + local latest_ver_num = (newest and newest.version_num ~= "") and newest.version_num or "" + local latest_epoch = (newest and newest.version_epoch) or 0 local latest_date = "" for _, item in ipairs(items) do - if item.date_iso and item.date_iso ~= "" then - if latest_date == "" or item.date_iso > latest_date then - latest_date = item.date_iso + if latest_ver_num == "" or item.version_num == latest_ver_num then + if item.date_iso and item.date_iso ~= "" then + if latest_date == "" or item.date_iso > latest_date then + latest_date = item.date_iso + end end end end - if latest_date == "" and ver_info and ver_info.date_iso then - latest_date = ver_info.date_iso - end local is_formal = true - if ver_info and ver_info.notice ~= nil then - is_formal = ver_info.notice - elseif latest_epoch > 0 then + if latest_epoch > 0 then is_formal = ((os.time() or 0) - 172800) > latest_epoch end @@ -966,36 +907,30 @@ end local function try_fetch_firmware_dir(dir_url, timeout, subpath_label, dev_info) dir_url = dir_url:gsub("/+$", "") - local ver_raw = http_get(dir_url .. "/version.txt", math.min(timeout, 6)) - local ver_info = parse_version_txt(ver_raw) - local raw = http_get(dir_url .. "/", timeout, "Accept: application/json, text/html;q=0.9") - local items = nil - - if raw and trim(raw) ~= "" then - local sha256_map = {} - if raw:lower():find("sha256sums", 1, true) then - local sha_raw = http_get(dir_url .. "/sha256sums", math.min(timeout, 5)) - sha256_map = parse_sha256sums(sha_raw) - end - - local trimmed = trim(raw) - if trimmed:sub(1, 1) == "{" or trimmed:sub(1, 1) == "[" then - items = parse_directory_json(trimmed, dir_url, sha256_map) - else - items = parse_directory_html(raw, dir_url, sha256_map) - end + if not raw or trim(raw) == "" then + return nil end - if (not items or #items == 0) and ver_info then - items = build_gpsysupgrade_fallback_items(dir_url, subpath_label, ver_info, dev_info) + local sha256_map = {} + if raw:lower():find("sha256sums", 1, true) then + local sha_raw = http_get(dir_url .. "/sha256sums", math.min(timeout, 5)) + sha256_map = parse_sha256sums(sha_raw) + end + + local items = nil + local trimmed = trim(raw) + if trimmed:sub(1, 1) == "{" or trimmed:sub(1, 1) == "[" then + items = parse_directory_json(trimmed, dir_url, sha256_map) + else + items = parse_directory_html(raw, dir_url, sha256_map) end if not items or #items == 0 then return nil end - return build_release_from_items(items, dir_url, subpath_label, ver_info, dev_info) + return build_release_from_items(items, dir_url, subpath_label, dev_info) end local function fetch_dl_openwrt_firmware(dev_info, timeout) @@ -1219,41 +1154,19 @@ end function action_sysversion_check() local dev_info = detect_device_info() local install_epoch = get_install_epoch() - local subpath = (dev_info.candidates and dev_info.candidates[1]) or "" - if subpath == "" then - json_resp({ code = 1 }) - return - end - local ver_raw = http_get(FIRMWARE_BASE_URL .. "/" .. subpath .. "/version.txt", 5) - local ver_info = parse_version_txt(ver_raw) - if ver_info then - local fake_latest = { - release_name = ver_info.version, - tag_name = ver_info.version, - published_at = ver_info.date_iso - } - local has_new = evaluate_update_status(fake_latest, dev_info, install_epoch) - json_resp({ - code = 0, - update = has_new, - notice = has_new and ver_info.notice or false, - now_version = dev_info.system_version, - version = ver_info.version - }) - return - end - - local latest = try_fetch_firmware_dir(FIRMWARE_BASE_URL .. "/" .. subpath, 6, subpath, dev_info) + local latest = fetch_dl_openwrt_firmware(dev_info, 6) if not latest then json_resp({ code = 1 }) return end + local has_new = evaluate_update_status(latest, dev_info, install_epoch) json_resp({ code = 0, update = has_new, - notice = has_new and latest.notice or false, + notice = has_new, + is_formal = latest.notice, now_version = dev_info.system_version, version = latest.release_name }) diff --git a/luci-app-modem-manager-next/Makefile b/luci-app-modem-manager-next/Makefile index 597d8dcc4..d01d9dff2 100644 --- a/luci-app-modem-manager-next/Makefile +++ b/luci-app-modem-manager-next/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-modem-manager-next PKG_VERSION:=1.0.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=MIT PKG_MAINTAINER:=Dante @@ -14,7 +14,6 @@ LUCI_DEPENDS:=+ucode +ucode-mod-fs +ucode-mod-ubus +ucode-mod-uci \ +kmod-usb-net +kmod-usb-serial +kmod-usb-serial-option \ +kmod-usb-net-cdc-ncm +kmod-usb-net-cdc-ether +sms-tool LUCI_PKGARCH:=all -PKG_PROVIDES:=luci-app-modem-manager define Package/$(PKG_NAME)/conffiles /etc/config/modem-manager diff --git a/luci-app-open-box/Makefile b/luci-app-open-box/Makefile index c42529f98..6cc326c3c 100644 --- a/luci-app-open-box/Makefile +++ b/luci-app-open-box/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-open-box -PKG_VERSION:=0.1.445 -PKG_RELEASE:=80 +PKG_VERSION:=0.1.447 +PKG_RELEASE:=81 PKG_MAINTAINER:=liandu2024 PKG_LICENSE:=GPL-3.0-or-later