diff --git a/README.md b/README.md index 5ea4df1..8864cc6 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,11 @@ opkg update && opkg install curl ##### ~Use curl:
```Shell +#by fastgit.org +export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null #by GitHub export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null -#by jsDelivrCDN +#by jsDelivr-CDN export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null ``` @@ -52,20 +54,13 @@ export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && wget export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null ``` -~**Use a low version of wget (prompt not to support https) local installation**:
First clone the project to the local under the window (or [click to download the project source code zip package](https://github.com/juewuy/ShellClash/archive/refs/heads/master.zip) to the local and decompress it) +~**Use a low version of wget (prompt not to support https) local installation**:
```Shell -sh git clone https://github.com/juewuy/ShellClash.git +#by shellclash.ga +export url='http://shellclash.ga/' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null ``` - Then open /project address/ShellClash/bin/hfs/hfs.exe Click menu-add directory from disk-{find the directory where ShellClash source code is located}-add as real directory Click on the menu-IP address-{choose the actual IP address of your LAN} Click ShellClash-click to copy to clipboard Then use the following command to install in SSH - -```Shell -sh export url='Paste the copied address here' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null -``` - - Later, when updating the version, you need to update the local version library and open the hfs service, and then update in the SSH menu, and then you can build a local server through hfs to realize the function of uploading and updating the yaml configuration file - ~**After installation by non-root users**, please execute the following additional commands to read environment variables:
```Shell diff --git a/README_CN.md b/README_CN.md index d00ae61..db2520c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -47,10 +47,14 @@ opkg update && opkg install curl #如已安装请忽略 ~**使用curl安装**:
```Shell +#fastgit.org加速 +export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null #GitHub源 export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null #jsDelivrCDN源 export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null +#作者私人源 +export url='https://shellclash.ga' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null ``` ~**使用wget安装**:
@@ -60,6 +64,8 @@ export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && sh -c "$(cu export url='https://raw.githubusercontent.com/juewuy/ShellClash/master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null #jsDelivrCDN源 export url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null +#作者私人源 +export url='http://shellclash.ga/' && wget -q -O /tmp/install.sh $url/install.sh && sh /tmp/install.sh && source /etc/profile &> /dev/null ``` ~**使用低版本wget(提示不支持https)安装**:
diff --git a/bin/clash.meta/clash-linux-amd64 b/bin/clash.meta/clash-linux-amd64 index 8a87021..6589374 100644 Binary files a/bin/clash.meta/clash-linux-amd64 and b/bin/clash.meta/clash-linux-amd64 differ diff --git a/bin/clash.meta/clash-linux-armv5 b/bin/clash.meta/clash-linux-armv5 index 2b7c51c..8af8ff8 100644 Binary files a/bin/clash.meta/clash-linux-armv5 and b/bin/clash.meta/clash-linux-armv5 differ diff --git a/bin/clash.meta/clash-linux-armv7 b/bin/clash.meta/clash-linux-armv7 index 39cf103..49bdfe8 100644 Binary files a/bin/clash.meta/clash-linux-armv7 and b/bin/clash.meta/clash-linux-armv7 differ diff --git a/bin/clash.meta/clash-linux-armv8 b/bin/clash.meta/clash-linux-armv8 index 107be94..8d00c09 100644 Binary files a/bin/clash.meta/clash-linux-armv8 and b/bin/clash.meta/clash-linux-armv8 differ diff --git a/bin/clash.meta/clash-linux-mips-softfloat b/bin/clash.meta/clash-linux-mips-softfloat index aaf0d81..eafebb9 100644 Binary files a/bin/clash.meta/clash-linux-mips-softfloat and b/bin/clash.meta/clash-linux-mips-softfloat differ diff --git a/bin/clash.meta/clash-linux-mipsle-hardfloat b/bin/clash.meta/clash-linux-mipsle-hardfloat index c31f70f..9eca092 100644 Binary files a/bin/clash.meta/clash-linux-mipsle-hardfloat and b/bin/clash.meta/clash-linux-mipsle-hardfloat differ diff --git a/bin/clash.meta/clash-linux-mipsle-softfloat b/bin/clash.meta/clash-linux-mipsle-softfloat index 76dff0d..fe61629 100644 Binary files a/bin/clash.meta/clash-linux-mipsle-softfloat and b/bin/clash.meta/clash-linux-mipsle-softfloat differ diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 0d35e66..3651c1d 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 0462781..592cffe 100644 --- a/bin/version +++ b/bin/version @@ -1,6 +1,6 @@ clashnet_v=v1.7.6 clashpre_v=2021.09.15 clash_v=v1.7.1 -versionsh=1.5.6fix -meta_v=1.10.0 GeoIP_v=20220405 +meta_v=alpha +versionsh=1.5.7 diff --git a/scripts/clash.sh b/scripts/clash.sh index 998f5e3..587dcb5 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -732,6 +732,7 @@ clashcfg(){ [ -z "$dns_mod" ] && dns_mod=redir_host [ -z "$dns_over" ] && dns_over=已开启 [ -z "$cn_ip_route" ] && cn_ip_route=未开启 + [ -z "$quic_rj" ] && quic_rj=未开启 [ -z "$(cat $clashdir/mac)" ] && mac_return=未开启 || mac_return=已启用 # echo ----------------------------------------------- @@ -743,9 +744,10 @@ clashcfg(){ echo -e " 4 只代理常用端口: \033[36m$common_ports\033[0m ————用于过滤P2P流量" echo -e " 5 过滤局域网设备: \033[36m$mac_return\033[0m ————使用黑/白名单进行过滤" echo -e " 6 设置本机代理服务: \033[36m$local_proxy\033[0m ————使本机流量经过clash内核" + echo -e " 7 屏蔽QUIC流量: \033[36m$quic_rj\033[0m ————优化视频性能" [ "$dns_mod" = "fake-ip" ] && \ - echo -e " 7 管理Fake-ip过滤列表" || \ - echo -e " 7 CN_IP绕过内核: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip" + echo -e " 8 管理Fake-ip过滤列表" || \ + echo -e " 8 CN_IP绕过内核: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip" echo ----------------------------------------------- echo -e " 0 返回上级菜单 \033[0m" echo ----------------------------------------------- @@ -782,7 +784,7 @@ clashcfg(){ elif [ "$num" = 4 ]; then echo ----------------------------------------------- - if [ "$common_ports" = "未开启" ] > /dev/null 2>&1; then + if [ "$common_ports" = "未开启" ]; then echo -e "\033[33m已设为仅代理【$multiport】等常用端口!!\033[0m" common_ports=已开启 else @@ -801,7 +803,23 @@ clashcfg(){ sleep 1 clashcfg - elif [ "$num" = 7 ]; then + elif [ "$num" = 7 ]; then + echo ----------------------------------------------- + if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" -o "$tproxy_mod" = "已开启" ];then + if [ "$quic_rj" = "未开启" ]; then + echo -e "\033[33m已禁止QUCI流量通过clash内核!!\033[0m" + quic_rj=已启用 + else + echo -e "\033[33m已取消禁止QUIC协议流量!!\033[0m" + quic_rj=未开启 + fi + setconfig quic_rj $quic_rj + else + echo -e "\033[33m当前模式默认不会代理UDP流量,无需设置!!\033[0m" + fi + clashcfg + + elif [ "$num" = 8 ]; then echo ----------------------------------------------- if [ "$dns_mod" = "fake-ip" ];then fake_ip_filter diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 8192a37..0ae0333 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -41,7 +41,7 @@ linkserver(){ echo 当前使用后端为:$server_link echo 1 api.dler.io (墙洞提供) echo 2 sub.shellclash.ga (作者提供) - echo 3 api.wcc.best (sub_web作者提供) + echo 3 sub.xeton.dev (SUB作者T大提供) echo 4 sub.id9.cc (品云提供) echo 5 sub.maoxiongnet.com (猫熊提供) echo ----------------------------------------------- @@ -749,7 +749,8 @@ setserver(){ echo -e " 2 \033[36m测试版\033[0m&Github源(本机clash服务加速)" echo -e " 3 \033[36m测试版\033[0m&Jsdelivr-CDN源" echo -e " 4 \033[36m测试版\033[0m&Github源(githubusercontents加速)" - [ -z "$(curl -V 2>/dev/null)" ] && [ -n "$(wget -V 2>&1 | grep BusyBox)" ] && echo -e " 5 \033[33mHttp专用源\033[0m" + echo -e " 4 \033[36m测试版\033[0m&Github源(fastgit.org加速)" + [ -z "$(curl -V 2>/dev/null)" ] && [ -n "$(wget -V 2>&1 | grep BusyBox)" ] && echo -e " 7 \033[33mHttp专用源\033[0m" echo -e " 8 自定义源地址(用于本地源或自建源)" echo -e " 9 \033[31m版本回退\033[0m" echo -e " 0 返回上级菜单" @@ -772,6 +773,10 @@ setserver(){ release_url='' saveserver elif [ "$num" = 5 ]; then + update_url='https://raw.fastgit.org/juewuy/ShellClash/master' + release_url='' + saveserver + elif [ "$num" = 7 ]; then update_url='http://shellclash.ga' release_url='' saveserver diff --git a/scripts/start.sh b/scripts/start.sh index 49ae9ef..6c898f7 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -144,7 +144,7 @@ getyaml(){ Server=`sed -n ""$server_link"p"</dev/null 2>&1 && { cat $yamlnew | grep -A 8 "\-\ name:" | xargs | sed 's/- name: /\n/g' | sed 's/ type: .*proxies: /#/g' | sed 's/ rules:.*//g' | sed 's/- //g' | grep -E '#DIRECT $' | awk -F '#' '{print $1}' > /tmp/clash_proxies_$USER while read line ;do sed -i "/- $line/d" $yamlnew sed -i "/- name: $line/,/- DIRECT/d" $yamlnew done < /tmp/clash_proxies_$USER rm -rf /tmp/clash_proxies_$USER + } #使用核心内置test功能检测 if [ -x $bindir/clash ];then $bindir/clash -t -d $bindir -f $yamlnew >/dev/null @@ -292,8 +294,8 @@ modify_yaml(){ external="external-controller: 0.0.0.0:$db_port" [ -d $clashdir/ui ] && db_ui=ui if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ];then - [ "$clashcore" = "clash.meta" ] && stack=gvisor || stack=system - tun="tun: {enable: true, stack: $stack}" + #[ "$clashcore" = "clash.meta" ] && stack=gvisor || stack=system + tun="tun: {enable: true, stack: system}" else tun='tun: {enable: false}' fi @@ -446,6 +448,11 @@ start_redir(){ iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash #Docker特殊处理 [ "$local_proxy" = "已开启" ] && iptables -t nat -I PREROUTING -s 172.16.0.0/12 -j clash + #禁用QUIC + if [ "$quic_rj" = 已启用 ] && [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" -o "$tproxy_mod" = "已开启" ];then + [ "$dns_mod" = "redir_host" -a "$cn_ip_route" = "已开启" ] && set_cn_ip='-m set ! --match-set cn_ip dst' + iptables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1 + fi #设置ipv6转发 ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain') if [ -n "$ip6_nat" -a "$ipv6_support" = "已开启" ];then @@ -613,6 +620,8 @@ stop_iptables(){ iptables -t mangle -D PREROUTING -p udp -j clash 2> /dev/null iptables -t mangle -F clash 2> /dev/null iptables -t mangle -X clash 2> /dev/null + iptables -D INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" -j REJECT >/dev/null 2>&1 + iptables -D INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" -m set ! --match-set cn_ip dst -j REJECT >/dev/null 2>&1 #重置ipv6规则 ip6tables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null ip6tables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null @@ -674,11 +683,12 @@ web_restore(){ done #发送数据 num=$(cat $clashdir/web_save | wc -l) - for i in `seq $num`; - do + i=1 + while [ "$i" -le "$num" ];do group_name=$(awk -F ',' 'NR=="'${i}'" {print $1}' $clashdir/web_save | sed 's/ /%20/g') now_name=$(awk -F ',' 'NR=="'${i}'" {print $2}' $clashdir/web_save) put_save http://localhost:${db_port}/proxies/${group_name} "{\"name\":\"${now_name}\"}" + i=$((i+1)) done } #启动相关 @@ -715,7 +725,7 @@ bfstart(){ else logger "未找到clash核心,正在下载!" 33 if [ -z "$clashcore" ];then - [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && clashcore=clash.meta || clashcore=clash + [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && clashcore=clashpre || clashcore=clash fi [ -z "$cpucore" ] && source $clashdir/getdate.sh && getcpucore [ -z "$cpucore" ] && logger 找不到设备的CPU信息,请手动指定处理器架构类型! 31 && setcpucore