From 35a468af591bd06a841ce9589242437517e892f5 Mon Sep 17 00:00:00 2001 From: Joseph Mory Date: Tue, 27 Aug 2024 08:16:03 +0000 Subject: [PATCH] v1.7.5 1. add `fast reload` option in basic config 2. add `udp` option in subscription convert config 3. add `expand` option in subscription convert config 4. add choices for `ui url` option in mixin external control config --- luci-app-mihomo/Makefile | 2 +- .../resources/view/mihomo/config.js | 104 ++++++++++-------- luci-app-mihomo/po/zh_Hans/mihomo.po | 9 ++ mihomo/Makefile | 2 +- mihomo/files/mihomo.conf | 2 + mihomo/files/mihomo.init | 13 ++- mihomo/files/uci-defaults/migrate.sh | 2 + 7 files changed, 86 insertions(+), 48 deletions(-) diff --git a/luci-app-mihomo/Makefile b/luci-app-mihomo/Makefile index 0f311ddbf..fe5bd4965 100644 --- a/luci-app-mihomo/Makefile +++ b/luci-app-mihomo/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.7.4 +PKG_VERSION:=1.7.5 LUCI_TITLE:=LuCI Support for mihomo LUCI_DEPENDS:=+luci-base +mihomo diff --git a/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js b/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js index 930ab587b..67b714e46 100644 --- a/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js +++ b/luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js @@ -17,39 +17,39 @@ const convertBackends = [ ]; const convertTemplates = [ - {name: 'ACL4SSR', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR.ini'}, - {name: 'ACL4SSR_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_AdblockPlus.ini'}, - {name: 'ACL4SSR_BackCN', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_BackCN.ini'}, - {name: 'ACL4SSR_Mini', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini.ini'}, - {name: 'ACL4SSR_Mini_Fallback', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_Fallback.ini'}, - {name: 'ACL4SSR_Mini_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_MultiMode.ini'}, - {name: 'ACL4SSR_Mini_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_NoAuto.ini'}, - {name: 'ACL4SSR_NoApple', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoApple.ini'}, - {name: 'ACL4SSR_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto.ini'}, - {name: 'ACL4SSR_NoAuto_NoApple', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto_NoApple.ini'}, - {name: 'ACL4SSR_NoAuto_NoApple_NoMicrosoft', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto_NoApple_NoMicrosoft.ini'}, - {name: 'ACL4SSR_NoMicrosoft', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoMicrosoft.ini'}, - {name: 'ACL4SSR_Online', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini'}, - {name: 'ACL4SSR_Online_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini'}, - {name: 'ACL4SSR_Online_Full', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full.ini'}, - {name: 'ACL4SSR_Online_Full_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini'}, - {name: 'ACL4SSR_Online_Full_Google', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Google.ini'}, - {name: 'ACL4SSR_Online_Full_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_MultiMode.ini'}, - {name: 'ACL4SSR_Online_Full_Netflix', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini'}, - {name: 'ACL4SSR_Online_Full_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_NoAuto.ini'}, - {name: 'ACL4SSR_Online_Mini', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini.ini'}, - {name: 'ACL4SSR_Online_Mini_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini'}, - {name: 'ACL4SSR_Online_Mini_Ai', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_Ai.ini'}, - {name: 'ACL4SSR_Online_Mini_Fallback', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_Fallback.ini'}, - {name: 'ACL4SSR_Online_Mini_MultiCountry', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiCountry.ini'}, - {name: 'ACL4SSR_Online_Mini_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini'}, - {name: 'ACL4SSR_Online_Mini_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini'}, - {name: 'ACL4SSR_Online_MultiCountry', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_MultiCountry.ini'}, - {name: 'ACL4SSR_Online_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini'}, - {name: 'ACL4SSR_Online_NoReject', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini'}, - {name: 'ACL4SSR_WithChinaIp', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithChinaIp.ini'}, - {name: 'ACL4SSR_WithChinaIp_WithGFW', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithChinaIp_WithGFW.ini'}, - {name: 'ACL4SSR_WithGFW', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithGFW.ini'}, + { name: 'ACL4SSR', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR.ini' }, + { name: 'ACL4SSR_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_AdblockPlus.ini' }, + { name: 'ACL4SSR_BackCN', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_BackCN.ini' }, + { name: 'ACL4SSR_Mini', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini.ini' }, + { name: 'ACL4SSR_Mini_Fallback', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_Fallback.ini' }, + { name: 'ACL4SSR_Mini_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_MultiMode.ini' }, + { name: 'ACL4SSR_Mini_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Mini_NoAuto.ini' }, + { name: 'ACL4SSR_NoApple', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoApple.ini' }, + { name: 'ACL4SSR_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto.ini' }, + { name: 'ACL4SSR_NoAuto_NoApple', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto_NoApple.ini' }, + { name: 'ACL4SSR_NoAuto_NoApple_NoMicrosoft', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoAuto_NoApple_NoMicrosoft.ini' }, + { name: 'ACL4SSR_NoMicrosoft', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_NoMicrosoft.ini' }, + { name: 'ACL4SSR_Online', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini' }, + { name: 'ACL4SSR_Online_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini' }, + { name: 'ACL4SSR_Online_Full', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full.ini' }, + { name: 'ACL4SSR_Online_Full_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini' }, + { name: 'ACL4SSR_Online_Full_Google', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Google.ini' }, + { name: 'ACL4SSR_Online_Full_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_MultiMode.ini' }, + { name: 'ACL4SSR_Online_Full_Netflix', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini' }, + { name: 'ACL4SSR_Online_Full_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_NoAuto.ini' }, + { name: 'ACL4SSR_Online_Mini', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini.ini' }, + { name: 'ACL4SSR_Online_Mini_AdblockPlus', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini' }, + { name: 'ACL4SSR_Online_Mini_Ai', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_Ai.ini' }, + { name: 'ACL4SSR_Online_Mini_Fallback', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_Fallback.ini' }, + { name: 'ACL4SSR_Online_Mini_MultiCountry', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiCountry.ini' }, + { name: 'ACL4SSR_Online_Mini_MultiMode', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini' }, + { name: 'ACL4SSR_Online_Mini_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini' }, + { name: 'ACL4SSR_Online_MultiCountry', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_MultiCountry.ini' }, + { name: 'ACL4SSR_Online_NoAuto', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini' }, + { name: 'ACL4SSR_Online_NoReject', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini' }, + { name: 'ACL4SSR_WithChinaIp', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithChinaIp.ini' }, + { name: 'ACL4SSR_WithChinaIp_WithGFW', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithChinaIp_WithGFW.ini' }, + { name: 'ACL4SSR_WithGFW', url: 'https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_WithGFW.ini' }, ]; function renderStatus(running) { @@ -86,7 +86,7 @@ return view.extend({ let m, s, o, so; m = new form.Map('mihomo', _('MihomoTProxy'), `${_('Transparent Proxy with Mihomo on OpenWrt.')} ${_('Usage')}`); - + s = m.section(form.NamedSection, 'status', 'status', _('Status')); o = s.option(form.Value, '_app_version', _('App Version')); @@ -94,14 +94,14 @@ return view.extend({ o.load = function (section_id) { return appVersion.trim(); }; - o.write = function () {}; + o.write = function () { }; o = s.option(form.Value, '_core_version', _('Core Version')); o.readonly = true; o.load = function (section_id) { return coreVersion.trim(); }; - o.write = function () {}; + o.write = function () { }; o = s.option(form.DummyValue, '_core_status', _('Core Status')); o.cfgvalue = function (section_id) { @@ -173,6 +173,9 @@ return view.extend({ o = s.option(form.Flag, 'test_profile', _('Test Profile')); o.rmempty = false; + o = s.option(form.Flag, 'fast_reload', _('Fast Reload')); + o.rmempty = false; + s = m.section(form.NamedSection, 'proxy', 'proxy', _('Proxy Config')); s.tab('transparent_proxy', _('Transparent Proxy')); @@ -332,24 +335,36 @@ return view.extend({ o = s.taboption('convert', form.Value, 'convert_include', _('Include')); o.modalonly = true; o.retain = true; - o.depends({'convert': '1', 'convert_advanced': '1'}); - + o.depends({ 'convert': '1', 'convert_advanced': '1' }); + o = s.taboption('convert', form.Value, 'convert_exclude', _('Exclude')); o.modalonly = true; o.retain = true; - o.depends({'convert': '1', 'convert_advanced': '1'}); + o.depends({ 'convert': '1', 'convert_advanced': '1' }); + + o = s.taboption('convert', form.Flag, 'convert_udp', _('UDP')); + o.modalonly = true; + o.retain = true; + o.rmempty = false; + o.depends({ 'convert': '1', 'convert_advanced': '1' }); o = s.taboption('convert', form.Flag, 'convert_emoji', _('Use Emoji')); o.modalonly = true; o.retain = true; o.rmempty = false; - o.depends({'convert': '1', 'convert_advanced': '1'}); + o.depends({ 'convert': '1', 'convert_advanced': '1' }); o = s.taboption('convert', form.Flag, 'convert_insert_node_type', _('Insert Node Type')); o.modalonly = true; o.retain = true; o.rmempty = false; - o.depends({'convert': '1', 'convert_advanced': '1'}); + o.depends({ 'convert': '1', 'convert_advanced': '1' }); + + o = s.taboption('convert', form.Flag, 'convert_expand', _('Expand Ruleset')); + o.modalonly = true; + o.retain = true; + o.rmempty = false; + o.depends({ 'convert': '1', 'convert_advanced': '1' }); s = m.section(form.NamedSection, 'mixin', 'mixin', _('Mixin Config')); @@ -393,6 +408,9 @@ return view.extend({ o = s.taboption('external_control', form.Value, 'ui_url', _('UI Url')); o.rmempty = false; + o.value('https://mirror.ghproxy.com/https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip', 'MetaCubeXD') + o.value('https://mirror.ghproxy.com/https://github.com/MetaCubeX/Yacd-meta/archive/refs/heads/gh-pages.zip', 'YACD') + o.value('https://mirror.ghproxy.com/https://github.com/MetaCubeX/Razord-meta/archive/refs/heads/gh-pages.zip', 'Razord') o = s.taboption('external_control', form.Value, 'api_port', _('API Port')); o.datatype = 'port'; @@ -629,8 +647,8 @@ return view.extend({ s.tab('geox', _('GeoX Config')); o = s.taboption('geox', form.ListValue, 'geoip_format', _('GeoIP Format')); - o.value('dat'); - o.value('mmdb'); + o.value('dat', 'DAT'); + o.value('mmdb', 'MMDB'); o = s.taboption('geox', form.ListValue, 'geodata_loader', _('GeoData Loader')); o.value('standard', _('Standard Loader')); diff --git a/luci-app-mihomo/po/zh_Hans/mihomo.po b/luci-app-mihomo/po/zh_Hans/mihomo.po index cbaf7c9a1..7ee6c8aab 100644 --- a/luci-app-mihomo/po/zh_Hans/mihomo.po +++ b/luci-app-mihomo/po/zh_Hans/mihomo.po @@ -85,6 +85,9 @@ msgstr "混入" msgid "Test Profile" msgstr "检查配置文件" +msgid "Fast Reload" +msgstr "快速重载" + msgid "Proxy Config" msgstr "代理配置" @@ -181,12 +184,18 @@ msgstr "包含节点" msgid "Exclude" msgstr "排除节点" +msgid "UDP" +msgstr "UDP" + msgid "Use Emoji" msgstr "使用 Emoji" msgid "Insert Node Type" msgstr "插入节点类型" +msgid "Expand Ruleset" +msgstr "展开规则集" + msgid "Mixin Config" msgstr "混入配置" diff --git a/mihomo/Makefile b/mihomo/Makefile index 936d21a1c..ae23c384d 100644 --- a/mihomo/Makefile +++ b/mihomo/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mihomo -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git diff --git a/mihomo/files/mihomo.conf b/mihomo/files/mihomo.conf index 39263336a..f5b069d7f 100644 --- a/mihomo/files/mihomo.conf +++ b/mihomo/files/mihomo.conf @@ -38,8 +38,10 @@ config subscription 'subscription' option 'convert_advanced' '0' option 'convert_include' '' option 'convert_exclude' '' + option 'convert_udp' '0' option 'convert_emoji' '0' option 'convert_insert_node_type' '0' + option 'convert_expand' '0' config mixin 'mixin' option 'mode' 'rule' diff --git a/mihomo/files/mihomo.init b/mihomo/files/mihomo.init index 87f7547d1..d1a8c7d80 100644 --- a/mihomo/files/mihomo.init +++ b/mihomo/files/mihomo.init @@ -24,12 +24,13 @@ start_service() { log "Starting..." # get config ## app config - local scheduled_restart cron_expression profile mixin test_profile + local scheduled_restart cron_expression profile mixin test_profile fast_reload config_get scheduled_restart "config" "scheduled_restart" config_get cron_expression "config" "cron_expression" config_get profile "config" "profile" config_get_bool mixin "config" "mixin" 0 config_get_bool test_profile "config" "test_profile" 0 + config_get_bool fast_reload "config" "fast_reload" 0 ## proxy config local transparent_proxy transparent_proxy_mode ipv4_dns_hijack ipv6_dns_hijack ipv4_proxy ipv6_proxy router_proxy lan_proxy access_control_mode bypass_china_mainland_ip acl_tcp_dport acl_udp_dport config_get_bool transparent_proxy "proxy" "transparent_proxy" 0 @@ -125,12 +126,14 @@ start_service() { config_get subscription_convert_backend "$subscription_section" "convert_backend" config_get subscription_convert_template "$subscription_section" "convert_template" # convert advanced - local subscription_convert_advanced subscription_convert_include subscription_convert_exclude subscription_convert_emoji subscription_convert_insert_node_type + local subscription_convert_advanced subscription_convert_include subscription_convert_exclude subscription_convert_udp subscription_convert_emoji subscription_convert_insert_node_type subscription_convert_expand config_get_bool subscription_convert_advanced "$subscription_section" "convert_advanced" 0 config_get subscription_convert_include "$subscription_section" "convert_include" config_get subscription_convert_exclude "$subscription_section" "convert_exclude" + config_get_bool subscription_convert_udp "$subscription_section" "convert_udp" 0 config_get_bool subscription_convert_emoji "$subscription_section" "convert_emoji" 0 config_get_bool subscription_convert_insert_node_type "$subscription_section" "convert_insert_node_type" 0 + config_get_bool subscription_convert_expand "$subscription_section" "convert_expand" 0 # generate url local url if [ "$subscription_convert" == 0 ]; then @@ -147,8 +150,10 @@ start_service() { if [ -n "$subscription_convert_exclude" ]; then url="$url&exclude=$(echo -n $subscription_convert_exclude | yq -M -o uri)" fi + url="$url&udp=$([ "$subscription_convert_udp" == 1 ] && echo -n "true" || echo -n "false")" url="$url&emoji=$([ "$subscription_convert_emoji" == 1 ] && echo -n "true" || echo -n "false")" url="$url&append_type=$([ "$subscription_convert_insert_node_type" == 1 ] && echo -n "true" || echo -n "false")" + url="$url&expand=$([ "$subscription_convert_expand" == 1 ] && echo -n "true" || echo -n "false")" fi fi curl -s -o "$RUN_PROFILE_PATH" -L -H "User-Agent: $subscription_user_agent" "$url" @@ -262,7 +267,9 @@ start_service() { procd_set_param command /bin/sh -c "$PROG -d $RUN_DIR >> $RUN_CORE_LOG_PATH 2>&1" procd_set_param file "$RUN_PROFILE_PATH" - procd_set_param reload_signal HUP + if [ "$fast_reload" == 1 ]; then + procd_set_param reload_signal HUP + fi procd_set_param respawn procd_set_param user "$MIHOMO_USER" procd_set_param group "$MIHOMO_GROUP" diff --git a/mihomo/files/uci-defaults/migrate.sh b/mihomo/files/uci-defaults/migrate.sh index df8fd312f..c70f876f3 100644 --- a/mihomo/files/uci-defaults/migrate.sh +++ b/mihomo/files/uci-defaults/migrate.sh @@ -132,6 +132,8 @@ ui_metacubexd=$(uci -q get mihomo.mixin.ui_metacubexd); [ -n "$ui_metacubexd" ] # delete mihomo.mixin.ui_metacubexd_url ui_metacubexd_url=$(uci -q get mihomo.mixin.ui_metacubexd_url); [ -n "$ui_metacubexd_url" ] && uci delete mihomo.mixin.ui_metacubexd_url +# add mihomo.config.fast_reload +fast_reload=$(uci -q get mihomo.config.fast_reload); [ -z "$fast_reload" ] && uci set mihomo.config.fast_reload=1 # commit uci commit mihomo