mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-04 06:33:56 +08:00
update 2026-09-12 22:51:39
This commit is contained in:
1 parent
7497dff620
commit
aff13cf0c6
37 files changed
+2830
-1321
No files matched your search
@@ -608,6 +608,7 @@ prepare_clash_runtime_config() {
|
||||
local dns_mode
|
||||
local client_policy_stats
|
||||
local client_rules
|
||||
local enable_fake_ip
|
||||
|
||||
cache_file="$(get_clash_cache_file "$sid")"
|
||||
workdir="$(get_clash_workdir "$sid")"
|
||||
@@ -623,6 +624,7 @@ prepare_clash_runtime_config() {
|
||||
dns_mode="$(uci_get_by_type global pdnsd_enable 0)"
|
||||
client_policy_stats=""
|
||||
client_rules=0
|
||||
enable_fake_ip="$(uci_get_by_type server_subscribe enable_fake_ip "")"
|
||||
|
||||
[ -s "$cache_file" ] || return 1
|
||||
|
||||
@@ -640,15 +642,33 @@ prepare_clash_runtime_config() {
|
||||
routing-mark: $CLASH_OUTBOUND_MARK
|
||||
profile:
|
||||
store-selected: true
|
||||
store-fake-ip: true
|
||||
tun:
|
||||
enable: false
|
||||
dns:
|
||||
enable: $( [ "$dns_mode" = "7" ] && echo "true" || echo "false" )
|
||||
enhanced-mode: redir-host
|
||||
listen: 127.0.0.1:$dns_port
|
||||
ipv6: $( [ "$dns_ipv4_only" = "1" ] && echo "false" || echo "true" )
|
||||
EOF
|
||||
|
||||
# 根据 dns_mode 添加不同的 dns 配置
|
||||
if [ "$dns_mode" = "7" ]; then
|
||||
# 根据 enable_fake_ip 决定 enhanced-mode
|
||||
if [ "$enable_fake_ip" = "1" ]; then
|
||||
ENHANCED_MODE="fake-ip"
|
||||
else
|
||||
ENHANCED_MODE="redir-host"
|
||||
fi
|
||||
cat >> "$overlay_file" <<-EOF
|
||||
dns:
|
||||
enable: true
|
||||
enhanced-mode: $ENHANCED_MODE
|
||||
listen: 127.0.0.1:$dns_port
|
||||
ipv6: $( [ "$dns_ipv4_only" = "1" ] && echo "false" || echo "true" )
|
||||
EOF
|
||||
else
|
||||
cat >> "$overlay_file" <<-EOF
|
||||
dns:
|
||||
enable: false
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ -n "$socks_port" ] && [ "$socks_port" != "0" ]; then
|
||||
echo "socks-port: $socks_port" >>"$overlay_file"
|
||||
fi
|
||||
@@ -1230,14 +1250,24 @@ start_dns() {
|
||||
ssrplus_dns="$(uci_get_by_type global pdnsd_enable 0)"
|
||||
global_server_type="$(uci_get_by_name "$GLOBAL_SERVER" type)"
|
||||
builtin_dns_enabled=0
|
||||
dnsserver="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
|
||||
|
||||
if [ "$ssrplus_dns" = "5" ]; then
|
||||
ssrplus_dns="$(force_dns2tcp_fallback "旧版 DNSPROXY 模式已移除")" || return 1
|
||||
uci_set_by_type global pdnsd_enable "$ssrplus_dns"
|
||||
elif [ "$ssrplus_dns" = "6" ]; then
|
||||
dnsserver="$(uci_get_by_type global chinadns_ng_tunnel_forward 8.8.4.4:53)"
|
||||
fi
|
||||
case "$ssrplus_dns" in
|
||||
1)
|
||||
dnsserver="$(uci_get_by_type global dns2tcp_tunnel_forward 8.8.4.4:53)"
|
||||
;;
|
||||
6)
|
||||
dnsserver="$(uci_get_by_type global chinadns_ng_tunnel_forward 8.8.4.4:53)"
|
||||
;;
|
||||
7)
|
||||
dnsserver="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
run_mode="$(normalize_run_mode)"
|
||||
|
||||
if [ "$ssrplus_dns" = "4" ] && ! is_finded "mosdns"; then
|
||||
@@ -1503,15 +1533,15 @@ generate_xray_config() {
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [$inbound_json],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"inbounds": [$inbound_json],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
return 0
|
||||
}
|
||||
@@ -2887,12 +2917,18 @@ start_rules() {
|
||||
local ac_ips
|
||||
local custom_ports
|
||||
local proxyport
|
||||
local enable_fake_ip
|
||||
|
||||
server=$(get_host_ip "$GLOBAL_SERVER")
|
||||
local_port=$(get_default_node_local_port)
|
||||
lan_ac_ips=$(uci_get_by_type access_control lan_ac_ips)
|
||||
lan_ac_mode=$(uci_get_by_type access_control lan_ac_mode)
|
||||
|
||||
enable_fake_ip=$(uci_get_by_type server_subscribe enable_fake_ip "")
|
||||
if [ -z "$enable_fake_ip" ]; then
|
||||
enable_fake_ip="0"
|
||||
fi
|
||||
|
||||
if [ "$kcp_enable_flag" = "0" ] && [ "$redir_udp" = "1" ]; then
|
||||
udp_server=$(get_host_ip "$UDP_RELAY_SERVER")
|
||||
udp_local_port=$tmp_udp_port
|
||||
@@ -2937,26 +2973,27 @@ start_rules() {
|
||||
fi
|
||||
elif [ "$USE_TABLES" = "iptables" ]; then
|
||||
ARG_A=""
|
||||
fi
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh
|
||||
/usr/bin/ssr-rules \
|
||||
-s "$server" \
|
||||
-l "$local_port" \
|
||||
-S "$udp_server" \
|
||||
-L "$udp_local_port" \
|
||||
-a "$ac_ips" \
|
||||
-i "/etc/ssrplus/china_ssr.txt" \
|
||||
-b "$(uci_get_by_type access_control wan_bp_ips)" \
|
||||
-w "$(uci_get_by_type access_control wan_fw_ips)" \
|
||||
-B "$(uci_get_by_type access_control lan_bp_ips)" \
|
||||
-p "$(uci_get_by_type access_control lan_fp_ips)" \
|
||||
-G "$(uci_get_by_type access_control lan_gm_ips)" \
|
||||
-m "$(uci_get_by_type access_control Interface)" \
|
||||
-D "$proxyport" \
|
||||
"$(get_arg_out)" "$(gfwmode)" "$ARG_UDP" "$ARG_UDP_RULES" "$ARG_A"
|
||||
fi
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh
|
||||
/usr/bin/ssr-rules \
|
||||
-s "$server" \
|
||||
-l "$local_port" \
|
||||
-S "$udp_server" \
|
||||
-L "$udp_local_port" \
|
||||
-a "$ac_ips" \
|
||||
-i "/etc/ssrplus/china_ssr.txt" \
|
||||
-b "$(uci_get_by_type access_control wan_bp_ips)" \
|
||||
-w "$(uci_get_by_type access_control wan_fw_ips)" \
|
||||
-B "$(uci_get_by_type access_control lan_bp_ips)" \
|
||||
-p "$(uci_get_by_type access_control lan_fp_ips)" \
|
||||
-G "$(uci_get_by_type access_control lan_gm_ips)" \
|
||||
-m "$(uci_get_by_type access_control Interface)" \
|
||||
-D "$proxyport" \
|
||||
-E "$enable_fake_ip" \
|
||||
"$(get_arg_out)" "$(gfwmode)" "$ARG_UDP" "$ARG_UDP_RULES" "$ARG_A"
|
||||
|
||||
return $?
|
||||
}
|
||||
return $?
|
||||
}
|
||||
|
||||
start() {
|
||||
local run_mode
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
*.lan
|
||||
*.localdomain
|
||||
*.example
|
||||
*.invalid
|
||||
*.localhost
|
||||
*.test
|
||||
*.local
|
||||
*.home.arpa
|
||||
time.*.com
|
||||
time.*.gov
|
||||
time.*.edu.cn
|
||||
time.*.apple.com
|
||||
time1.*.com
|
||||
time2.*.com
|
||||
time3.*.com
|
||||
time4.*.com
|
||||
time5.*.com
|
||||
time6.*.com
|
||||
time7.*.com
|
||||
ntp.*.com
|
||||
ntp1.*.com
|
||||
ntp2.*.com
|
||||
ntp3.*.com
|
||||
ntp4.*.com
|
||||
ntp5.*.com
|
||||
ntp6.*.com
|
||||
ntp7.*.com
|
||||
*.time.edu.cn
|
||||
*.ntp.org.cn
|
||||
+.pool.ntp.org
|
||||
time1.cloud.tencent.com
|
||||
stun.*.*
|
||||
stun.*.*.*
|
||||
swscan.apple.com
|
||||
mesu.apple.com
|
||||
music.163.com
|
||||
*.music.163.com
|
||||
*.126.net
|
||||
musicapi.taihe.com
|
||||
music.taihe.com
|
||||
songsearch.kugou.com
|
||||
trackercdn.kugou.com
|
||||
*.kuwo.cn
|
||||
api-jooxtt.sanook.com
|
||||
api.joox.com
|
||||
y.qq.com
|
||||
*.y.qq.com
|
||||
streamoc.music.tc.qq.com
|
||||
mobileoc.music.tc.qq.com
|
||||
isure.stream.qqmusic.qq.com
|
||||
dl.stream.qqmusic.qq.com
|
||||
aqqmusic.tc.qq.com
|
||||
amobile.music.tc.qq.com
|
||||
localhost.ptlogin2.qq.com
|
||||
*.msftconnecttest.com
|
||||
*.msftncsi.com
|
||||
*.xiami.com
|
||||
*.music.migu.cn
|
||||
music.migu.cn
|
||||
+.wotgame.cn
|
||||
+.wggames.cn
|
||||
+.wowsgame.cn
|
||||
+.wargaming.net
|
||||
*.*.*.srv.nintendo.net
|
||||
*.*.stun.playstation.net
|
||||
xbox.*.*.microsoft.com
|
||||
*.*.xboxlive.com
|
||||
*.ipv6.microsoft.com
|
||||
teredo.*.*.*
|
||||
teredo.*.*
|
||||
speedtest.cros.wr.pvp.net
|
||||
+.jjvip8.com
|
||||
www.douyu.com
|
||||
activityapi.huya.com
|
||||
activityapi.huya.com.w.cdngslb.com
|
||||
www.bilibili.com
|
||||
api.bilibili.com
|
||||
a.w.bilicdn1.com
|
||||
@@ -0,0 +1,9 @@
|
||||
+.google.com
|
||||
+.facebook.com
|
||||
+.youtube.com
|
||||
+.twitter.com
|
||||
+.telegram.org
|
||||
+.githubusercontent.com
|
||||
+.googlevideo.com
|
||||
+.msftconnecttest.com
|
||||
+.msftncsi.com
|
||||
@@ -0,0 +1,15 @@
|
||||
0.0.0.0/8
|
||||
10.0.0.0/8
|
||||
100.64.0.0/10
|
||||
127.0.0.0/8
|
||||
169.254.0.0/16
|
||||
172.16.0.0/12
|
||||
192.0.0.0/24
|
||||
192.0.2.0/24
|
||||
192.88.99.0/24
|
||||
192.168.0.0/16
|
||||
198.51.100.0/24
|
||||
203.0.113.0/24
|
||||
224.0.0.0/4
|
||||
240.0.0.0/4
|
||||
255.255.255.255/32
|
||||
@@ -39,6 +39,18 @@ if [ -s "/etc/config/shadowsocksr" ]; then
|
||||
uci -q set shadowsocksr.@server_subscribe[0].auto_update_min_time='0'
|
||||
fi
|
||||
|
||||
if ! uci -q get shadowsocksr.@server_subscribe[0].enable_mihomo > /dev/null; then
|
||||
uci -q set shadowsocksr.@server_subscribe[0].enable_mihomo='1'
|
||||
fi
|
||||
|
||||
if ! uci -q get shadowsocksr.@server_subscribe[0].enable_fake_ip > /dev/null; then
|
||||
uci -q set shadowsocksr.@server_subscribe[0].enable_fake_ip='1'
|
||||
fi
|
||||
|
||||
if ! uci -q get shadowsocksr.@server_subscribe[0].sub_convert > /dev/null; then
|
||||
uci -q set shadowsocksr.@server_subscribe[0].sub_convert='1'
|
||||
fi
|
||||
|
||||
if ! uci -q get shadowsocksr.@server_subscribe[0].config_auto_update_mode > /dev/null; then
|
||||
uci -q set shadowsocksr.@server_subscribe[0].config_auto_update_mode='0'
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user