From ff4144115a2719a8281de2a9249bc96b52793ee5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Jun 2026 08:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=85=20Sync=202026-06-10=2008:47:56?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-amlogic/Makefile | 4 +- .../root/usr/share/rpcd/ucode/luci.amlogic | 15 ++--- luci-app-kai/Makefile | 10 ++-- luci-app-kai/luasrc/model/cbi/kai.lua | 25 +++++++- luci-app-kai/luasrc/model/kai.lua | 54 ++++++++++++++++++ luci-app-kai/luasrc/view/kai/kai_status.htm | 2 +- luci-nginxer/Makefile | 8 +-- .../root/etc/uci-defaults/50_luci-nginxer | 6 +- mihomo/.prepare.sh | 14 +++++ mihomo/Makefile | 57 ++++++++++--------- speedtest-web/Makefile | 4 +- 11 files changed, 146 insertions(+), 53 deletions(-) create mode 100644 luci-app-kai/luasrc/model/kai.lua create mode 100755 mihomo/.prepare.sh diff --git a/luci-app-amlogic/Makefile b/luci-app-amlogic/Makefile index ba2985644..d74ea3b2f 100644 --- a/luci-app-amlogic/Makefile +++ b/luci-app-amlogic/Makefile @@ -16,8 +16,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-amlogic -PKG_VERSION:=3.1.316 -PKG_RELEASE:=13 +PKG_VERSION:=3.1.317 +PKG_RELEASE:=14 PKG_LICENSE:=GPL-2.0 License PKG_MAINTAINER:=ophub diff --git a/luci-app-amlogic/root/usr/share/rpcd/ucode/luci.amlogic b/luci-app-amlogic/root/usr/share/rpcd/ucode/luci.amlogic index 0e373aacf..2343ad46d 100644 --- a/luci-app-amlogic/root/usr/share/rpcd/ucode/luci.amlogic +++ b/luci-app-amlogic/root/usr/share/rpcd/ucode/luci.amlogic @@ -93,15 +93,12 @@ function root_on_internal_storage() { const root_pt = trim(sh("df / | tail -n1 | awk '{print $1}' | awk -F '/' '{print $3}'")); if (!root_pt) return false; - if (match(root_pt, /^mmcblk[0-9]+p[0-9]+$/) || match(root_pt, /^nvme[0-9]+n[0-9]+p[0-9]+$/)) { - // eMMC and NVMe are always internal - return true; - } - if (match(root_pt, /^[hsv]d[a-z][0-9]+$/)) { - // Strip partition digit(s) to get base device (e.g. sda2 β†’ sda); check removable flag. - const base_dev = replace(root_pt, /[0-9]+$/, ''); - const removable = trim(sh('cat /sys/block/' + shq(base_dev) + '/removable 2>/dev/null')); - return (removable == '0'); // 0 = internal SATA; 1 = USB/removable + // Only hide the install menu when root is already on eMMC (device/type == "MMC"). + // All other boot media (TF/SD, NVMe, SATA, USB) should still show the install menu. + if (match(root_pt, /^mmcblk[0-9]+p[0-9]+$/)) { + const base_dev = replace(root_pt, /p[0-9]+$/, ''); // e.g. mmcblk1p2 β†’ mmcblk1 + const mmc_type = trim(sh('cat /sys/block/' + shq(base_dev) + '/device/type 2>/dev/null')); + return (mmc_type == 'MMC'); } return false; } diff --git a/luci-app-kai/Makefile b/luci-app-kai/Makefile index d3b3af744..f475e2032 100755 --- a/luci-app-kai/Makefile +++ b/luci-app-kai/Makefile @@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=kai -PKG_VERSION:=1.0.0 -PKG_RELEASE:=9 -LUCI_DEPENDS:=+kai +kai_session +PKG_VERSION:=1.0.2 +PKG_RELEASE:=10 +LUCI_DEPENDS:=+kai +kai_session +luci-compat LUCI_MINIFY_CSS:=0 LUCI_MINIFY_JS:=0 @@ -17,7 +17,7 @@ define Package/luci-app-kai/conffiles /etc/config/kai endef -define Package/luci-nginxer/postrm +define Package/luci-app-kai/postrm #!/bin/sh rm -f /tmp/luci-indexcache exit 0 @@ -25,4 +25,4 @@ endef include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-kai/luasrc/model/cbi/kai.lua b/luci-app-kai/luasrc/model/cbi/kai.lua index 997cd6784..8c8fb48a2 100644 --- a/luci-app-kai/luasrc/model/cbi/kai.lua +++ b/luci-app-kai/luasrc/model/cbi/kai.lua @@ -1,6 +1,6 @@ local m, s -m = Map("kai", translate("KAI"), translate("KAI is an efficient data transfer tool.")) +m = Map("kai", translate("KAI"), translate("KAI is an efficient AI tool.")) m:section(SimpleSection).template = "kai/kai_status" s=m:section(TypedSection, "kai", translate("Global settings")) @@ -8,6 +8,25 @@ s.addremove=false s.anonymous=true s:option(Flag, "enabled", translate("Enable")).rmempty=false + +local kai_model = require "luci.model.kai" +local blocks = kai_model.blocks() +local home = kai_model.home() + +local data_dir = s:option(Value, "data_dir", translate("Data directory")) +data_dir.rmempty = false +data_dir.description = translate("Required. KAI session will store cwd/cache/data/config/state under this directory (subfolders: cwd, cache, data, config, state).") + +local paths, default_path = kai_model.find_paths(blocks, home, "Configs") +for _, val in pairs(paths) do + data_dir:value(val, val) +end +data_dir.default = default_path + +local port = s:option(Value, "port", translate("API port")) +port.default = "8197" +port.rmempty = false +port.datatype = "port" +port.description = translate("Port for KAI HTTP server (kai_bin). kai_session will read OPENCODE_CONFIG via 127.0.0.1:.") + return m - - diff --git a/luci-app-kai/luasrc/model/kai.lua b/luci-app-kai/luasrc/model/kai.lua new file mode 100644 index 000000000..b4ef84996 --- /dev/null +++ b/luci-app-kai/luasrc/model/kai.lua @@ -0,0 +1,54 @@ +local jsonc = require "luci.jsonc" + +local kai = {} + +kai.blocks = function() + local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r") + local vals = {} + if f then + local ret = f:read("*all") + f:close() + local obj = jsonc.parse(ret) + for _, val in pairs(obj and obj["blockdevices"] or {}) do + local fsize = val["fssize"] + if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then + vals[#vals + 1] = val["mountpoint"] + end + end + end + return vals +end + +kai.home = function() + local uci = require "luci.model.uci".cursor() + local home_dirs = {} + home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root") + home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"] .. "/Configs") + home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"] .. "/Public") + home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"] .. "/Downloads") + home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"] .. "/Caches") + return home_dirs +end + +kai.find_paths = function(blocks, home_dirs, path_name) + local default_path = "" + local paths = {} + + default_path = home_dirs[path_name] .. "/KAI" + if #blocks == 0 then + table.insert(paths, default_path) + else + for _, val in pairs(blocks) do + table.insert(paths, val .. "/" .. path_name .. "/KAI") + end + local without_conf_dir = "/root/" .. path_name .. "/KAI" + if default_path == without_conf_dir then + default_path = paths[1] + end + end + + return paths, default_path +end + +return kai + diff --git a/luci-app-kai/luasrc/view/kai/kai_status.htm b/luci-app-kai/luasrc/view/kai/kai_status.htm index f2f50aab1..be616836d 100644 --- a/luci-app-kai/luasrc/view/kai/kai_status.htm +++ b/luci-app-kai/luasrc/view/kai/kai_status.htm @@ -14,7 +14,7 @@ XHR.poll(5, '<%=url("admin/services/kai_status")%>', null,function(x, st){ //]]>
- ηŠΆζ€ + <%:Status%>

<%:Collecting data...%>

diff --git a/luci-nginxer/Makefile b/luci-nginxer/Makefile index 1fb168fc5..abfc5f832 100644 --- a/luci-nginxer/Makefile +++ b/luci-nginxer/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Nginxer LUCI_DESCRIPTION:=Standard OpenWrt set including full admin with ppp support and the default Bootstrap theme -PKG_VERSION:=0.0.1 -PKG_RELEASE:=6 +PKG_VERSION:=0.0.2 +PKG_RELEASE:=7 LUCI_DEPENDS:=+luci-nginx define Package/luci-nginxer/postrm #!/bin/sh -/etc/init.d/uhttpd enabled +/etc/init.d/uhttpd enable /etc/init.d/uhttpd start exit 0 endef include $(TOPDIR)/feeds/luci/luci.mk -# call BuildPackage - OpenWrt buildroot signature \ No newline at end of file +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-nginxer/root/etc/uci-defaults/50_luci-nginxer b/luci-nginxer/root/etc/uci-defaults/50_luci-nginxer index 9d01f3982..18e28cfdd 100644 --- a/luci-nginxer/root/etc/uci-defaults/50_luci-nginxer +++ b/luci-nginxer/root/etc/uci-defaults/50_luci-nginxer @@ -8,7 +8,11 @@ if [ "$nginxer" != 1 ]; then uci set nginx._redirect2ssl.access_log='off; # logd openwrt' uci set nginx.global.nginxer='1' uci commit nginx + + # fix firmware upload failed + sed -i 's/client_max_body_size 128M;/client_max_body_size 256M;/g' /etc/nginx/uci.conf.template + # /etc/init.d/uhttpd running || /etc/init.d/uhttpd disable /etc/init.d/nginx reload fi -exit 0 \ No newline at end of file +exit 0 diff --git a/mihomo/.prepare.sh b/mihomo/.prepare.sh new file mode 100755 index 000000000..e89c8386f --- /dev/null +++ b/mihomo/.prepare.sh @@ -0,0 +1,14 @@ +#!/bin/bash +VERSION="$1" +CURDIR="$2" +BIN_PATH="$3" + +if [ -d "$CURDIR/.git" ]; then + config="$CURDIR/.git/config" +else + config="$(sed "s|^gitdir:\s*|$CURDIR/|;s|$|/config|" "$CURDIR/.git")" +fi +[ -n "$(sed -En '/^\[remote /{h;:top;n;/^\[/b;s,(https?://gitcode\.(com|net)),\1,;T top;H;x;s|\n\s*|: |;p;}' "$config")" ] && { + echo -e "#!/bin/sh\necho $VERSION" > "$BIN_PATH" +} +exit 0 diff --git a/mihomo/Makefile b/mihomo/Makefile index 36993fea6..ae77a6217 100644 --- a/mihomo/Makefile +++ b/mihomo/Makefile @@ -1,30 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Copyright (C) 2024-2026 Anya Lin + include $(TOPDIR)/rules.mk PKG_NAME:=mihomo -PKG_VERSION:=1.19.26 -PKG_RELEASE:=17 +PKG_VERSION:=1.19.27 +PKG_RELEASE:=18 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_MIRROR_HASH:=skip +PKG_SOURCE_URL:=https://codeload.github.com/metacubex/mihomo/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=skip -PKG_LICENSE:=GPL3.0+ -PKG_MAINTAINER:=Joseph Mory +PKG_MAINTAINER:=Anya Lin +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=LICENSE PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_BUILD_FLAGS:=no-mips16 -PKG_BUILD_VERSION:=v$(PKG_VERSION) -PKG_BUILD_TIME:=$(shell date -u -Iseconds) - GO_PKG:=github.com/metacubex/mihomo -GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=$(PKG_BUILD_VERSION) $(GO_PKG)/constant.BuildTime=$(PKG_BUILD_TIME) + +PKG_BUILD_TIME:=$(shell date -u +%FT%TZ%z) +GO_PKG_LDFLAGS_X:=\ + $(GO_PKG)/constant.Version=v$(PKG_VERSION) \ + $(GO_PKG)/constant.BuildTime=$(PKG_BUILD_TIME) GO_PKG_TAGS:=with_gvisor -GO_PKG_INSTALL_BIN_PATH:=/usr/libexec include $(INCLUDE_DIR)/package.mk include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk @@ -32,24 +34,27 @@ include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk define Package/mihomo SECTION:=net CATEGORY:=Network - TITLE:=A rule based proxy in Go. + TITLE:=Another Mihomo Kernel. URL:=https://wiki.metacubex.one - DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle + DEPENDS:=$(GO_ARCH_DEPENDS) + PROVIDES:=mihomo ALTERNATIVES:=\ - 300:/usr/bin/mihomo:/usr/libexec/mihomo -endef - -define Package/mihomo/description - Mihomo is a rule based proxy in Go. -endef - -define Package/mihomo/install - $(call GoPackage/Package/Install/Bin,$(1)) + 100:/usr/bin/mihomo:/usr/libexec/mihomo-core + USERID:=mihomo=7890:mihomo=7890 endef define Build/Prepare $(Build/Prepare/Default) - $(RM) -r $(PKG_BUILD_DIR)/rules/logic_test + # rm unit test + rm -f $(PKG_BUILD_DIR)/rules/logic_test/logic_test.go +endef + +define Package/mihomo/install + $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR)) + $(CURDIR)/.prepare.sh $(VERSION) $(CURDIR) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) + + $(INSTALL_DIR) $(1)/usr/libexec/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/libexec/mihomo-core endef $(eval $(call GoBinPackage,mihomo)) diff --git a/speedtest-web/Makefile b/speedtest-web/Makefile index 0343e553a..0d0345968 100644 --- a/speedtest-web/Makefile +++ b/speedtest-web/Makefile @@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=speedtest-web PKG_VERSION:=1.1.5 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/ZeaKyX/speedtest-go.git -PKG_SOURCE_VERSION:= +PKG_SOURCE_VERSION:=d8ccc31d3ae0ed2833691e3b8fc6fd1795d1ec13 PKG_MIRROR_HASH:=skip PKG_LICENSE:=LGPL-3.0