Code Monkey home page Code Monkey logo

cloudflarespeedtestddns's People

Contributors

jason6111 avatar lee1080 avatar nigel-ni avatar stephenzwj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cloudflarespeedtestddns's Issues

在MacBook本机docker上运行报错

这是运行日志:
2023-09-18 11:37:08 配置获取成功!
2023-09-18 11:37:09 Cloudflare账号验证成功
2023-09-18 11:37:09 当前工作模式为ipv4
2023-09-18 11:37:09 ./cf_ddns/cf_ddns_cloudflare.sh: line 57: /etc/init.d/passwall: No such file or directory
2023-09-18 11:37:09 已停止passwall
2023-09-18 11:37:09 invalid value "-t" for flag -tp: parse error
2023-09-18 11:37:09
2023-09-18 11:37:09 CloudflareSpeedTest v2.2.4
2023-09-18 11:37:09 测试 Cloudflare CDN 所有 IP 的延迟和速度,获取最快 IP (IPv4+IPv6)!
2023-09-18 11:37:09 https://github.com/XIU2/CloudflareSpeedTest
2023-09-18 11:37:09
2023-09-18 11:37:09 参数:
2023-09-18 11:37:09 -n 200
2023-09-18 11:37:09 延迟测速线程;越多延迟测速越快,性能弱的设备 (如路由器) 请勿太高;(默认 200 最多 1000)
2023-09-18 11:37:09 -t 4
2023-09-18 11:37:09 延迟测速次数;单个 IP 延迟测速的次数;(默认 4 次)
2023-09-18 11:37:09 -dn 10
2023-09-18 11:37:09 下载测速数量;延迟测速并排序后,从最低延迟起下载测速的数量;(默认 10 个)
2023-09-18 11:37:09 -dt 10
2023-09-18 11:37:09 下载测速时间;单个 IP 下载测速最长时间,不能太短;(默认 10 秒)
2023-09-18 11:37:09 -tp 443
2023-09-18 11:37:09 指定测速端口;延迟测速/下载测速时使用的端口;(默认 443 端口)
2023-09-18 11:37:09 -url https://cf.xiu2.xyz/url
2023-09-18 11:37:09 指定测速地址;延迟测速(HTTPing)/下载测速时使用的地址,默认地址不保证可用性,建议自建;
2023-09-18 11:37:09
2023-09-18 11:37:09 -httping
2023-09-18 11:37:09 切换测速模式;延迟测速模式改为 HTTP 协议,所用测试地址为 [-url] 参数;(默认 TCPing)
2023-09-18 11:37:09 -httping-code 200
2023-09-18 11:37:09 有效状态代码;HTTPing 延迟测速时网页返回的有效 HTTP 状态码,仅限一个;(默认 200 301 302)
2023-09-18 11:37:09 -cfcolo HKG,KHH,NRT,LAX,SEA,SJC,FRA,MAD
2023-09-18 11:37:09 匹配指定地区;地区名为当地机场三字码,英文逗号分隔,仅 HTTPing 模式可用;(默认 所有地区)
2023-09-18 11:37:09
2023-09-18 11:37:09 -tl 200
2023-09-18 11:37:09 平均延迟上限;只输出低于指定平均延迟的 IP,各上下限条件可搭配使用;(默认 9999 ms)
2023-09-18 11:37:09 -tll 40
2023-09-18 11:37:09 平均延迟下限;只输出高于指定平均延迟的 IP;(默认 0 ms)
2023-09-18 11:37:09 -tlr 0.2
2023-09-18 11:37:09 丢包几率上限;只输出低于/等于指定丢包率的 IP,范围 0.00~1.00,0 过滤掉任何丢包的 IP;(默认 1.00)
2023-09-18 11:37:09 -sl 5
2023-09-18 11:37:09 下载速度下限;只输出高于指定下载速度的 IP,凑够指定数量 [-dn] 才会停止测速;(默认 0.00 MB/s)
2023-09-18 11:37:09
2023-09-18 11:37:09 -p 10
2023-09-18 11:37:09 显示结果数量;测速后直接显示指定数量的结果,为 0 时不显示结果直接退出;(默认 10 个)
2023-09-18 11:37:09 -f ip.txt
2023-09-18 11:37:09 IP段数据文件;如路径含有空格请加上引号;支持其他 CDN IP段;(默认 ip.txt)
2023-09-18 11:37:09 -ip 1.1.1.1,2.2.2.2/24,2606:4700::/32
2023-09-18 11:37:09 指定IP段数据;直接通过参数指定要测速的 IP 段数据,英文逗号分隔;(默认 空)
2023-09-18 11:37:09 -o result.csv
2023-09-18 11:37:09 写入结果文件;如路径含有空格请加上引号;值为空时不写入文件 [-o ""];(默认 result.csv)
2023-09-18 11:37:09
2023-09-18 11:37:09 -dd
2023-09-18 11:37:09 禁用下载测速;禁用后测速结果会按延迟排序 (默认按下载速度排序);(默认 启用)
2023-09-18 11:37:09 -allip
2023-09-18 11:37:09 测速全部的IP;对 IP 段中的每个 IP (仅支持 IPv4) 进行测速;(默认 每个 /24 段随机测速一个 IP)
2023-09-18 11:37:09
2023-09-18 11:37:09 -v
2023-09-18 11:37:09 打印程序版本 + 检查版本更新
2023-09-18 11:37:09 -h
2023-09-18 11:37:09 打印帮助说明
2023-09-18 11:37:09 测速完毕
2023-09-18 11:37:09 ./cf_ddns/cf_ddns_cloudflare.sh: line 101: /etc/init.d/passwall: No such file or directory
2023-09-18 11:37:09 已重启passwall
2023-09-18 11:37:09 等待秒后开始更新DNS!
2023-09-18 11:37:09 sleep: invalid time interval ‘s’
2023-09-18 11:37:09 Try 'sleep --help' for more information.
2023-09-18 11:37:09 正在更新域名,请稍后...
2023-09-18 11:37:09 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:09 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:09 ./cf_ddns/cf_ddns_cloudflare.sh: line 117: [: =: unary operator expected
2023-09-18 11:37:15 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:15 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:15 ./cf_ddns/cf_ddns_cloudflare.sh: line 117: [: =: unary operator expected
2023-09-18 11:37:20 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:20 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:20 ./cf_ddns/cf_ddns_cloudflare.sh: line 117: [: =: unary operator expected
2023-09-18 11:37:26 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:26 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:26 ./cf_ddns/cf_ddns_cloudflare.sh: line 117: [: =: unary operator expected
2023-09-18 11:37:32 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:32 sed: can't read ./cf_ddns/result.csv: No such file or directory
2023-09-18 11:37:32 ./cf_ddns/cf_ddns_cloudflare.sh: line 117: [: =: unary operator expected
2023-09-18 11:37:38 rm: cannot remove '/etc/hosts': Resource busy
2023-09-18 11:37:38 hosts已更新
2023-09-18 11:37:38 未配置TG推送
2023-09-18 11:37:39 PushPlus推送成功
2023-09-18 11:37:39 未配置Server 酱
2023-09-18 11:37:39 未配置PushDeer推送
2023-09-18 11:37:39 未配置企业微信推送
2023-09-18 11:37:39 access_token验证不正确
2023-09-18 11:37:39 未配置Synology Chat推送
2023-09-18 11:37:39 开始更新第1个---
2023-09-18 11:37:39 yx1.dingxz.com更新失败
2023-09-18 11:37:39 开始更新第2个---
2023-09-18 11:37:39 yx2.dingxz.com更新失败
2023-09-18 11:37:39 开始更新第3个---
2023-09-18 11:37:39 yx3.dingxz.com更新失败
2023-09-18 11:37:39 开始更新第4个---
2023-09-18 11:37:39 yx4.dingxz.com更新失败
2023-09-18 11:37:39 开始更新第5个---
2023-09-18 11:37:39 yx5.dingxz.com更新失败
2023-09-18 11:37:39 hosts已更新

不兼容sh

openwrt很多没有bash,有兼容性问题无法运行。

2.2版本tg推送失败

2.1版本没问题,2.2就显示“TG推送失败,请检查网络或TG机器人token和ID”

docker cloudflare 配置文件 怎么填

--是否同步更新到hosts--

true=开启更新到hosts false=不更新到hosts 默认为 false

IP_TO_HOSTS=false

--选择DNS服务商--

选择DNS服务商后,需要下方对应服务商配置中补充完整

1=cloudflare 2=dnspod

DNS_PROVIDER=1

--填写需要DDNS的完整域名--

支持多域名:域名需要填写在括号中,每个域名之间用“空格”相隔。

例如:(cdn.test.com) 或者 (cdn1.test.com cdn2.test.com cdn3.test.com)

hostname=()

#------------------------------------------cloudflare配置------------------------------------------

--cloudflare账号邮箱--

x_email= [email protected]

--空间ID--

zone_id=

--Global API Key--

api_key=XXXXXXXXXXXXX

zone_id= 这个不知道填什么
这些填完 启动docder 这个配置文件就初始化了 又要重新填 是哪里出错了

请求添加阿里云

希望添加吧,主要是dnspod免费版相同记录只能有两条,而阿里云是无线的,谢谢

一些改进的建议

1.希望把CloudflareST测速工具的配置和本工具分开
2.执行优选ip时可以加更多的参数,例如-tp 443 -n -tlr等
3.每次推送dnspod时可以推送多个ip,我用的时候一次就退送一个,而且解析的线路从默认变成了境外
4.支持阿里云dns推送

建议新增架构在非op服务器上时用sshpass更新节点的server。

为了达到解析优选不断网、更新速度快(ddns到cf或者dnspod有域名dns解析慢的问题)的目的,可以把服务搭建在非科学环境,sshpass直接把ip传递到节点的server上。
比如bypass是:
sshpass -p 密码 ssh -tt -n -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=20 root@op的ip "uci set bypass.@servers[0].server=""$ipAddr"" && uci commit bypass"
passwall是:
sshpass -p 密码 ssh -tt -n -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=20 root@op的ip "uci set passwall.节点nodes.address=""$ipAddr"" && uci commit passwall"
等等

执行出错

root:/ip/cf_ddns# cd ..
root:
/ip# bash start.sh
配置获取成功!
Cloudflare账号验证成功
当前工作模式为ipv4
已停止passwall
invalid value "-t" for flag -tp: parse error

CloudflareSpeedTest v2.2.4
测试 Cloudflare CDN 所有 IP 的延迟和速度,获取最快 IP (IPv4+IPv6)!
https://github.com/XIU2/CloudflareSpeedTest

参数:
-n 200
延迟测速线程;越多延迟测速越快,性能弱的设备 (如路由器) 请 勿太高;(默认 200 最多 1000)
-t 4
延迟测速次数;单个 IP 延迟测速的次数;(默认 4 次)
-dn 10
下载测速数量;延迟测速并排序后,从最低延迟起下载测速的数量 ;(默认 10 个)
-dt 10
下载测速时间;单个 IP 下载测速最长时间,不能太短;(默认 10 秒)
-tp 443
指定测速端口;延迟测速/下载测速时使用的端口;(默认 443 端 ) -url https://cf.xiu2.xyz/url
指定测速地址;延迟测速(HTTPing)/下载测速时使用的地址,默认 地址不保证可用性,建议自建;

-httping
    切换测速模式;延迟测速模式改为 HTTP 协议,所用测试地址为 [-url] 参数;(默认 TCPing)
-httping-code 200
    有效状态代码;HTTPing 延迟测速时网页返回的有效 HTTP 状态码 ,仅限一个;(默认 200 301 302)
-cfcolo HKG,KHH,NRT,LAX,SEA,SJC,FRA,MAD
    匹配指定地区;地区名为当地机场三字码,英文逗号分隔,仅 HTTPing 模式可用;(默认 所有地区)

-tl 200
    平均延迟上限;只输出低于指定平均延迟的 IP,各上下限条件可搭配使用;(默认 9999 ms)
-tll 40
    平均延迟下限;只输出高于指定平均延迟的 IP;(默认 0 ms)
-tlr 0.2
    丢包几率上限;只输出低于/等于指定丢包率的 IP,范围 0.00~1.00,0 过滤掉任何丢包的 IP;(默认 1.00)
-sl 5
    下载速度下限;只输出高于指定下载速度的 IP,凑够指定数量 [-dn] 才会停止测速;(默认 0.00 MB/s)

-p 10
    显示结果数量;测速后直接显示指定数量的结果,为 0 时不显示结果直接退出;(默认 10 个)
-f ip.txt
    IP段数据文件;如路径含有空格请加上引号;支持其他 CDN IP段 (默认 ip.txt)
-ip 1.1.1.1,2.2.2.2/24,2606:4700::/32
    指定IP段数据;直接通过参数指定要测速的 IP 段数据,英文逗号 分隔;(默认 空)
-o result.csv
    写入结果文件;如路径含有空格请加上引号;值为空时不写入文件 [-o ""];(默认 result.csv)

-dd
    禁用下载测速;禁用后测速结果会按延迟排序 (默认按下载速度排 序);(默认 启用)
-allip
    测速全部的IP;对 IP 段中的每个 IP (仅支持 IPv4) 进行测速;(默认 每个 /24 段随机测速一个 IP)

-v
    打印程序版本 + 检查版本更新
-h
    打印帮助说明

测速完毕
已重启passwall
等待15秒后开始更新DNS!
^C

关于telegram推送,以及docker容器的优选ip

问题描述:docker版本桥接模式的ip为docker子网ip,翻墙插件可以配置docker子网不走代理,但是与此同时,tg的推送就会失败。
请求:增加一个tg推送时候的socks5代理,让推送的时候可以单走代理,推送结束解除socks5代理。

需求建议:ip-scanner/cloudflare获取到速度为0的IP时,不更新DDNS

喵主子好,我有个建议,望考虑下,谢谢。

现有CloudflareSpeedTest获取IP速度为0的时候依然会写入result.csv,从而导致你代码也会更新DDNS
建议在更新DDNS的时候加一个判断,速度为0的时候不更新CF,实际上这些IP也基本上不能用的。

result.csv 结果如图,在这个取值条件上加个判断应该就可以。
IP 地址,已发送,已接收,丢包率,平均延迟,下载速度 (MB/s)
112.74.93.147,4,4,0.00,18.42,0.00

修改cf_ddns_cloudflare.sh,在以下条件上加一个前置条件,判断速度为0则不取
while [[ ${x} -lt $num ]]; do
CDNhostname=${hostname[$x]}

ipAddr=$(sed -n "$((x + 2)),1p" /root/cf_443/cf_ddns/result.csv | awk -F, '{print $1}')

遇到一个关于dnspod选择线路的bug

三台服务器不同时间运行,一台线路设置为1(电信),一台为2(联通),一台为3(移动)。会出现冲突,当其中一个更新ip后,会把另外两个当中的一个给删掉,而不是在规定线路上更新或者新增。

还有个问题就是。我设置线路为0(默认)。结果给我更新成了境外的线路类型
我用的是docker版本

大佬可以发下捐赠码,我表示一点心意,辛苦大佬维护!

tg推送消息失败

TG推送失败,请检查网络或TG机器人token和ID 经过测试 在软路由PING API接口域名可以通
也核对过 TG机器人token和ID 都是正确的 就是不能推送消息

功能建议。增加掉线通知。并关联自动优选

可以计划任务curl google设置timeout时间。然后通知。log timeout通知次数。超过多少次就不再通知。甚至可以关联自动优选。同时curl baidu和google判断状态码就可以判断是否只是科学断了而不是网都断了。另外。ping关联的域名。如果ping不通并且baidu通、google不通触发自动优选

运行错误

ip.sh 20行,括号不识别报错
ip.sh末尾行为
. cf_ddns
实际运行时报
./ip.sh: .: line 49: cf_ddns: not found
将末尾行修改成绝对路径,错误消失。

在运行cf_ddns时又会报错
/root/cfip/cf_ddns: line 12: syntax error: bad substitution

设备:R2S ARMv8
已经安装jq
直接运行CloudflareST正常

IPV6 一直说更新失败

我是移动IPV6公网然后解析到域名,然后再CloudFlare套了DNS并开启了代理模式。
我在docker里根据confi要求配置好了,ipv6.txt文件看到已经在文件夹里,但运行的时候貌似ipv6都无法正确测试到ip地址。
但如果改成ipv4就可以正确运行并且更新到cloudflare的DNS记录里,不知道问题出在哪里。望解答,谢谢!

ip.sh文件不能运行

看别的帖子说安装basn,我opkg install bash安装了,但还是报错
[root@PandoraBox_B5DE:/etc/ip]#bash ip.sh
jq: jv.c: 435: jvp_string_ptr: Assertion `jv_get_kind(a) == JV_KIND_STRING' failed.
Aborted
cf_ddns: line 15: cf_push: No such file or directory

用./ip.sh也报上面一样的错

用sh ip.sh也报错但能显示登录成功,
[root@PandoraBox_B5DE:/etc/ip]#sh ip.sh
jq: jv.c: 435: jvp_string_ptr: Assertion `jv_get_kind(a) == JV_KIND_STRING' failed.
Aborted
sh: true: unknown operand
Cloudflare账号验证成功
ip.sh: cf_ddns: line 20: syntax error: bad substitution

找不到pr_ip.txt,找不到paswall2

执行最新v2.2版本脚本报错信息如下:
open ./cf_ddns/pr_ip.txt: no such file or directory
rm: can't remove './cf_ddns/pr_ip.txt': No such file or directory
测速完毕
./cf_ddns/cf_ddns_cloudflare.sh: line 87: /etc/init.d/paswall2: No such file or directory
已重启paswall2
等待15秒后开始更新DNS!
正在更新域名,请稍后...
sed: ./cf_ddns/result.csv: No such file or directory

问题:
找不到pr_ip.txt,应该是因为脚本里的https://cf.vbar.fun/pr_ip.txt挂了所以没下载下来吧?
找不到passwall2是因为iStoreOS不是原版openwrt吗?

脚本终于跑通了,显示DNS更新成功了,但是上CF看了下并没有解析新的IP。。

系统信息如下:
AMD x64 iStoreOS 22.03

需求建议:添加bark推送

希望能添加ios上的bark推送

https://bark.day.app/#/

##bark##
if [[ -z ${SendKey} ]]; then
echo "未配置bark"
else
res=$(timeout 20s curl -X POST "https://api.day.app/${SendKey}" -d "body=${message_text}&title=cf优选ip推送")

if [ $? == 124 ];then
echo 'bark请求超时,请检查网络是否可用'
fi

resSuccess=$(echo "$res" | jq -r ".code")
if [[ $resSuccess = "200" ]]; then
echo "bark推送成功";
else
echo "bark推送失败,请检查SendKey是否配置正确";
fi
fi

线路2的反向代理的一些更新建议

https://t.me/cf_push 大佬的这个项目其实有针对端口分门别类形成的txt,像这样31898-1-8443.txt,31898-1-2096.txt,这个项目在https://zip.baipiao.eu.org里。。修改一下curl -sSf -o ./cf_ddns/pr_ip.txt https://cf.vbar.fun/zip_baipiao_eu_org/pr_ip.txt其实不需要每次都测这么多ip,CFST_TP填啥就专门针对这个端口测速。rm -rf ./txt && rm -rf ./txt.zip && curl -s https://zip.baipiao.eu.org -o ./txt.zip && unzip -o -q txt.zip -d ./txt && find ./txt -name "*-${CFST_TP}.txt" | xargs cat > ./cf_ddns/pr_ip.txt即可

脚本测速IP

请问作者脚本中的https://cf.vbar.fun/pr_ip.txt里面的IP是什么
在这里我发现是先测试了一遍pr_ip.txt里面的IP然后才测试别的
而且第一次测试时的数据好像没有使用

if [ "$IP_PR_IP" = "true" ] ; then
  curl -sSf -o ./cf_ddns/pr_ip.txt https://cf.vbar.fun/pr_ip.txt
  $CloudflareST $CFST_URL_R -t $CFST_T -n $CFST_N -dn $CFST_DN -tl $CFST_TL  -sl $CFST_SL -p $CFST_P -f ./cf_ddns/pr_ip.txt -o ./cf_ddns/result.csv
  rm ./cf_ddns/pr_ip.txt
elif [ "$IP_ADDR" = "ipv6" ] ; then
  #开始优选IPv6
  $CloudflareST $CFST_URL_R -t $CFST_T -n $CFST_N -dn $CFST_DN -tl $CFST_TL -tll $CFST_TLL -sl $CFST_SL -p $CFST_P -f ./cf_ddns/ipv6.txt -o ./cf_ddns/result.csv
else
  #开始优选IPv4
  $CloudflareST -dd $CFST_URL_R -t $CFST_T -n $CFST_N -dn $CFST_DN -tl $CFST_TL -tll $CFST_TLL -sl $CFST_SL -p $CFST_P -f ./cf_ddns/ip.txt -o ./cf_ddns/result.csv
fi

请求增加cfcolo选项

CloudflareSpeedTest 项目中的cfcolo选项可以过滤得到指定国家地区的cdn节点,增加该选项方便使用

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.