OpenClash: sync with upstream source

This commit is contained in:
CN_SZTL 2020-02-29 04:54:49 +08:00
parent e866f4e02c
commit 453149115c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
11 changed files with 50 additions and 57 deletions

View File

@ -761,7 +761,7 @@ mkdir -p /var/etc
cat > "/var/etc/openclash.include" <<-EOF
/etc/init.d/openclash restart
EOF
iptables -t nat -I PREROUTING -p tcp --dport 53 -j ACCEPT
if [ -z "$en_mode_tun" ]; then
iptables -t nat -N openclash
iptables -t nat -A openclash -d 0.0.0.0/8 -j RETURN
@ -829,7 +829,7 @@ EOF
fi
echo "第九步: 重启 Dnsmasq 程序..." >$START_LOG
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep dpt:53 |wc -l)" -gt 2 ]; then
if [ "$(iptables -t nat -nL PREROUTING --line-number |grep "udp dpt:53" |wc -l)" -gt 1 ]; then
echo "发现53端口被劫持如连接异常请将OpenClash设置为劫持53端口程序的上游DNS服务器" >$START_LOG
echo "${LOGTIME} Warring: OpenClash May Can Not Take Over DNS, Please Use OpenClash for Upstream DNS Resolve Server" >> $LOG_FILE
sleep 5
@ -954,6 +954,7 @@ stop()
ip rule del fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" >/dev/null 2>&1
iptables -t mangle -D OUTPUT -j openclash >/dev/null 2>&1
iptables -t nat -D PREROUTING -p tcp --dport 53 -j ACCEPT >/dev/null 2>&1
iptables -t mangle -D PREROUTING -m set ! --match-set localnetwork dst -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
ip6tables -t mangle -D PREROUTING -j MARK --set-mark "$PROXY_FWMARK" >/dev/null 2>&1
iptables -t mangle -F openclash >/dev/null 2>&1

View File

@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/x-icon" href="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png" />
<title>Clash</title>
<link href="main.0bddb85299f970595cb5.css" rel="stylesheet"></head>
<link href="main.f302eae39f433a9c3fa1.css" rel="stylesheet"></head>
<body>
<div id="root"></div>
<script type="text/javascript" src="js/1.bundle.0bddb85299f970595cb5.min.js"></script><script type="text/javascript" src="js/bundle.0bddb85299f970595cb5.min.js"></script></body>
<script type="text/javascript" src="js/1.bundle.f302eae39f433a9c3fa1.min.js"></script><script type="text/javascript" src="js/bundle.f302eae39f433a9c3fa1.min.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,9 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
@ -19,14 +25,8 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license React v16.12.0
* react.production.min.js
/** @license React v0.18.0
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
@ -43,8 +43,8 @@ object-assign
* LICENSE file in the root directory of this source tree.
*/
/** @license React v0.18.0
* scheduler.production.min.js
/** @license React v16.12.0
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
@ -60,10 +60,3 @@ object-assign
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,10 +27,10 @@ if [ "$enable" -eq 1 ]; then
ip route replace default dev utun table "$PROXY_ROUTE_TABLE" 2>/dev/null
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" 2>/dev/null
elif [ "$en_mode" = "redir-host-vpn" ] || [ "$en_mode" = "fake-ip-vpn" ]; then
ip tuntap add user root mode tun clash0
ip link set clash0 up
ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE"
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE"
ip tuntap add user root mode tun clash0 2>/dev/null
ip link set clash0 up 2>/dev/null
ip route replace default dev clash0 table "$PROXY_ROUTE_TABLE" 2>/dev/null
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" 2>/dev/null
fi
/usr/share/openclash/openclash_history_set.sh
else

View File

@ -156,8 +156,7 @@
sed -i "/^dns:/i\tun:" "$7"
sed -i "/^dns:/i\ enable: true" "$7"
sed -i "/^dns:/i\ device-url: dev://clash0" "$7"
dns_port=$(uci get openclash.config.dns_port 2>/dev/null)
sed -i "/^dns:/i\ dns-listen: 0.0.0.0:${dns_port}" "$7"
sed -i "/^dns:/i\ dns-listen: 0.0.0.0:53" "$7"
fi
#添加自定义Hosts设置