diff --git a/luci-app-mihomo/Makefile b/luci-app-mihomo/Makefile index ce2b2a51..5ff816c4 100644 --- a/luci-app-mihomo/Makefile +++ b/luci-app-mihomo/Makefile @@ -1,6 +1,6 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.8.5 +PKG_VERSION:=1.8.6 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 03abce35..d0829dc7 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 @@ -232,6 +232,7 @@ return view.extend({ s = m.section(form.TableSection, 'subscription', _('

💾 Subscription Config

')); s.addremove = true; s.anonymous = true; + s.sortable = true; o = s.option(form.Value, 'name', _('Subscription Name')); o.rmempty = false; @@ -241,7 +242,7 @@ return view.extend({ o.rmempty = false; o = s.option(form.Value, 'user_agent', _('User Agent')); - o.default = 'mihomo'; + o.default = 'clash'; o.rmempty = false; o.width = '15%'; o.value('mihomo'); @@ -276,11 +277,11 @@ return view.extend({ o.rmempty = false; o = s.taboption('general', form.Value, 'tcp_keep_alive_idle', _('TCP Keep Alive Idle')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '600'; o = s.taboption('general', form.Value, 'tcp_keep_alive_interval', _('TCP Keep Alive Interval')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '15'; s.tab('external_control', _('External Control Config')); @@ -336,8 +337,9 @@ return view.extend({ o.retain = true; o.depends('authentication', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -356,13 +358,16 @@ return view.extend({ o.value('mixed', 'Mixed'); o = s.taboption('tun', form.Value, 'tun_mtu', '*' + ' ' + _('MTU')); + o.datatype = 'uinteger'; o.placeholder = '9000'; o = s.taboption('tun', form.Flag, 'tun_gso', '*' + ' ' + _('GSO')); o.rmempty = false; o = s.taboption('tun', form.Value, 'tun_gso_max_size', '*' + ' ' + _('GSO Max Size')); + o.datatype = 'uinteger'; o.placeholder = '65536'; + o.retain = true; o.depends('tun_gso', '1'); o = s.taboption('tun', form.Flag, 'tun_endpoint_independent_nat', '*' + ' ' + _('Endpoint Independent NAT')); @@ -374,12 +379,12 @@ return view.extend({ o.datatype = 'port'; o.placeholder = '1053'; - o = s.taboption('dns', form.ListValue, 'dns_mode', _('DNS Mode')); + o = s.taboption('dns', form.ListValue, 'dns_mode', '*' + ' ' + _('DNS Mode')); o.value('normal', 'Normal'); o.value('fake-ip', 'Fake-IP'); o.value('redir-host', 'Redir-Host'); - o = s.taboption('dns', form.Value, 'fake_ip_range', _('Fake-IP Range')); + o = s.taboption('dns', form.Value, 'fake_ip_range', '*' + ' ' + _('Fake-IP Range')); o.datatype = 'cidr4'; o.placeholder = '198.18.0.1/16'; o.retain = true; @@ -395,6 +400,7 @@ return view.extend({ o.depends({ 'dns_mode': 'fake-ip', 'fake_ip_filter': '1' }); o = s.taboption('dns', form.ListValue, 'fake_ip_filter_mode', _('Fake-IP Filter Mode')) + o.retain = true; o.value('blacklist', _('Block Mode')); o.value('whitelist', _('Allow Mode')); o.depends({ 'dns_mode': 'fake-ip', 'fake_ip_filter': '1' }); @@ -426,8 +432,9 @@ return view.extend({ o.retain = true; o.depends('hosts', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -444,16 +451,17 @@ return view.extend({ o.retain = true; o.depends('dns_nameserver', '1'); + o.subsection.addremove = true; o.subsection.anonymous = true; - o.subsection.addremove = false; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; so = o.subsection.option(form.ListValue, 'type', _('Type')); - so.readonly = true; so.value('default-nameserver'); so.value('proxy-server-nameserver'); + so.value('direct-nameserver'); so.value('nameserver'); so.value('fallback'); @@ -466,8 +474,9 @@ return view.extend({ o.retain = true; o.depends('dns_nameserver_policy', '1'); - o.subsection.anonymous = true; o.subsection.addremove = true; + o.subsection.anonymous = true; + o.subsection.sortable = true; so = o.subsection.option(form.Flag, 'enabled', _('Enable')); so.rmempty = false; @@ -503,7 +512,7 @@ return view.extend({ o.rmempty = false; o = s.taboption('geox', form.Value, 'geox_update_interval', _('GeoX Update Interval'), _('Hour')); - o.datatype = 'integer'; + o.datatype = 'uinteger'; o.placeholder = '24'; o.retain = true; o.depends('geox_auto_update', '1'); diff --git a/mihomo/Makefile b/mihomo/Makefile index a3e45bc9..66adec5d 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:=2024-10-08 -PKG_SOURCE_VERSION:=08dcef80bf9a528d36cf8d516cc251f6449f9336 -PKG_MIRROR_HASH:=803fd00529f3bb01617cc6349343858f73b2c6b4d533e8d76434941af7908395 +PKG_SOURCE_DATE:=2024-10-12 +PKG_SOURCE_VERSION:=ca3f1ebae6b71c2224987f1cf7828cf1338d5509 +PKG_MIRROR_HASH:=0c53892f20a8a4860565c58508c2a02bc6351bbd68a781bbe4b64e491e6762ce 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-08dcef8 +PKG_BUILD_VERSION:=alpha-ca3f1eb 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 6319e411..235f9929 100644 --- a/mihomo/files/mihomo.conf +++ b/mihomo/files/mihomo.conf @@ -11,8 +11,8 @@ config config 'config' config proxy 'proxy' option 'transparent_proxy' '1' - option 'tcp_transparent_proxy_mode' 'tproxy' - option 'udp_transparent_proxy_mode' 'tproxy' + option 'tcp_transparent_proxy_mode' 'redirect' + option 'udp_transparent_proxy_mode' 'tun' option 'ipv4_dns_hijack' '1' option 'ipv6_dns_hijack' '1' option 'ipv4_proxy' '1' @@ -33,7 +33,7 @@ config subscription 'subscription' option 'user_agent' 'clash' config mixin 'mixin' - option 'log_level' 'info' + option 'log_level' 'warning' option 'mode' 'rule' option 'match_process' 'off' option 'outbound_interface' '' @@ -68,7 +68,7 @@ config mixin 'mixin' option 'dns_doh_prefer_http3' '0' option 'dns_ipv6' '0' option 'dns_system_hosts' '0' - option 'dns_hosts' '0' + option 'dns_hosts' '1' option 'hosts' '0' option 'dns_nameserver' '0' option 'dns_nameserver_policy' '0' @@ -104,6 +104,12 @@ config nameserver list 'nameserver' 'https://dns.alidns.com/dns-query' list 'nameserver' 'https://doh.pub/dns-query' +config nameserver + option 'enabled' '1' + option 'type' 'direct-nameserver' + list 'nameserver' 'https://dns.alidns.com/dns-query' + list 'nameserver' 'https://doh.pub/dns-query' + config nameserver option 'enabled' '1' option 'type' 'nameserver' diff --git a/mihomo/files/mihomo.init b/mihomo/files/mihomo.init index 2aa23de7..475070df 100644 --- a/mihomo/files/mihomo.init +++ b/mihomo/files/mihomo.init @@ -148,13 +148,13 @@ start_service() { ui_path="ui" ui_name="$ui_name" ui_url="$ui_url" api_listen="0.0.0.0:$api_port" api_secret="$api_secret" \ allow_lan="$allow_lan" http_port="$http_port" socks_port="$socks_port" mixed_port="$mixed_port" redir_port="$redir_port" tproxy_port="$tproxy_port" \ tun_enable="$tun_enable" tun_stack="$tun_stack" tun_device="$TUN_DEVICE" tun_mtu="$tun_mtu" tun_gso="$tun_gso" tun_gso_max_size="$tun_gso_max_size" tun_endpoint_independent_nat="$tun_endpoint_independent_nat" \ - dns_enable="true" dns_listen="0.0.0.0:$dns_port" \ + dns_enable="true" dns_listen="0.0.0.0:$dns_port" dns_mode="$dns_mode" fake_ip_range="$fake_ip_range" \ yq -M -i ' .log-level = env(log_level) | .ipv6 = env(ipv6) == 1 | .external-ui = env(ui_path) | .external-ui-name = env(ui_name) | .external-ui-url = env(ui_url) | .external-controller = env(api_listen) | .secret = env(api_secret) | .allow-lan = env(allow_lan) == 1 | .port = env(http_port) | .socks-port = env(socks_port) | .mixed-port = env(mixed_port) | .redir-port = env(redir_port) | .tproxy-port = env(tproxy_port) | .tun.enable = env(tun_enable) == 1 | .tun.stack = env(tun_stack) | .tun.device = env(tun_device) | .tun.mtu = env(tun_mtu) | .tun.gso = env(tun_gso) == 1 | .tun.gso-max-size = env(tun_gso_max_size) | .tun.endpoint-independent-nat = env(tun_endpoint_independent_nat) == 1 | - .dns.enable = env(dns_enable) | .dns.listen = env(dns_listen) + .dns.enable = env(dns_enable) | .dns.listen = env(dns_listen) | .dns.enhanced-mode = env(dns_mode) | .dns.fake-ip-range = env(fake_ip_range) ' "$RUN_PROFILE_PATH" else log "Mixin is enabled, mixin all config."