Skip to content

Commit fc741a8

Browse files
committed
Merge branch 'dev'
2 parents f9cc20c + c2efe95 commit fc741a8

26 files changed

+7158
-6402
lines changed

.github/workflows/compile_meta_core.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- name: Setup loongarch abi1 Go
112112
run: |
113113
wget -q https://github.com/MetaCubeX/loongarch64-golang/releases/download/1.22.4/go1.22.4.linux-amd64-abi1.tar.gz
114-
sudo tar zxf go1.21.5.linux-amd64-abi1.tar.gz -C /usr/local
114+
sudo tar zxf go1.22.4.linux-amd64-abi1.tar.gz -C /usr/local
115115
echo "/usr/local/go/bin" >> $GITHUB_PATH
116116
117117
- name: Compile Meta loongarch abi1 Clash
@@ -127,7 +127,7 @@ jobs:
127127
- name: Setup loongarch abi2 Go
128128
run: |
129129
wget -q https://github.com/MetaCubeX/loongarch64-golang/releases/download/1.22.4/go1.22.4.linux-amd64-abi2.tar.gz
130-
sudo tar zxf go1.21.5.linux-amd64-abi2.tar.gz -C /usr/local
130+
sudo tar zxf go1.22.4.linux-amd64-abi2.tar.gz -C /usr/local
131131
132132
- name: Compile Meta loongarch abi2 Clash
133133
run: |

luci-app-openclash/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=luci-app-openclash
4-
PKG_VERSION:=0.46.031
4+
PKG_VERSION:=0.46.033
55
PKG_RELEASE:=beta
66
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
77

luci-app-openclash/luasrc/view/openclash/myip.htm

+23-5
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,28 @@
241241
return ip;
242242
})();
243243

244-
fetch(`https://qqwry.api.skk.moe/${anonymizedIp}`, {
244+
fetch(`https://api.ip.sb/geoip/${anonymizedIp}`, {
245245
referrerPolicy: 'no-referrer-when-downgrade',
246246
}).then(r => r.json())
247247
.then(resp => {
248-
$$.getElementById(elID).innerHTML = resp.geo;
248+
if ( resp.country && resp.country != '' && resp.isp && resp.isp != '' ) {
249+
$$.getElementById(elID).innerHTML = resp.country + ' ' + resp.isp;
250+
}
251+
else {
252+
fetch(`https://qqwry.api.skk.moe/${anonymizedIp}`, {
253+
referrerPolicy: 'no-referrer-when-downgrade',
254+
}).then(r => r.json())
255+
.then(resp => {
256+
if ( resp.geo.indexOf('skk.moe') == -1 ) {
257+
$$.getElementById(elID).innerHTML = resp.geo;
258+
}
259+
else {
260+
$$.getElementById(elID).innerHTML = 'Unknown';
261+
}
262+
})
263+
}
264+
//https://api.ip.sb/geoip/${anonymizedIp}
265+
//http://ip-api.com/json/${anonymizedIp}?lang=zh-CN
249266
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
250267
})
251268
},
@@ -370,7 +387,8 @@
370387
if (localStorage.getItem('privacy_my_ip') != 'true') {
371388
$$.getElementById('ip-ipsb').innerHTML = data.ip;
372389
};
373-
IP.parseIPIpip(data.ip, 'ip-ipsb-geo');
390+
//IP.parseIPIpip(data.ip, 'ip-ipsb-geo');
391+
$$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.isp}`;
374392
addTitleOnOverflow();
375393
};
376394

@@ -404,7 +422,7 @@
404422

405423
var sbipScript= document.createElement("script");
406424
sbipScript.defer = "defer";
407-
sbipScript.src=`https://api-ipv4.ip.sb/jsonip?callback=getIpsbIP&z=${random}`;
425+
sbipScript.src=`https://api-ipv4.ip.sb/geoip?callback=getIpsbIP&z=${random}`;
408426
mypage.appendChild(sbipScript);
409427

