From 33c801313ad78f9c76a6f2a83a6305835a6b6a68 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Fri, 31 Jan 2025 21:00:23 +0800 Subject: [PATCH] mihomo: sync upstream last commit: https://github.com/morytyann/OpenWrt-mihomo/commit/ac398d909913099fb791d5829253d17f818cfbee --- mihomo/Makefile | 8 ++++---- mihomo/files/mihomo.conf | 1 + mihomo/files/mihomo.init | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mihomo/Makefile b/mihomo/Makefile index e264f7e41..1351b0c85 100644 --- a/mihomo/Makefile +++ b/mihomo/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_DATE:=2025-01-15 -PKG_SOURCE_VERSION:=192d769f7587f333a3a0798e2f121be441a95c16 -PKG_MIRROR_HASH:=06654590011c34d5a4ad5aeec0568237c0660f60d611ebbf4b3cd285ac149730 +PKG_SOURCE_DATE:=2025-01-21 +PKG_SOURCE_VERSION:=b69e52d4d72846b8201a4073ed68c4c332c40db9 +PKG_MIRROR_HASH:=33ecc27b647a62920d752a877c1a2812d93ed375a332ceac6890b5b070c7aacc PKG_LICENSE:=MIT PKG_MAINTAINER:=Joseph Mory @@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_BUILD_FLAGS:=no-mips16 -PKG_BUILD_VERSION:=alpha-192d769 +PKG_BUILD_VERSION:=alpha-b69e52d PKG_BUILD_TIME:=$(shell date -u -Iseconds) GO_PKG:=github.com/metacubex/mihomo diff --git a/mihomo/files/mihomo.conf b/mihomo/files/mihomo.conf index f985ecc6e..adf516fde 100644 --- a/mihomo/files/mihomo.conf +++ b/mihomo/files/mihomo.conf @@ -47,6 +47,7 @@ config subscription 'subscription' option 'name' 'default' option 'url' 'http://example.com/default.yaml' option 'user_agent' 'clash' + option 'prefer' 'remote' config mixin 'mixin' option 'log_level' 'warning' diff --git a/mihomo/files/mihomo.init b/mihomo/files/mihomo.init index feeeb4c03..7f6a34252 100644 --- a/mihomo/files/mihomo.init +++ b/mihomo/files/mihomo.init @@ -266,7 +266,7 @@ start_service() { fi if [ "$mixin_file_content" == 1 ]; then if [ -s "$MIXIN_FILE_PATH" ]; then - yq ea -M -i '. as $item ireduce ({}; . * $item ) | ... comments=""' "$RUN_PROFILE_PATH" "$MIXIN_FILE_PATH" + yq -M -i ea '. as $item ireduce ({}; . * $item ) | ... comments=""' "$RUN_PROFILE_PATH" "$MIXIN_FILE_PATH" fi fi # test profile @@ -376,7 +376,7 @@ service_started() { local tun_interval; tun_interval=1 while [ "$tun_timeout" -gt 0 ]; do if (ip link show dev "$tun_device" > /dev/null 2>&1); then - if [ $(ip -json addr show dev mihomo | yq '.[] | select(.ifname = "mihomo") | .addr_info | length') -gt 0 ]; then + if [ $(ip -json addr show dev mihomo | yq -M '.[] | select(.ifname = "mihomo") | .addr_info | length') -gt 0 ]; then log "Transparent Proxy" "Tun device is online." break fi @@ -575,11 +575,11 @@ cleanup() { # delete hijack nft delete table inet "$FW_TABLE" > /dev/null 2>&1 local handles handle - handles=$(nft --json list table inet fw4 | yq '.nftables[] | select(has("rule")) | .rule | select(.chain == "input" and .comment == "mihomo") | .handle') + handles=$(nft --json list table inet fw4 | yq -M '.nftables[] | select(has("rule")) | .rule | select(.chain == "input" and .comment == "mihomo") | .handle') for handle in $handles; do nft delete rule inet fw4 input handle "$handle" done - handles=$(nft --json list table inet fw4 | yq '.nftables[] | select(has("rule")) | .rule | select(.chain == "forward" and .comment == "mihomo") | .handle') + handles=$(nft --json list table inet fw4 | yq -M '.nftables[] | select(has("rule")) | .rule | select(.chain == "forward" and .comment == "mihomo") | .handle') for handle in $handles; do nft delete rule inet fw4 forward handle "$handle" done