From c6d17d5742f16cf9f713ecd4db0a5df97d1acf34 Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 5 Dec 2022 20:46:56 +0800 Subject: [PATCH] =?UTF-8?q?v1.6.11c=20~=E6=97=A5=E5=BF=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E9=80=9A=E9=81=93=20=20=20=C2=B7Telegram=E6=8E=A8?= =?UTF-8?q?=E9=80=81=20=20=20=C2=B7Bark=E6=8E=A8=E9=80=81=20=20=20=C2=B7Pu?= =?UTF-8?q?shover=E6=8E=A8=E9=80=81=20~=E6=96=B0=E6=89=8B=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E4=BC=98=E5=8C=96=20~ipv6=E6=94=AF=E6=8C=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20~=E4=BC=98=E5=8C=96=E5=86=85=E6=A0=B8=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=81=E7=A7=BB=E9=99=A4.net=E5=86=85=E6=A0=B8=20~?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD=E7=9B=B8?= =?UTF-8?q?=E5=85=B3bug=20~=E4=BF=AE=E5=A4=8Dipv6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 29 +++++++++++++++++++++++ scripts/clash.sh | 4 +++- scripts/getdate.sh | 26 +++++++++----------- scripts/start.sh | 34 +++++++++++++-------------- 4 files changed, 59 insertions(+), 34 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..331953e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,29 @@ +name: Bug report +description: Create a report to help us improve +title: "[Bug] " +body: + - type: checkboxes + id: ensure + attributes: + label: Verify steps + description: " +在提交之前,请确认 +Please verify that you've followed these steps +" + options: + - label: " +我已经在 [Issue Tracker](……/) 中找过我要提出的问题 +I have searched on the [issue tracker](……/) for a related issue. +" + required: true + - label: " +我已经使用 公测版本测试过,问题依旧存在 +I have tested using the test mod, and the issue still exists. +" + required: true + - label: " +我已经仔细看过 [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) 并无法自行解决问题 +I have read the [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) and was unable to solve the issue. +" + required: true + - label: " diff --git a/scripts/clash.sh b/scripts/clash.sh index 71cf94a..70345a5 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -503,12 +503,14 @@ setipv6(){ if [ "$ipv6_redir" = "未开启" ]; then echo -e "如果启用后导致部分应用加载缓慢,请关闭此功能即可恢复" echo -e "\033[31m除非特殊需要,否则无需开启此功能!\033[0m" + ipv6_support=已开启 ipv6_redir=已开启 sleep 2 else ipv6_redir=未开启 fi setconfig ipv6_redir $ipv6_redir + setconfig ipv6_support $ipv6_support setipv6 ;; 3) @@ -947,7 +949,7 @@ clashcfg(){ set_redir_config elif [ "$num" = 7 ]; then - if modprobe nft_tproxy &>/dev/null;then + if [ -n "$(lsmod | grep 'nft_tproxy')" ];then redir_mod=Nft混合 else read -p "未检测到Tproxy模块,是否强制开启?可能导致无法联网!(1/0)" res diff --git a/scripts/getdate.sh b/scripts/getdate.sh index a93c674..4ff3fb9 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -473,21 +473,21 @@ setcore(){ ### echo ----------------------------------------------- [ -z "$cpucore" ] && getcpucore - echo -e "当前clash核心:\033[47;30m $clashcore \033[46;30m$clashv\033[0m" + echo -e "当前clash核心:\033[42;30m $clashcore \033[47;30m$clashv\033[0m" echo -e "当前系统处理器架构:\033[32m $cpucore \033[0m" echo -e "\033[33m请选择需要使用的核心版本!\033[0m" echo ----------------------------------------------- - echo "1 clash: 稳定,内存占用小,推荐!" - echo "(官方正式版) 不支持Tun模式、混合模式" + echo -e "1 \033[43;30m Clash \033[0m: \033[32m占用低\033[0m" + echo -e " (官方基础版) \033[33m不支持Tun、Rule-set等\033[0m" + echo -e " 说明文档: \033[36;4mhttps://lancellc.gitbook.io\033[0m" echo - echo "2 clashpre: 支持Tun模式、混合模式" - echo "(高级预览版) 内存占用更高" + echo -e "2 \033[43;30m Clashpre \033[0m: \033[32m支持Tun、Rule-set、域名嗅探\033[0m" + echo -e " (官方高级版) \033[33m不支持vless、hy协议\033[0m" + echo -e " 说明文档: \033[36;4mhttps://lancellc.gitbook.io\033[0m" echo - echo "3 clash.net: 支持部分vless协议" - echo "(.net定制版) 第三方定制内核" - echo - echo "4 clash.meta:支持大部分vless协议" - echo "(meta定制版) 第三方定制内核" + echo -e "3 \033[43;30mClash.Meta\033[0m: \033[32m多功能,支持最全面\033[0m" + echo -e " (Meta定制版) \033[33m第三方定制内核\033[0m" + echo -e " 说明文档: \033[36;4mhttps://docs.metacubex.one\033[0m" echo echo "5 手动指定处理器架构" echo ----------------------------------------------- @@ -506,10 +506,6 @@ setcore(){ version=$clashpre_v getcore elif [ "$num" = 3 ]; then - clashcore=clash.net - version=$clashnet_v - getcore - elif [ "$num" = 4 ]; then clashcore=clash.meta version=$meta_v getcore @@ -1126,7 +1122,7 @@ testcommand(){ iptables -t mangle -L PREROUTING --line-numbers iptables -t mangle -L clash --line-numbers } - [ -n "$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')" -a "$ipv6_support" = "已开启" ] && { + [ -n "$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')" -a "$ipv6_redir" = "已开启" ] && { echo -------------------Redir--------------------- ip6tables -t nat -L PREROUTING --line-numbers ip6tables -t nat -L clashv6_dns --line-numbers diff --git a/scripts/start.sh b/scripts/start.sh index 364158b..f1afb18 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -59,22 +59,22 @@ logger(){ curl_data="-d chat_id=$chat_ID&text=$log_text" wget_data="--post-data=$chat_ID&text=$log_text" if curl --version &> /dev/null;then - curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" >/dev/null + curl -kfsSl -d "chat_id=$chat_ID&text=$log_text" "$url" &>/dev/null else - wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url" + wget -Y on -q --post-data="chat_id=$chat_ID&text=$log_text" "$url" fi } [ -n "$push_bark" ] && { url=${push_bark}/${log_text} if curl --version &> /dev/null;then - curl -kfsSl "$url" >/dev/null + curl -kfsSl "$url" &>/dev/null else - wget -Y on -q "$url" + wget -Y on -q "$url" fi } [ -n "$push_Po" ] && { url=https://api.pushover.net/1/messages.json - curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" >/dev/null + curl -kfsSl --form-string "token=$push_Po" --form-string "user=$push_Po_key" --form-string "message=$log_text" "$url" &>/dev/null } } croncmd(){ @@ -343,12 +343,12 @@ $exper $dns $sniffer_set store-selected: $restore -hosts: EOF ################################### #读取本机hosts并生成配置文件 hosts_dir=/etc/hosts if [ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && [ -f $hosts_dir ];then + echo 'hosts:' >> $tmpdir/hosts.yaml while read line;do [ -n "$(echo "$line" | grep -oE "([0-9]{1,3}[\.]){3}" )" ] && \ [ -z "$(echo "$line" | grep -oE '^#')" ] && \ @@ -583,8 +583,7 @@ start_tproxy(){ iptables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1 } #设置ipv6转发 - ip6_nat=$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain') - [ -n "$ip6_nat" -a "$ipv6_redir" = "已开启" ] && { + [ "$ipv6_redir" = "已开启" ] && { ip -6 rule add fwmark 1 table 101 ip -6 route add local ::/0 dev lo table 101 ip6tables -t mangle -N clashv6 @@ -608,7 +607,7 @@ start_tproxy(){ ip6tables -t mangle -A PREROUTING -p $1 $ports -j clashv6 } [ "$1" = "all" ] && tproxy_set6 tcp - #tproxy_set6 udp + tproxy_set6 udp [ "$quic_rj" = 已启用 ] && { ip6tables -I INPUT -p udp --dport 443 -m comment --comment "ShellClash QUIC REJECT" $set_cn_ip -j REJECT >/dev/null 2>&1 } @@ -820,6 +819,7 @@ stop_firewall(){ ip6tables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null #tproxy ip6tables -t mangle -D PREROUTING -p tcp $ports -j clashv6 2> /dev/null + ip6tables -t mangle -D PREROUTING -p udp $ports -j clashv6 2> /dev/null ip6tables -t mangle -F clashv6 2> /dev/null ip6tables -t mangle -X clashv6 2> /dev/null } @@ -1082,9 +1082,10 @@ afstart(){ cronset '#每10分钟保存节点配置' "*/10 * * * * test -n \"\$(pidof clash)\" && $clashdir/start.sh web_save #每10分钟保存节点配置" [ -f $clashdir/web_save ] && web_restore & #后台还原面板配置 #自动开启SSH - [ "$mi_autoSSH" = "已启用" ] && autoSSH 2>/dev/null + [ "$mi_autoSSH" = "已启用" ] && autoSSH 2>/dev/null & + { sleep 30;logger Clash服务已启动!;} & else - logger "clash服务启动失败!请查看报错信息!" 31 + logger "Clash服务启动失败!请查看报错信息!" 31 $bindir/clash -t -d $bindir echo "$($bindir/clash -t -d $bindir)" >> $clashdir/log $0 stop @@ -1129,11 +1130,10 @@ start) else start_old fi - logger clash服务已启动! ;; stop) getconfig - logger 正在关闭clash服务…… + logger Clash服务即将关闭…… [ -n "$(pidof clash)" ] && [ "$restore" = false ] && web_save #保存面板配置 #删除守护进程&面板配置自动保存 cronset "clash保守模式守护进程" @@ -1154,8 +1154,6 @@ restart) $0 start ;; init) - sleep 30 - logger ShellClash正在开机初始化! if [ -d "/etc/storage/clash" ];then clashdir=/etc/storage/clash i=1 @@ -1165,7 +1163,7 @@ init) profile=/etc/profile sed -i '' $profile #将软链接转化为一般文件 elif [ -d "/jffs" ];then - sleep 30 + sleep 40 clashdir=$(cd $(dirname $0);pwd) if [ -w /etc/profile ];then profile=/etc/profile @@ -1185,14 +1183,14 @@ init) getyaml) getconfig getyaml && \ - logger 配置文件更新成功! + logger ShellClash配置文件更新成功! ;; updateyaml) getconfig getyaml && \ modify_yaml && \ put_save http://localhost:${db_port}/configs "{\"path\":\"${clashdir}/config.yaml\"}" && \ - logger 配置文件更新成功! + logger ShellClash配置文件更新成功! ;; logger) logger $2 $3