lee1080 / cloudflarespeedtestddns Goto Github PK
View Code? Open in Web Editor NEW使用CloudflareSpeedTest工具优选IP后自动DDNS到Cloudflare
使用CloudflareSpeedTest工具优选IP后自动DDNS到Cloudflare
测速结果存在重复
这是运行日志:
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已更新
现在还是只有v2.2,强烈需要自定义端口功能,希望能快点开放v2.3,感谢大神!
openwrt很多没有bash,有兼容性问题无法运行。
2.1版本没问题,2.2就显示“TG推送失败,请检查网络或TG机器人token和ID”
cron.err crond[20242]: USER root pid 25531 cmd /mnt/nvme0n1p4/CloudflareSpeedTestDDNS/start.sh
IP_TO_HOSTS=false
DNS_PROVIDER=1
hostname=()
#------------------------------------------cloudflare配置------------------------------------------
x_email= [email protected]
zone_id=
api_key=XXXXXXXXXXXXX
zone_id= 这个不知道填什么
这些填完 启动docder 这个配置文件就初始化了 又要重新填 是哪里出错了
希望添加吧,主要是dnspod免费版相同记录只能有两条,而阿里云是无线的,谢谢
感觉直接更新到hosts里面速度更快,设置也更方便。
CloudflareSpeedTest里面有看到更新到hosts里的脚本,但是他不支持多域名。
1.希望把CloudflareST测速工具的配置和本工具分开
2.执行优选ip时可以加更多的参数,例如-tp 443 -n -tlr等
3.每次推送dnspod时可以推送多个ip,我用的时候一次就退送一个,而且解析的线路从默认变成了境外
4.支持阿里云dns推送
为了达到解析优选不断网、更新速度快(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"
等等
默认的是443吧,能指定其他测速端口吗
root:/ip/cf_ddns# cd ../ip# bash start.sh
root:
配置获取成功!
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
希望可以添加测试下载测速时间限制,CloudflareSpeedTest已支持该参数,但是配置文件并没有设置该参数的地方。
-dt 10
下载测速时间;单个 IP 下载测速最长时间,不能太短;(默认 10 秒)
问题描述:docker版本桥接模式的ip为docker子网ip,翻墙插件可以配置docker子网不走代理,但是与此同时,tg的推送就会失败。
请求:增加一个tg推送时候的socks5代理,让推送的时候可以单走代理,推送结束解除socks5代理。
这个里的配制文件 cf_ddns 里面的文件 实际时间只有3秒 你们要做一下修改 要不然 passwall 都没有启动成功 导致网络连接失败
或者两个选项都加上,一个是Global API,另一个则可以使用token,细分权限,而不用给所有权限
目前我用原项目,配置多个RECORDS_ID
将多个ip解析到同一域名,防止ip失效。比较遗憾的是没有推送支持。
能否优化下,添加多ip的支持,另外推送消息加上"平均延迟"、"下载速度"。
喵主子好,我有个建议,望考虑下,谢谢。
现有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}')
三台服务器不同时间运行,一台线路设置为1(电信),一台为2(联通),一台为3(移动)。会出现冲突,当其中一个更新ip后,会把另外两个当中的一个给删掉,而不是在规定线路上更新或者新增。
还有个问题就是。我设置线路为0(默认)。结果给我更新成了境外的线路类型
我用的是docker版本
大佬可以发下捐赠码,我表示一点心意,辛苦大佬维护!
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公网然后解析到域名,然后再CloudFlare套了DNS并开启了代理模式。
我在docker里根据confi要求配置好了,ipv6.txt文件看到已经在文件夹里,但运行的时候貌似ipv6都无法正确测试到ip地址。
但如果改成ipv4就可以正确运行并且更新到cloudflare的DNS记录里,不知道问题出在哪里。望解答,谢谢!
看别的帖子说安装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
执行最新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
希望能添加ios上的bark推送
##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
默认测速地址导致卡死
固件:N1盒子 flippy 83+
脚本提示这个,大佬看看能否复现。
./cf_ddns/cf_ddns_cloudflare.sh: line 57: /etc/init.d/paswall2: No such file or directory
有时候ip测速正常但是更新失败,能否增加自动重试次数直到成功,还有希望增加"重启插件的时间长短可以自定义",谢谢
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即可
请问作者脚本中的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
RT
CloudflareSpeedTest 项目中的cfcolo选项可以过滤得到指定国家地区的cdn节点,增加该选项方便使用
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.