Skip to content

Commit

Permalink
Merge pull request morytyann#229 from morytyann/v1.8.6
Browse files Browse the repository at this point in the history
v1.8.6
  • Loading branch information
morytyann authored Oct 10, 2024
2 parents 722bb16 + 113ca0a commit f0b2af8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
2 changes: 1 addition & 1 deletion luci-app-mihomo/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 20 additions & 11 deletions luci-app-mihomo/htdocs/luci-static/resources/view/mihomo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -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'));
Expand Down Expand Up @@ -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;
Expand All @@ -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'));
Expand All @@ -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;
Expand All @@ -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' });
Expand Down Expand Up @@ -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;
Expand All @@ -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');

Expand All @@ -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;
Expand Down Expand Up @@ -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');
Expand Down
14 changes: 10 additions & 4 deletions mihomo/files/mihomo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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' ''
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions mihomo/files/mihomo.init
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit f0b2af8

Please sign in to comment.