410428
//HTTP.runcheck();
@@ -486,6 +504,6 @@
486504
document.write('<script defer="defer" src="https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
487505
</script>
488506
<script type="text/javascript">
489-
document.write('<script defer="defer" src="https://api-ipv4.ip.sb/jsonip?callback=getIpsbIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
507+
document.write('<script defer="defer" src="https://api-ipv4.ip.sb/geoip?callback=getIpsbIP&z='+parseInt(Math.random() * 100000000)+'" type="text/javascript"><\/script>');
490508
</script>
491509
</html>

luci-app-openclash/po/zh-cn/openclash.zh-cn.po

+4-1
Original file line numberDiff line numberDiff line change
@@ -3394,4 +3394,7 @@ msgid "ECS Override"
33943394
msgstr "ECS 区域地址覆盖"
33953395

33963396
msgid "Override the ECS Subnet Address"
3397-
msgstr "强制覆盖 DNS 查询的子网区域地址"
3397+
msgstr "强制覆盖 DNS 查询的子网区域地址"
3398+
3399+
msgid "Tip: Respect-rules Option Need Proxy-server-nameserver Option Must Be Setted, Auto Set to"
3400+
msgstr "提示:使用 Respect-rules 功能时 Proxy-server-nameserver 必须配置,插件将默认将其设置为"

luci-app-openclash/root/etc/init.d/openclash

+29-16
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,9 @@ if [ -n "$FW4" ]; then
15961596
elif [ "$enable_redirect_dns" -eq 1 ]; then
15971597
nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv4} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\"
15981598
fi
1599+
if [ "$router_self_proxy" = 1 ]; then
1600+
nft insert rule inet fw4 nat_output position 0 skuid != 65534 meta nfproto {ipv4} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\"
1601+
fi
15991602

16001603
#TUN FORWORD
16011604
nft insert rule inet fw4 forward position 0 meta l4proto {tcp,udp} oifname utun counter accept comment \"OpenClash TUN Forward\"
@@ -1663,14 +1666,16 @@ if [ -n "$FW4" ]; then
16631666
fi
16641667
fi
16651668
fi
1666-
if [ "$en_mode" = "fake-ip" ] && [ "$china_ip_route" != "0" ] && [ "$enable_redirect_dns" != "2" ]; then
1667-
nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} tcp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\"
1668-
nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} udp dport 53 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\"
1669-
nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }'
1670-
nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\"
1671-
nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 53 meta skuid != 65534 counter redirect to "$dns_port" comment \"OpenClash DNS Hijack\"
1672-
nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} tcp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\"
1673-
nft add rule inet fw4 nat_output position 0 meta nfproto {ipv6} udp dport 12353 meta skuid != 65534 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\"
1669+
1670+
if [ "$enable_redirect_dns" -eq 2 ]; then
1671+
local position=$(nft -a list chain inet fw4 openclash_dns_redirect |grep "DNS" |grep -v "redirect" |awk -F '# handle ' '{print$2}' |sort -rn |head -1)
1672+
[ -z "$position" ] && position=0
1673+
nft insert rule inet fw4 openclash_dns_redirect position "$position" meta nfproto {ipv6} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\"
1674+
elif [ "$enable_redirect_dns" -eq 1 ]; then
1675+
nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\"
1676+
fi
1677+
if [ "$router_self_proxy" = 1 ]; then
1678+
nft insert rule inet fw4 nat_output position 0 skuid != 65534 meta nfproto {ipv6} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\"
16741679
fi
16751680

16761681
if [ "$china_ip6_route" != "0" ] || [ "$disable_udp_quic" = "1" ]; then
@@ -2378,6 +2383,9 @@ if [ -z "$FW4" ]; then
23782383
elif [ "$enable_redirect_dns" -eq 1 ]; then
23792384
iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT
23802385
fi
2386+
if [ "$router_self_proxy" = 1 ]; then
2387+
iptables -t nat -I OUTPUT -m owner ! --uid-owner 65534 -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT
2388+
fi
23812389

23822390
#TUN FORWORD
23832391
iptables -I FORWARD -m comment --comment "OpenClash TUN Forward" -o utun -j ACCEPT >/dev/null 2>&1
@@ -2446,15 +2454,20 @@ if [ -z "$FW4" ]; then
24462454
fi
24472455
fi
24482456
fi
2449-
if [ "$en_mode" = "fake-ip" ] && [ "$china_ip_route" != "0" ] && [ "$enable_redirect_dns" != "2" ]; then
2450-
ip6tables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack"
2451-
ip6tables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack"
2452-
ip6tables -t nat -I OUTPUT -p udp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack"
2453-
ip6tables -t nat -I OUTPUT -p tcp --dport 53 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$dns_port" -m comment --comment "OpenClash DNS Hijack"
2454-
ip6tables -t nat -I OUTPUT -p udp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack"
2455-
ip6tables -t nat -I OUTPUT -p tcp --dport 12353 -m owner ! --uid-owner 65534 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack"
2456-
fi
24572457

2458+
if [ "$ipv6_mode" -eq 2 ]; then
2459+
if [ "$enable_redirect_dns" -eq 2 ]; then
2460+
local position=$(ip6tables -nvL openclash_dns_redirect -t nat |grep "DNS" |grep -v "REDIRECT" |wc -l)
2461+
let position++
2462+
ip6tables -t nat -I openclash_dns_redirect "$position" -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT
2463+
elif [ "$enable_redirect_dns" -eq 1 ]; then
2464+
ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT
2465+
fi
2466+
if [ "$router_self_proxy" = 1 ]; then
2467+
ip6tables -t nat -I OUTPUT -p tcp --dport 53 -d ::/0 -m owner ! --uid-owner 65534 -j ACCEPT -m comment --comment "OpenClash DNS Hijack"
2468+
fi
2469+
fi
2470+
24582471
if [ "$china_ip6_route" != "0" ] || [ "$disable_udp_quic" = "1" ]; then
24592472
ipset -! flush china_ip6_route
24602473
ipset -! restore </etc/openclash/china_ip6_route.ipset

luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-C_o5p4_0.js luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Config-mfHMd71S.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

luci-app-openclash/root/usr/share/openclash/ui/metacubexd/assets/Connections-C4lDijqW.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)