parent
235486252b
commit
709e3d9780
@ -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
|
||||
|
@ -98,6 +98,12 @@ config mixin 'mixin'
|
||||
option 'geox_update_interval' '24'
|
||||
option 'mixin_file_content' '0'
|
||||
|
||||
config env 'env'
|
||||
option 'disable_safe_path_check' '0'
|
||||
option 'disable_loopback_detector' '0'
|
||||
option 'disable_quic_go_gso' '0'
|
||||
option 'disable_quic_go_ecn' '0'
|
||||
|
||||
config authentication
|
||||
option 'enabled' '1'
|
||||
option 'username' 'mihomo'
|
||||
|
@ -131,6 +131,12 @@ start_service() {
|
||||
### mixin file content
|
||||
local mixin_file_content
|
||||
config_get_bool mixin_file_content "mixin" "mixin_file_content" 0
|
||||
## environment variable
|
||||
local disable_safe_path_check disable_loopback_detector disable_quic_go_gso disable_quic_go_ecn
|
||||
config_get_bool disable_safe_path_check "env" "disable_safe_path_check" 0
|
||||
config_get_bool disable_loopback_detector "env" "disable_loopback_detector" 0
|
||||
config_get_bool disable_quic_go_gso "env" "disable_quic_go_gso" 0
|
||||
config_get_bool disable_quic_go_ecn "env" "disable_quic_go_ecn" 0
|
||||
# prepare
|
||||
local tproxy_enable; tproxy_enable=0
|
||||
if [[ "$tcp_transparent_proxy_mode" == "tproxy" || "$udp_transparent_proxy_mode" == "tproxy" ]]; then
|
||||
@ -273,6 +279,7 @@ start_service() {
|
||||
|
||||
procd_set_param command /bin/sh -c "$PROG -d $RUN_DIR >> $CORE_LOG_PATH 2>&1"
|
||||
procd_set_param file "$RUN_PROFILE_PATH"
|
||||
procd_set_param env SKIP_SAFE_PATH_CHECK="$disable_safe_path_check" DISABLE_LOOPBACK_DETECTOR="$disable_loopback_detector" QUIC_GO_DISABLE_GSO="$disable_quic_go_gso" QUIC_GO_DISABLE_ECN="$disable_quic_go_ecn"
|
||||
if [ "$fast_reload" == 1 ]; then
|
||||
procd_set_param reload_signal HUP
|
||||
fi
|
||||
|
@ -21,23 +21,33 @@ acl_tcp_dport=$(uci -q get mihomo.proxy.acl_tcp_dport); [ -n "$acl_tcp_dport" ]
|
||||
acl_udp_dport=$(uci -q get mihomo.proxy.acl_udp_dport); [ -n "$acl_udp_dport" ] && uci rename mihomo.proxy.acl_udp_dport=proxy_udp_dport
|
||||
|
||||
bypass_user=$(uci -q get mihomo.proxy.bypass_user); [ -z "$bypass_user" ] && {
|
||||
uci add_list mihomo.proxy.bypass_user="aria2"
|
||||
uci add_list mihomo.proxy.bypass_user="dnsmasq"
|
||||
uci add_list mihomo.proxy.bypass_user="ftp"
|
||||
uci add_list mihomo.proxy.bypass_user="logd"
|
||||
uci add_list mihomo.proxy.bypass_user="nobody"
|
||||
uci add_list mihomo.proxy.bypass_user="ntp"
|
||||
uci add_list mihomo.proxy.bypass_user="ubus"
|
||||
uci add_list mihomo.proxy.bypass_user=aria2
|
||||
uci add_list mihomo.proxy.bypass_user=dnsmasq
|
||||
uci add_list mihomo.proxy.bypass_user=ftp
|
||||
uci add_list mihomo.proxy.bypass_user=logd
|
||||
uci add_list mihomo.proxy.bypass_user=nobody
|
||||
uci add_list mihomo.proxy.bypass_user=ntp
|
||||
uci add_list mihomo.proxy.bypass_user=ubus
|
||||
}
|
||||
|
||||
bypass_group=$(uci -q get mihomo.proxy.bypass_group); [ -z "$bypass_group" ] && {
|
||||
uci add_list mihomo.proxy.bypass_group="aria2"
|
||||
uci add_list mihomo.proxy.bypass_group="dnsmasq"
|
||||
uci add_list mihomo.proxy.bypass_group="ftp"
|
||||
uci add_list mihomo.proxy.bypass_group="logd"
|
||||
uci add_list mihomo.proxy.bypass_group="nogroup"
|
||||
uci add_list mihomo.proxy.bypass_group="ntp"
|
||||
uci add_list mihomo.proxy.bypass_group="ubus"
|
||||
uci add_list mihomo.proxy.bypass_group=aria2
|
||||
uci add_list mihomo.proxy.bypass_group=dnsmasq
|
||||
uci add_list mihomo.proxy.bypass_group=ftp
|
||||
uci add_list mihomo.proxy.bypass_group=logd
|
||||
uci add_list mihomo.proxy.bypass_group=nogroup
|
||||
uci add_list mihomo.proxy.bypass_group=ntp
|
||||
uci add_list mihomo.proxy.bypass_group=ubus
|
||||
}
|
||||
|
||||
# since v1.12.0
|
||||
|
||||
env=$(uci -q get mihomo.env); [ -z "$env" ] && {
|
||||
uci set mihomo.env=env
|
||||
uci set mihomo.env.disable_safe_path_check=0
|
||||
uci set mihomo.env.disable_loopback_detector=0
|
||||
uci set mihomo.env.disable_quic_go_gso=0
|
||||
uci set mihomo.env.disable_quic_go_ecn=0
|
||||
}
|
||||
|
||||
# commit
|
||||
|
Loading…
Reference in New Issue
Block a user