Compare commits

...

159 Commits

Author SHA1 Message Date
spiritlhl
f6ee1e40ec fix: 添加退出程序的选项,添加开始执行前的清屏逻辑 2025-08-11 11:37:43 +00:00
spiritlhl
cb2bf0a7e5 fix: 主体逻辑将backtrace和三网路由详情检测加入整体的并发检测 2025-08-11 11:25:32 +00:00
spiritlhl
ad017db5a6 fix: 更新版本 2025-08-11 11:15:13 +00:00
spiritlhl
a99f58518a fix: 升级backtrace依赖,支持多重路由测试取平均结果,避免单次路由波动分析失败 2025-08-11 11:13:07 +00:00
spiritlhl
2e59bac322 fix: 提取三网详细路由的测试逻辑至于单独的包,添加单项测试 2025-08-11 10:59:17 +00:00
spiritlhl
4132b1daff feat: 详细三网路由测试支持并发测试,大幅缩短测试所需时间 2025-08-11 10:53:48 +00:00
github-actions[bot]
53296b745a chore: update ECS_VERSION to 0.1.76 in goecs.sh 2025-08-08 14:53:41 +00:00
spiritlhl
74630e9615 fix: 更新说明 2025-08-08 14:31:09 +00:00
spiritlhl
5ec7924214 fix: 更新版本(mbw已回落可用但未能测出真实性能) 2025-08-08 14:26:31 +00:00
spiritlhl
7a7fdc26a0 fix: memorytest更新依赖 2025-08-08 14:23:16 +00:00
spiritlhl
d4c855de92 fix: disktest去除无效的条件筛选 2025-08-08 14:16:50 +00:00
spiritlhl
7c22dee443 fix: 修复windows系统非Admin权限下的硬盘测试(FIO测试无误,DD测试缺少C依赖) 2025-08-08 14:15:59 +00:00
github-actions[bot]
797496b640 chore: update ECS_VERSION to 0.1.75 in goecs.sh 2025-08-06 09:12:25 +00:00
spiritlhl
5b686abdc8 fix: 规范输出 2025-08-06 09:06:48 +00:00
spiritlhl
f99a37edbe fix: 更新版本 2025-08-06 09:04:38 +00:00
spiritlhl
4ff49c8b90 fix: 离线模式下不检测程序版本,不统计使用次数 2025-08-06 09:02:57 +00:00
spiritlhl
1d9257beb3 fix: 合并缓存IP的存储位置 2025-08-06 08:51:50 +00:00
spiritlhl
fc6ccb9f92 fix: 修复无系统信息检测时无对应IP信息检测导致后续依赖IP信息查询的函数异常输出的问题 2025-08-06 08:45:00 +00:00
github-actions[bot]
88a2a7fdc9 chore: update ECS_VERSION to 0.1.74 in goecs.sh 2025-08-05 14:28:15 +00:00
spiritlhl
5ff18ed7c7 feat: 更新版本 2025-08-05 14:13:46 +00:00
spiritlhl
df897db244 feat: 添加支持如非最新版本使用时提示版本更新,添加使用统计 2025-08-05 14:13:20 +00:00
spiritlhl
9a8680491c fix: 支持三网回程详细路可指定ALL对四个主要城市全测 2025-08-05 13:37:43 +00:00
spiritlhl
33f81fd6aa fix: 修复笔误 2025-08-05 21:02:05 +08:00
github-actions[bot]
940703c3f9 chore: update ECS_VERSION to 0.1.73 in goecs.sh 2025-08-05 09:42:55 +00:00
spiritlhl
1c2e9cdab9 fix: 修复上游识别,支持直接导入basics识别到的IP地址,而不再重新获取IP地址减少等待时间 2025-08-05 09:28:26 +00:00
spiritlhl
3e6524fa0e fix: 修复和添加上游线路说明 2025-08-02 05:41:17 +00:00
spiritlhl
026f40dc4c fix: 添加额外的本地获取方式 2025-08-01 17:34:56 +00:00
github-actions[bot]
110c58d401 chore: update ECS_VERSION to 0.1.72 in goecs.sh 2025-08-01 17:00:53 +00:00
spiritlhl
06e76a9c33 fix: 更新disktest,支持自动启用多盘IO检测,支持更严苛的过滤规则 2025-08-01 16:46:18 +00:00
spiritlhl
6b88a81c02 fix: 更新版本 2025-08-01 16:43:21 +00:00
spiritlhl
5482506bab fix: 优化请求添加限时和并发拓展 2025-08-01 16:42:46 +00:00
spiritlhl
b7130db8ce fix: backtrace添加上游检测和线路分析 2025-08-01 16:38:01 +00:00
github-actions[bot]
dc5e3b7852 chore: update ECS_VERSION to 0.1.71 in goecs.sh 2025-07-28 02:28:29 +00:00
spiritlhl
6937e69a0a fix: 更新依赖版本,修复GooglePlayStore检测 2025-07-28 02:14:33 +00:00
github-actions[bot]
a68d33739c chore: update ECS_VERSION to 0.1.70 in goecs.sh 2025-07-27 02:47:27 +00:00
spiritlhl
94e0441801 fix: 更新修复backtrace线路检测的IPV6路由检测启用的判断条件 2025-07-27 02:32:33 +00:00
github-actions[bot]
39be183fda chore: update ECS_VERSION to 0.1.69 in goecs.sh 2025-07-26 15:26:32 +00:00
spiritlhl
dbc1506518 fix: 更新nexttrace内核版本,支持多行星号仅显示一行减少无效输出 2025-07-26 15:13:18 +00:00
spiritlhl
149f5673d2 fix: 更新说明,指明暂未支持的一些系统 2025-07-26 13:55:14 +00:00
github-actions[bot]
c1b7302485 chore: update ECS_VERSION to 0.1.68 in goecs.sh 2025-07-26 10:08:01 +00:00
spiritlhl
bf44ea9324 fix: 更新gostun依赖,添加更多的stun默认测试服务器 2025-07-26 09:54:41 +00:00
github-actions[bot]
191ddfd668 chore: update ECS_VERSION to 0.1.67 in goecs.sh 2025-07-20 14:21:12 +00:00
spiritlhl
89a99a7428 fix: 在win的mbw程序不可用时,回退使用Go重构版本的mbw程序(聊胜于无) 2025-07-20 14:07:42 +00:00
github-actions[bot]
c474c71091 chore: update ECS_VERSION to 0.1.66 in goecs.sh 2025-07-20 13:37:19 +00:00
spiritlhl
43b2c8aca3 fix: 升级版本 2025-07-20 21:32:01 +08:00
spiritlhl
96117a040e fix: 固定主版本 2025-07-20 21:31:40 +08:00
spiritlhl
c5aeda45bd fix: 修复版本号 2025-07-20 21:24:35 +08:00
github-actions[bot]
0b2ac51f09 chore: update ECS_VERSION to 0.1.65 in goecs.sh 2025-07-20 13:16:07 +00:00
spiritlhl
ffe1b65a2b fix: 更新goreleaser-action版本 2025-07-20 13:02:52 +00:00
spiritlhl
a4bfd4d143 fix: 更新版本号至于 v0.1.64 2025-07-20 12:59:32 +00:00
spiritlhl
edbcf1c245 fix: 回退不再启用CGO编译 2025-07-20 12:57:24 +00:00
spiritlhl
4c65417ea6 fix: cputest回退部分C代码为Go代码,部分C代码不兼容新的debian内核 2025-07-20 12:25:58 +00:00
spiritlhl
2cf7484881 fix: musl工具链使用第三方增强版本 2025-07-20 11:55:54 +00:00
spiritlhl
d5da2a59b6 fix: musl工具链使用第三方增强版本 2025-07-20 11:42:55 +00:00
spiritlhl
372deb59eb fix: musl工具链使用第三方增强版本 2025-07-20 11:41:53 +00:00
spiritlhl
8e4c6dfd3e fix: 尝试使用musl编译而不是glibc编译 2025-07-20 11:23:25 +00:00
spiritlhl
8fc828d416 fix: 尝试使用musl编译而不是glibc编译 2025-07-20 11:16:35 +00:00
spiritlhl
8a3fbd79e6 fix: 暂时不去除调试信息 2025-07-20 19:01:36 +08:00
spiritlhl
5628f1bb9c fix: 更新架构说明 2025-07-19 14:07:08 +00:00
spiritlhl
cadbb2a45c fix: 无需定义linux的arm的版本 2025-07-18 22:43:12 +08:00
github-actions[bot]
56d7560471 chore: update ECS_VERSION to 0.1.63 in goecs.sh 2025-07-18 14:34:45 +00:00
spiritlhl
75e7eb1b25 fix: linux-arm启用CGO编译 2025-07-18 14:30:02 +00:00
spiritlhl
24ba56cfa6 fix: linux-arm启用CGO编译 2025-07-18 14:05:09 +00:00
spiritlhl
ebefd64a3d fix: 更新cputest版本 2025-07-18 13:41:07 +00:00
spiritlhl
4d83ffea02 fix: 修复编译的Action错配ARCH 2025-07-18 13:25:08 +00:00
spiritlhl
01a4084462 fix: 更新失效的cputest的tag 2025-07-18 13:16:03 +00:00
spiritlhl
6674093425 fix: 修复CPU测试在Windows系统中测试出现多核单核测试结果一样的问题 2025-07-18 13:06:41 +00:00
spiritlhl
6d2e56b1ec fix: 修复CPU测试在Windows系统中测试出现多核单核测试结果一样的问题 2025-07-18 13:05:24 +00:00
spiritlhl
2a736d3e70 fix: 修正识别错误 2025-07-18 11:17:20 +08:00
spiritlhl
d02383b8cb fix: 推送到阿里云而不是CNB 2025-07-18 11:14:21 +08:00
spiritlhl
0caba0ea60 fix 2025-07-18 00:46:39 +08:00
spiritlhl
6f92b8a994 fix: 更新说明 2025-07-18 00:46:20 +08:00
spiritlhl
cc34baf9e1 fix: 添加windows适配 2025-07-18 00:42:26 +08:00
spiritlhl
84d8963684 fix: 避免重复定义 2025-07-18 00:41:21 +08:00
spiritlhl
a94e9a6284 fix: 尝试修复win编译出的exe报毒的问题 2025-07-18 00:36:43 +08:00
spiritlhl
06007c191f fix: 修复release的说明自动生成自动更新 2025-07-18 00:16:28 +08:00
spiritlhl
d013b8f90c fix: 修复归档 2025-07-18 00:09:53 +08:00
github-actions[bot]
42002fdae1 chore: update ECS_VERSION to 0.1.62 in goecs.sh 2025-07-17 16:07:34 +00:00
spiritlhl
d7628a5a57 fix: 更新说明 2025-07-17 16:03:16 +00:00
spiritlhl
e5f3ca1ec3 fix: 添加openbsd支持,说明中添加对于CGO编译参数的说明 2025-07-17 15:46:59 +00:00
spiritlhl
e70a295a5f fix: darwin迁移使用Action自身的runner编译 2025-07-17 15:30:29 +00:00
spiritlhl
58821f2603 fix: darwin去除CGO编译需求,不再使用CGO进行编译(部分linux的C代码不可迁移) 2025-07-17 15:27:58 +00:00
spiritlhl
33a656304b fix: 更新go编译器版本 2025-07-17 15:02:20 +00:00
spiritlhl
33d9a3ccb0 fix: 减少无效输出 2025-07-17 09:31:28 +00:00
spiritlhl
1d5758999c fix: 设置缓存强制重新生成 2025-07-17 09:12:55 +00:00
spiritlhl
94ce394e04 fix: 设置缓存清除 2025-07-17 08:56:12 +00:00
spiritlhl
ede04bd2c2 fix: 设置 osxcross 的编译器 2025-07-17 08:40:20 +00:00
spiritlhl
50f6ef1f60 fix: 修复darwin的cgo编译问题 2025-07-17 06:37:02 +00:00
spiritlhl
e5129ab244 fix: 修复darwin的cgo设置识别 2025-07-17 06:27:46 +00:00
spiritlhl
15b6ba4eb8 fix: 修复darwin的cc识别 2025-07-17 06:22:43 +00:00
spiritlhl
6c77f74003 fix: 添加windows的arm架构的编译 2025-07-17 06:15:00 +00:00
spiritlhl
61a1508b53 fix: 修复依赖对cgo要求冲突的问题 2025-07-17 06:10:38 +00:00
spiritlhl
022284018d fix: 对应平台使用对应的runner 2025-07-17 05:59:47 +00:00
spiritlhl
1d682213fe fix: 修复预设 2025-07-17 05:45:24 +00:00
spiritlhl
649a09b50a fix: 修复darwin和386和arm的编译的cgo设置问题 2025-07-17 05:36:43 +00:00
spiritlhl
0fa2ff9300 fix: linux的arm不区分具体32位的版本 2025-07-17 05:25:29 +00:00
spiritlhl
b174e5cfa8 fix: darwin 不再启用cgo编译 2025-07-17 05:21:36 +00:00
spiritlhl
afd667db59 fix: 删除不必要的前置编译检测 2025-07-17 05:11:23 +00:00
spiritlhl
d846dcbf4f fix: 设置忽略弃用文件的文件夹进行编译 2025-07-17 05:05:35 +00:00
spiritlhl
f47b1e3023 fix: 不再使用goreleaser编译,直接使用原生runner进行编译 2025-07-17 05:01:53 +00:00
spiritlhl
63658bb2dc fix: 循环下载可能需要下载的依赖 2025-07-17 03:40:19 +00:00
spiritlhl
b1a8368af3 fix: 去除无效的CXX命令 2025-07-17 03:38:25 +00:00
spiritlhl
df6d1236cc fix: 暂时注释调freebsd进行编译 2025-07-17 03:12:06 +00:00
spiritlhl
7c64102581 fix: 修复头文件导入 2025-07-17 03:07:18 +00:00
spiritlhl
58cb4f3831 fix: 修复头文件导入 2025-07-17 03:04:13 +00:00
spiritlhl
20bddae048 fix: 更新版本 2025-07-17 02:49:04 +00:00
spiritlhl
3c0590ca8d fix: 删除暂不适配的freebsd-arm 2025-07-17 02:43:28 +00:00
spiritlhl
a752eeeeb0 fix: 修复配置错配 2025-07-17 02:26:32 +00:00
spiritlhl
630a28f2f2 fix: 编译顺序执行避免报错无法溯源 2025-07-17 02:14:19 +00:00
spiritlhl
cfd70e100b fix: 编译顺序执行避免报错无法溯源 2025-07-17 02:02:59 +00:00
spiritlhl
9114f5b97a fix: linux的amd64架构无需额外设置gcc 2025-07-17 01:36:26 +00:00
spiritlhl
8c0fc16384 fix: 升级默认编译容器的版本 2025-07-17 01:25:15 +00:00
spiritlhl
2ded570639 fix: 去除暂不支持的系统 2025-07-16 16:52:34 +00:00
spiritlhl
42f0cb3399 fix: 去除暂不支持的系统 2025-07-16 16:35:48 +00:00
spiritlhl
14adbddeb9 fix: 添加错误追踪 2025-07-16 16:19:21 +00:00
spiritlhl
27fd06b007 fix: 无法去除默认验证 2025-07-16 16:08:41 +00:00
spiritlhl
88db8df827 fix: 重构编译逻辑避免全部任务失败 2025-07-16 16:03:46 +00:00
spiritlhl
ec728796f4 fix: 修复缺失的前置依赖 2025-07-16 15:44:40 +00:00
spiritlhl
147e8c1113 fix: 修复缺失的前置依赖 2025-07-16 15:27:55 +00:00
spiritlhl
b9b1d5ca76 fix: 删除goreleaser的部分无效参数 2025-07-16 15:00:35 +00:00
spiritlhl
1500c8342e fix: 更新goreleaser的yaml版本 2025-07-16 14:54:49 +00:00
spiritlhl
e523ca3c84 fix: 修复cputest和memorytest的C重构,尽量使用CGO编译嵌入依赖,拓展编译支持的系统和架构,增加容错机制 2025-07-16 14:47:11 +00:00
github-actions[bot]
42943370bb chore: update ECS_VERSION to 0.1.55 in goecs.sh 2025-07-15 12:48:33 +00:00
spiritlhl
7339f0336c fix: 修复传递过程中非指针传递导致的写入丢失 2025-07-15 12:44:24 +00:00
github-actions[bot]
54bbe16563 chore: update ECS_VERSION to 0.1.54 in goecs.sh 2025-07-15 12:27:50 +00:00
spiritlhl
2a66452f40 fix: 更新版本号 2025-07-15 12:23:20 +00:00
spiritlhl
aab6bf197d fix: 修复测试项目自动切换了测试方式在测试项头部同步更改说明 2025-07-15 12:22:51 +00:00
github-actions[bot]
9206088bad chore: update ECS_VERSION to 0.1.53 in goecs.sh 2025-07-15 11:55:49 +00:00
spiritlhl
48e150036d fix: 在CPU测试自动切换测试类型的时候头部测试方式自动替换测试说明 2025-07-15 11:51:30 +00:00
spiritlhl
486b767a25 fix: 修复文本赋值顺序错位 2025-07-15 19:29:13 +08:00
spiritlhl
5a2e68bf92 fix: 修复文本赋值顺序错位 2025-07-15 19:27:11 +08:00
github-actions[bot]
97d05f4b57 chore: update ECS_VERSION to 0.1.52 in goecs.sh 2025-07-15 11:12:52 +00:00
spiritlhl
4f08a33de8 fix: 离线环境下不再尝试结果分享链接的生成 2025-07-15 10:58:40 +00:00
spiritlhl
ff8712a743 fix: 修复中途退出文本内容未正常保存并生成分享链接的问题 2025-07-15 10:51:55 +00:00
spiritlhl
abd38554b6 fix: 更新basics模块支持多盘智能检测同时显示boot和mount路径 2025-07-15 10:29:41 +00:00
github-actions[bot]
918a9b3a46 chore: update ECS_VERSION to 0.1.51 in goecs.sh 2025-07-10 08:15:00 +00:00
spiritlhl
d9dac50487 fix: 更新basics支持多盘检测,更新security数据库来源,增加maxmind数据库获取IP信息 2025-07-10 08:02:54 +00:00
spiritlhl
cd65f04433 fix: 添加测试环境类型说明 2025-07-01 13:36:18 +00:00
github-actions[bot]
8b5193eca1 chore: update ECS_VERSION to 0.1.50 in goecs.sh 2025-07-01 13:14:04 +00:00
spiritlhl
4797ff0b34 fix: 优化pingtest的日志记录 2025-07-01 13:02:39 +00:00
github-actions[bot]
9886cad73e chore: update ECS_VERSION to 0.1.49 in goecs.sh 2025-07-01 12:18:04 +00:00
spiritlhl
ca0470f01a fix: 修复pingtest和speedtest在无root权限环境下的鉴权问题 2025-07-01 12:06:59 +00:00
github-actions[bot]
5a6d6845c1 chore: update ECS_VERSION to 0.1.48 in goecs.sh 2025-07-01 09:57:47 +00:00
spiritlhl
487dd7c1d2 fix: 测试修复无权限下硬盘测试引擎选择的问题 2025-07-01 09:37:56 +00:00
spiritlhl
2dbf97de8c fix: 测试修复无权限下硬盘测试引擎选择的问题 2025-07-01 09:35:56 +00:00
github-actions[bot]
97e7cae2c2 chore: update ECS_VERSION to 0.1.47 in goecs.sh 2025-07-01 08:44:22 +00:00
spiritlhl
d61a1879f5 fix: 修复macos上无权限时的测试路径选择 2025-07-01 08:33:30 +00:00
github-actions[bot]
29dd4ac57e chore: update ECS_VERSION to 0.1.46 in goecs.sh 2025-07-01 03:30:58 +00:00
spiritlhl
dc3eff1fe3 fix: 更新版本 2025-07-01 11:20:24 +08:00
spiritlhl
0a0f2199bc fix: 修复内存和硬盘测试的权限校验问题 2025-07-01 03:19:07 +00:00
github-actions[bot]
91004d87f5 chore: update ECS_VERSION to 0.1.45 in goecs.sh 2025-06-30 14:30:04 +00:00
spiritlhl
8f41c37203 fix: 修复windows下的Admin权限检测 2025-06-30 14:18:42 +00:00
github-actions[bot]
12b1ae0702 chore: update ECS_VERSION to 0.1.44 in goecs.sh 2025-06-30 13:43:29 +00:00
spiritlhl
653cd75a97 fix: 修复内存测试在无root环境下测试的权限问题,添加无权限的内存测试方法mbw 2025-06-30 13:32:20 +00:00
github-actions[bot]
ea36e88c9f chore: update ECS_VERSION to 0.1.43 in goecs.sh 2025-06-29 08:49:03 +00:00
spiritlhl
c81ebb3c7a fix: 异步函数传值需要指针传递,值传递可能会出现同步问题 2025-06-29 08:45:15 +00:00
github-actions[bot]
7896b3ead5 chore: update ECS_VERSION to 0.1.42 in goecs.sh 2025-06-29 08:33:10 +00:00
spiritlhl
eb98a7b857 fix: 更加严格的启动条件,同时避免死锁等待 2025-06-29 08:29:24 +00:00
github-actions[bot]
d4d86229de chore: update ECS_VERSION to 0.1.41 in goecs.sh 2025-06-29 07:59:30 +00:00
41 changed files with 2650 additions and 454 deletions

84
.back/.goreleaser.old Normal file
View File

@@ -0,0 +1,84 @@
before:
hooks:
- go mod tidy -v
builds:
- id: universal
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
- windows
- freebsd
goarch:
- arm
- arm64
- 386
- amd64
- mips
- mipsle
- s390x
- riscv64
gomips:
- softfloat
ignore:
- goos: windows
goarch: arm
main: ./
binary: goecs
- id: darwin-amd64
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- darwin
goarch:
- amd64
main: ./
binary: goecs
- id: darwin-arm64
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- darwin
goarch:
- arm64
main: ./
binary: goecs
universal_binaries:
- name_template: "goecs"
replace: false
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "goecs"
archives:
- name_template: "goecs_{{ .Os }}_{{ .Arch }}"
format: zip
files:
- none*
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore"
- Merge pull request
- Merge branch
- go mod tidy
- New translations

522
.back/.goreleaser.yaml Normal file
View File

@@ -0,0 +1,522 @@
version: 2
project_name: goecs
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy -v
builds:
# Linux AMD64 with CGO
- id: linux-amd64-cgo
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
- CGO_CFLAGS=-O2 -static -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/amd64 (CGO)"
post:
- echo "Successfully built linux/amd64 (CGO)"
- echo "---"
# Linux 386 with CGO - 修复了编译器和标志
- id: linux-386-cgo
env:
- CGO_ENABLED=1
- CC=gcc
- CGO_CFLAGS=-m32 -O1 -march=i686 -mtune=generic -fno-stack-protector
- CGO_LDFLAGS=-m32
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags="-m32 -static"
flags:
- -trimpath
goos:
- linux
goarch:
- 386
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/386 (CGO)"
post:
- echo "Successfully built linux/386 (CGO)"
- echo "---"
# Linux ARM64 with CGO
- id: linux-arm64-cgo
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CGO_CFLAGS=-O1 -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- arm64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/arm64 (CGO)"
post:
- echo "Successfully built linux/arm64 (CGO)"
- echo "---"
# Windows AMD64 with CGO
- id: windows-amd64-cgo
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CGO_CFLAGS=-O2 -static-libgcc -static-libstdc++
- CGO_LDFLAGS=-static-libgcc -static-libstdc++
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- windows
goarch:
- amd64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for windows/amd64 (CGO)"
post:
- echo "Successfully built windows/amd64 (CGO)"
- echo "---"
# Windows 386 with CGO - 修复了编译器名称
- id: windows-386-cgo
env:
- CGO_ENABLED=1
- CC=i686-w64-mingw32-gcc
- CGO_CFLAGS=-O2 -static-libgcc -static-libstdc++
- CGO_LDFLAGS=-static-libgcc -static-libstdc++
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- windows
goarch:
- 386
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for windows/386 (CGO)"
post:
- echo "Successfully built windows/386 (CGO)"
- echo "---"
# Darwin AMD64 with CGO
- id: darwin-amd64-cgo
env:
- CGO_ENABLED=1
- CC=o64-clang
- CGO_CFLAGS=-O2 -arch x86_64 -mmacosx-version-min=10.12
- CGO_LDFLAGS=-arch x86_64 -mmacosx-version-min=10.12
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- darwin
goarch:
- amd64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for darwin/amd64 (CGO)"
- echo "Checking osxcross tools..."
- which o64-clang || echo "o64-clang not found"
- which o64-clang++ || echo "o64-clang++ not found"
post:
- echo "Successfully built darwin/amd64 (CGO)"
- echo "---"
# Darwin ARM64 with CGO
- id: darwin-arm64-cgo
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CGO_CFLAGS=-O2 -arch arm64 -mmacosx-version-min=11.0
- CGO_LDFLAGS=-arch arm64 -mmacosx-version-min=11.0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- darwin
goarch:
- arm64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for darwin/arm64 (CGO)"
- echo "Checking osxcross tools..."
- which oa64-clang || echo "oa64-clang not found"
- which oa64-clang++ || echo "oa64-clang++ not found"
post:
- echo "Successfully built darwin/arm64 (CGO)"
- echo "---"
# Linux RISC-V 64 with CGO
- id: linux-riscv64-cgo
env:
- CGO_ENABLED=1
- CC=riscv64-linux-gnu-gcc
- CGO_CFLAGS=-O1 -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- riscv64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/riscv64 (CGO)"
post:
- echo "Successfully built linux/riscv64 (CGO)"
- echo "---"
# Linux MIPS64 with CGO
- id: linux-mips64-cgo
env:
- CGO_ENABLED=1
- CC=mips64-linux-gnuabi64-gcc
- CGO_CFLAGS=-O1 -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- mips64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/mips64 (CGO)"
post:
- echo "Successfully built linux/mips64 (CGO)"
- echo "---"
# Linux MIPS64LE with CGO
- id: linux-mips64le-cgo
env:
- CGO_ENABLED=1
- CC=mips64el-linux-gnuabi64-gcc
- CGO_CFLAGS=-O1 -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- mips64le
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/mips64le (CGO)"
post:
- echo "Successfully built linux/mips64le (CGO)"
- echo "---"
# Linux PPC64LE with CGO
- id: linux-ppc64le-cgo
env:
- CGO_ENABLED=1
- CC=powerpc64le-linux-gnu-gcc
- CGO_CFLAGS=-O1 -fno-stack-protector
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- ppc64le
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/ppc64le (CGO)"
post:
- echo "Successfully built linux/ppc64le (CGO)"
- echo "---"
# Linux ARM (no CGO)
- id: linux-arm-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- linux
goarch:
- arm
goarm:
- "5"
- "6"
- "7"
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/arm (no CGO)"
post:
- echo "Successfully built linux/arm (no CGO)"
- echo "---"
# Linux S390X (no CGO)
- id: linux-s390x-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- linux
goarch:
- s390x
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/s390x (no CGO)"
post:
- echo "Successfully built linux/s390x (no CGO)"
- echo "---"
# Linux MIPS (no CGO)
- id: linux-mips-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- linux
goarch:
- mips
gomips:
- softfloat
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/mips (no CGO)"
post:
- echo "Successfully built linux/mips (no CGO)"
- echo "---"
# Linux MIPSLE (no CGO)
- id: linux-mipsle-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- linux
goarch:
- mipsle
gomips:
- softfloat
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/mipsle (no CGO)"
post:
- echo "Successfully built linux/mipsle (no CGO)"
- echo "---"
# Linux PPC64 (no CGO)
- id: linux-ppc64-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- linux
goarch:
- ppc64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for linux/ppc64 (no CGO)"
post:
- echo "Successfully built linux/ppc64 (no CGO)"
- echo "---"
# FreeBSD AMD64 (no CGO)
- id: freebsd-amd64-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- freebsd
goarch:
- amd64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for freebsd/amd64 (no CGO)"
post:
- echo "Successfully built freebsd/amd64 (no CGO)"
- echo "---"
# FreeBSD ARM64 (no CGO)
- id: freebsd-arm64-nocgo
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- freebsd
goarch:
- arm64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Starting build for freebsd/arm64 (no CGO)"
post:
- echo "Successfully built freebsd/arm64 (no CGO)"
- echo "---"
universal_binaries:
- name_template: "goecs"
replace: false
ids:
- darwin-amd64-cgo
- darwin-arm64-cgo
checksum:
name_template: "checksums.txt"
algorithm: sha256
disable: false
ids:
- linux-amd64-cgo
- linux-386-cgo
- linux-arm64-cgo
- linux-riscv64-cgo
- linux-mips64-cgo
- linux-mips64le-cgo
- linux-ppc64le-cgo
- windows-amd64-cgo
- windows-386-cgo
- darwin-amd64-cgo
- darwin-arm64-cgo
- linux-arm-nocgo
- linux-s390x-nocgo
- linux-mips-nocgo
- linux-mipsle-nocgo
- linux-ppc64-nocgo
- freebsd-amd64-nocgo
- freebsd-arm64-nocgo
extra_files:
- glob: "./goecs.sh"
snapshot:
name_template: "goecs"
archives:
- id: default
name_template: "goecs_{{ .Os }}_{{ .Arch }}"
format: zip
files:
- none*
allow_different_binary_count: true
builds:
- linux-amd64-cgo
- linux-386-cgo
- linux-arm64-cgo
- linux-riscv64-cgo
- linux-mips64-cgo
- linux-mips64le-cgo
- linux-ppc64le-cgo
- windows-amd64-cgo
- windows-386-cgo
- darwin-amd64-cgo
- darwin-arm64-cgo
- linux-arm-nocgo
- linux-s390x-nocgo
- linux-mips-nocgo
- linux-mipsle-nocgo
- linux-ppc64-nocgo
- freebsd-amd64-nocgo
- freebsd-arm64-nocgo
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore"
- Merge pull request
- Merge branch
- go mod tidy
- New translations

View File

@@ -12,5 +12,5 @@ func Basic(language string) {
ipInfo, _, _ := network.NetworkCheck("both", false, language) ipInfo, _, _ := network.NetworkCheck("both", false, language)
systemInfo := system.CheckSystemInfo(language) systemInfo := system.CheckSystemInfo(language)
basicInfo := strings.ReplaceAll(systemInfo+ipInfo, "\n\n", "\n") basicInfo := strings.ReplaceAll(systemInfo+ipInfo, "\n\n", "\n")
fmt.Printf(basicInfo) fmt.Print(basicInfo)
} }

132
.back/build.yaml Normal file
View File

@@ -0,0 +1,132 @@
name: Goreleaser
on:
workflow_dispatch:
tags:
- "v*.*.*"
jobs:
goreleaser:
runs-on: ubuntu-latest
container:
# 1.20 是 Windows 7/8 Server 2008/2012 最后一个支持版本
image: goreleaser/goreleaser-cross:v1.20
steps:
- name: Configure git safe directory
run: |
git config --global --add safe.directory /__w/ecs/ecs
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.4
- name: Configure Git for Private Modules
run: |
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
git config --global url."git@github.com:".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
- name: Install missing cross-compilation tools
run: |
echo "Installing missing cross-compilation tools..."
apt-get update
PACKAGES=(
gcc-multilib
g++-multilib
linux-libc-dev
linux-libc-dev:i386
libc6-dev-i386
libc6-dev-i386-cross
gcc-aarch64-linux-gnu
gcc-riscv64-linux-gnu
gcc-mips64-linux-gnuabi64
gcc-mips64el-linux-gnuabi64
gcc-powerpc64le-linux-gnu
gcc-mingw-w64-x86-64
gcc-mingw-w64-i686
libc6-dev-amd64-cross
libc6-dev-arm64-cross
libc6-dev-riscv64-cross
libc6-dev-mips64-cross
libc6-dev-mips64el-cross
libc6-dev-ppc64el-cross
)
for pkg in "${PACKAGES[@]}"; do
echo "Installing $pkg..."
apt-get install -y "$pkg" || echo "Failed to install $pkg, continuing..."
done
- name: Verify cross-compilation tools
run: |
echo "Checking available cross-compilation tools..."
echo "=== GCC compilers ==="
which gcc || echo "gcc not found"
which x86_64-linux-gnu-gcc || echo "x86_64-linux-gnu-gcc not found"
which aarch64-linux-gnu-gcc || echo "aarch64-linux-gnu-gcc not found"
which riscv64-linux-gnu-gcc || echo "riscv64-linux-gnu-gcc not found"
which mips64-linux-gnuabi64-gcc || echo "mips64-linux-gnuabi64-gcc not found"
which mips64el-linux-gnuabi64-gcc || echo "mips64el-linux-gnuabi64-gcc not found"
which powerpc64le-linux-gnu-gcc || echo "powerpc64le-linux-gnu-gcc not found"
echo "=== MinGW compilers ==="
which x86_64-w64-mingw32-gcc || echo "x86_64-w64-mingw32-gcc not found"
which i686-w64-mingw32-gcc || echo "i686-w64-mingw32-gcc not found"
echo "=== OSXCross compilers ==="
which o64-clang || echo "o64-clang not found"
which oa64-clang || echo "oa64-clang not found"
which o64-clang++ || echo "o64-clang++ not found"
which oa64-clang++ || echo "oa64-clang++ not found"
echo "=== Clang compilers ==="
which clang || echo "clang not found"
echo "=== Available gcc binaries ==="
ls -la /usr/bin/*gcc* | head -20
echo "=== Available clang binaries ==="
ls -la /usr/bin/*clang* | head -10
echo "=== OSXCross directory ==="
ls -la /usr/osxcross/bin/ 2>/dev/null || echo "OSXCross not found in /usr/osxcross/bin/"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --parallelism 1 --verbose
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
GOPRIVATE: github.com/oneclickvirt/security
- name: Update goecs.sh with new version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.1.37")
fi
echo "Using version: $VERSION"
FILE="goecs.sh"
BRANCH="master"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --unset url."git@github.com:".insteadOf || true
git fetch origin $BRANCH
git checkout $BRANCH
if [ ! -f "$FILE" ]; then
echo "Error: $FILE not found"
exit 1
fi
sed -i "s/\(_yellow \"Unable to get version info, using default version \).*\(\".*\)/\1$VERSION\2/" "$FILE"
sed -i "s/\(ECS_VERSION=\"\).*\(\"\)/\1$VERSION\2/" "$FILE"
if git diff --quiet "$FILE"; then
echo "No changes detected in $FILE"
exit 0
fi
git add "$FILE"
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
git push origin $BRANCH
env:
GITHUB_TOKEN: ${{ secrets.GHT }}

View File

@@ -7,5 +7,5 @@ import (
func ComMediaTest(language string) { func ComMediaTest(language string) {
res := commediatests.MediaTests(language) res := commediatests.MediaTests(language)
fmt.Printf(res) fmt.Print(res)
} }

View File

@@ -15,8 +15,8 @@ func TestIpv4SecurityCheck(t *testing.T) {
// 全项测试 // 全项测试
ipInfo, securityInfo, _ := NetworkCheck("both", true, "zh") ipInfo, securityInfo, _ := NetworkCheck("both", true, "zh")
fmt.Println("--------------------------------------------------") fmt.Println("--------------------------------------------------")
fmt.Printf(ipInfo) fmt.Print(ipInfo)
fmt.Println("--------------------------------------------------") fmt.Println("--------------------------------------------------")
fmt.Printf(securityInfo) fmt.Print(securityInfo)
fmt.Println("--------------------------------------------------") fmt.Println("--------------------------------------------------")
} }

View File

@@ -1,4 +1,4 @@
name: goreleaser name: Build and Release
on: on:
workflow_dispatch: workflow_dispatch:
@@ -22,7 +22,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v4 uses: actions/setup-go@v4
with: with:
go-version: 1.23.4 go-version: 1.24.5
- name: Configure Git for Private Modules - name: Configure Git for Private Modules
run: | run: |
@@ -32,10 +32,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GHT }} GITHUB_TOKEN: ${{ secrets.GHT }}
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2 uses: goreleaser/goreleaser-action@v6
with: with:
distribution: goreleaser distribution: goreleaser
version: latest # version: latest
version: '~> v2'
args: release args: release
env: env:
GITHUB_TOKEN: ${{ secrets.GHT }} GITHUB_TOKEN: ${{ secrets.GHT }}

467
.github/workflows/build_binary_cgo.old vendored Normal file
View File

@@ -0,0 +1,467 @@
name: Build and Release
on:
workflow_dispatch:
tags:
- "v*.*.*"
jobs:
build:
name: Release Check And Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
TAG="${{ steps.tag.outputs.tag }}"
PREV_TAG=$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
CHANGELOG=$(git log --oneline --pretty=format:"* %H %s" "$TAG" | head -20)
else
CHANGELOG=$(git log --oneline --pretty=format:"* %H %s" "$PREV_TAG..$TAG")
fi
FULL_CHANGELOG="## Changelog"$'\n'"$CHANGELOG"
echo "$FULL_CHANGELOG" > changelog.txt
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$FULL_CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create or update release
run: |
TAG="${{ steps.tag.outputs.tag }}"
CHANGELOG_BODY=$(cat changelog.txt | jq -Rs .)
RELEASE_EXISTS=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id // empty')
if [ -z "$RELEASE_EXISTS" ]; then
curl -s -X POST -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":$CHANGELOG_BODY,\"draft\":false,\"prerelease\":false}" \
"https://api.github.com/repos/${{ github.repository }}/releases"
else
curl -s -X PATCH -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/json" \
-d "{\"body\":$CHANGELOG_BODY}" \
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_EXISTS"
fi
- name: Delete existing release assets
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
if [ "$RELEASE_ID" != "null" ]; then
ASSETS=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" | jq -r '.[] | .id')
for asset in $ASSETS; do
curl -s -X DELETE -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/assets/$asset"
done
sleep 30
fi
release-binary:
name: Release Go Binary
needs: build
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
cgo_enabled: "1"
cc: x86_64-linux-gnu-gcc
cflags: "-O2 -static -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc"
runner: ubuntu-latest
- goos: linux
goarch: 386
cgo_enabled: "1"
cc: x86_64-linux-gnu-gcc
cflags: "-m32 -O1 -march=i686 -mtune=generic -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-multilib"
runner: ubuntu-latest
- goos: linux
goarch: arm64
cgo_enabled: "1"
cc: aarch64-linux-gnu-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-aarch64-linux-gnu"
runner: ubuntu-latest
- goos: linux
goarch: riscv64
cgo_enabled: "1"
cc: riscv64-linux-gnu-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-riscv64-linux-gnu"
runner: ubuntu-latest
- goos: linux
goarch: mips64
cgo_enabled: "1"
cc: mips64-linux-gnuabi64-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-mips64-linux-gnuabi64"
runner: ubuntu-latest
- goos: linux
goarch: mips64le
cgo_enabled: "1"
cc: mips64el-linux-gnuabi64-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-mips64el-linux-gnuabi64"
runner: ubuntu-latest
- goos: linux
goarch: ppc64le
cgo_enabled: "1"
cc: powerpc64le-linux-gnu-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-powerpc64le-linux-gnu"
runner: ubuntu-latest
- goos: linux
goarch: arm
# goarm: 7
cgo_enabled: "1"
cc: arm-linux-gnueabihf-gcc
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-arm-linux-gnueabihf"
runner: ubuntu-latest
- goos: windows
goarch: amd64
cgo_enabled: "1"
cc: x86_64-w64-mingw32-gcc
cflags: "-O2 -static-libgcc -static-libstdc++"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-mingw-w64-x86-64"
runner: ubuntu-latest
- goos: windows
goarch: 386
cgo_enabled: "1"
cc: i686-w64-mingw32-gcc
cflags: "-O2 -static-libgcc -static-libstdc++"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential gcc-mingw-w64-i686"
runner: ubuntu-latest
- goos: windows
goarch: arm64
cgo_enabled: "0"
ldflags: "-extldflags=-static -s -w"
packages: "build-essential"
runner: ubuntu-latest
- goos: darwin
goarch: amd64
cgo_enabled: "0"
ldflags: "-s -w"
runner: macos-latest
- goos: darwin
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
runner: macos-latest
- goos: linux
goarch: s390x
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: mips
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: mipsle
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: ppc64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: windows
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: freebsd
goarch: amd64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: freebsd
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.5
- name: Configure Git for Private Modules
run: |
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
git config --global url."git@github.com:".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
- name: Install cross-compilation tools
if: matrix.runner != 'macos-latest'
run: |
sudo apt-get update -qq
case "${{ matrix.goos }}-${{ matrix.goarch }}" in
linux-386)
sudo apt-get install -y build-essential gcc-multilib g++-multilib ;;
linux-arm64)
sudo apt-get install -y build-essential gcc-aarch64-linux-gnu ;;
linux-riscv64)
sudo apt-get install -y build-essential gcc-riscv64-linux-gnu ;;
linux-mips64)
sudo apt-get install -y build-essential gcc-mips64-linux-gnuabi64 ;;
linux-mips64le)
sudo apt-get install -y build-essential gcc-mips64el-linux-gnuabi64 ;;
linux-ppc64le)
sudo apt-get install -y build-essential gcc-powerpc64le-linux-gnu ;;
linux-arm)
sudo apt-get install -y build-essential gcc-arm-linux-gnueabihf ;;
windows-amd64|windows-386)
sudo apt-get install -y build-essential gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 ;;
*)
sudo apt-get install -y build-essential ;;
esac
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Build Binary
env:
CGO_ENABLED: ${{ matrix.cgo_enabled }}
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CC: ${{ matrix.cc }}
CGO_CFLAGS: ${{ matrix.cflags }}
CGO_LDFLAGS: ${{ matrix.ldflags }}
run: |
go clean -cache -modcache -testcache
# 设置额外的环境变量
if [[ -n "${{ matrix.goarm }}" ]]; then
export GOARM=${{ matrix.goarm }}
fi
if [[ -n "${{ matrix.gomips }}" ]]; then
export GOMIPS=${{ matrix.gomips }}
fi
# 针对 Darwin 的特殊处理
if [[ "${{ matrix.cgo_enabled }}" == "1" && "${{ matrix.goos }}" == "darwin" ]]; then
if [[ "${{ matrix.goarch }}" == "amd64" ]]; then
export CC="x86_64-apple-darwin21.4-clang"
export CXX="x86_64-apple-darwin21.4-clang++"
elif [[ "${{ matrix.goarch }}" == "arm64" ]]; then
export CC="aarch64-apple-darwin21.4-clang"
export CXX="aarch64-apple-darwin21.4-clang++"
fi
export OSXCROSS_ROOT="${OSXCROSS_ROOT}"
elif [[ "${{ matrix.cgo_enabled }}" == "1" && "${{ matrix.runner }}" != "macos-latest" ]]; then
# 对于 Windows 的特殊处理
if [[ "${{ matrix.goos }}" == "windows" ]]; then
export CGO_LDFLAGS="-static-libgcc -static-libstdc++"
fi
fi
# 测试编译器(仅在启用 CGO 时)
if [[ "${{ matrix.cgo_enabled }}" == "1" && -n "$CC" ]]; then
echo 'int main() { return 0; }' > test.c
$CC $CGO_CFLAGS test.c -o test || exit 1
rm -f test.c test
fi
# 清理和准备
rm -rf vendor/
go mod download
go mod tidy
mkdir -p bin
# 设置二进制文件名
BINARY_NAME="goecs"
if [[ "${{ matrix.goos }}" == "windows" ]]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
# 构建 LDFLAGS
LDFLAGS="-s -w -X main.version=${{ steps.tag.outputs.version }} -X main.arch=${{ matrix.goarch }}"
if [[ "${{ matrix.cgo_enabled }}" == "1" ]]; then
LDFLAGS="${LDFLAGS} -checklinkname=0 ${{ matrix.ldflags }}"
else
LDFLAGS="${LDFLAGS} -checklinkname=0 ${{ matrix.ldflags }}"
fi
# 执行构建
echo "Building for GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED"
go build -a -o bin/$BINARY_NAME -ldflags="$LDFLAGS" -trimpath ./
# 验证文件是否存在
[[ -f "bin/$BINARY_NAME" ]] || exit 1
# 显示构建信息
echo "Built binary: bin/$BINARY_NAME"
ls -la bin/
if command -v file >/dev/null 2>&1; then
file bin/$BINARY_NAME
fi
- name: Create ZIP archive
run: |
cd bin
BINARY_NAME="goecs"
if [[ "${{ matrix.goos }}" == "windows" ]]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
ZIP_NAME="goecs_${{ matrix.goos }}_${{ matrix.goarch }}"
if [[ -n "${{ matrix.goarm }}" ]]; then
ZIP_NAME="${ZIP_NAME}v${{ matrix.goarm }}"
fi
if [[ -n "${{ matrix.gomips }}" ]]; then
ZIP_NAME="${ZIP_NAME}_${{ matrix.gomips }}"
fi
ZIP_NAME="${ZIP_NAME}.zip"
zip "$ZIP_NAME" "$BINARY_NAME"
- name: Upload to Release
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
cd bin
for file in *.zip; do
if [[ -f "$file" ]]; then
curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$file"
fi
done
checksums:
name: Generate Checksums
runs-on: ubuntu-latest
needs: release-binary
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Download release assets
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
mkdir -p assets
ASSETS=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets")
echo "$ASSETS" | jq -r '.[] | select(.name | endswith(".zip")) | .browser_download_url' | while read url; do
filename=$(basename "$url")
curl -L -H "Authorization: Bearer ${{ secrets.GHT }}" "$url" -o "assets/$filename"
done
- name: Generate checksums
run: |
cd assets
sha256sum *.zip > checksums.txt
if [[ -f "../goecs.sh" ]]; then
sha256sum ../goecs.sh >> checksums.txt
fi
- name: Upload checksums
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: text/plain" \
--data-binary @assets/checksums.txt \
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=checksums.txt"
update-script:
name: Update Script Version
runs-on: ubuntu-latest
needs: checksums
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Update goecs.sh version
run: |
VERSION="${{ steps.tag.outputs.version }}"
BRANCH="master"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --unset url."git@github.com:".insteadOf || true
git fetch origin $BRANCH
git checkout $BRANCH
if [ -f "goecs.sh" ]; then
sed -i "s/\(_yellow \"Unable to get version info, using default version \).*\(\".*\)/\1$VERSION\2/" "goecs.sh"
sed -i "s/\(ECS_VERSION=\"\).*\(\"\)/\1$VERSION\2/" "goecs.sh"
if ! git diff --quiet "goecs.sh"; then
git add "goecs.sh"
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
git push origin $BRANCH
fi
fi
env:
GITHUB_TOKEN: ${{ secrets.GHT }}

527
.github/workflows/build_binary_musl.old vendored Normal file
View File

@@ -0,0 +1,527 @@
name: Build and Release
on:
workflow_dispatch:
tags:
- "v*.*.*"
jobs:
build:
name: Release Check And Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
TAG="${{ steps.tag.outputs.tag }}"
PREV_TAG=$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
CHANGELOG=$(git log --oneline --pretty=format:"* %H %s" "$TAG" | head -20)
else
CHANGELOG=$(git log --oneline --pretty=format:"* %H %s" "$PREV_TAG..$TAG")
fi
FULL_CHANGELOG="## Changelog"$'\n'"$CHANGELOG"
echo "$FULL_CHANGELOG" > changelog.txt
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$FULL_CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create or update release
run: |
TAG="${{ steps.tag.outputs.tag }}"
CHANGELOG_BODY=$(cat changelog.txt | jq -Rs .)
RELEASE_EXISTS=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id // empty')
if [ -z "$RELEASE_EXISTS" ]; then
curl -s -X POST -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":$CHANGELOG_BODY,\"draft\":false,\"prerelease\":false}" \
"https://api.github.com/repos/${{ github.repository }}/releases"
else
curl -s -X PATCH -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/json" \
-d "{\"body\":$CHANGELOG_BODY}" \
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_EXISTS"
fi
- name: Delete existing release assets
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
if [ "$RELEASE_ID" != "null" ]; then
ASSETS=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets" | jq -r '.[] | .id')
for asset in $ASSETS; do
curl -s -X DELETE -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/assets/$asset"
done
sleep 30
fi
build-musl-toolchain:
name: Build musl Cross-Compiler Toolchain
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-linux-musl
- i686-linux-musl
- aarch64-linux-musl
- riscv64-linux-musl
- mips64-linux-musl
- mips64el-linux-musl
- powerpc64le-linux-musl
- arm-linux-musleabihf
steps:
- name: Install build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y build-essential curl
- name: Cache musl toolchain
id: cache-musl
uses: actions/cache@v3
with:
path: /opt/musl-${{ matrix.target }}
key: musl-toolchain-${{ matrix.target }}-v2
- name: Build musl cross-compiler
if: steps.cache-musl.outputs.cache-hit != 'true'
run: |
# Clone musl-cross-make
git clone https://github.com/richfelker/musl-cross-make.git
cd musl-cross-make
# Create config for target
cat > config.mak << EOF
TARGET = ${{ matrix.target }}
OUTPUT = /opt/musl-${{ matrix.target }}
COMMON_CONFIG += --disable-nls
GCC_CONFIG += --enable-languages=c,c++
GCC_CONFIG += --disable-libquadmath --disable-decimal-float
GCC_CONFIG += --disable-libitm --disable-fixed-point
EOF
# Build the toolchain
make -j$(nproc)
sudo make install
# Verify installation
ls -la /opt/musl-${{ matrix.target }}/bin/
/opt/musl-${{ matrix.target }}/bin/${{ matrix.target }}-gcc --version
- name: Create toolchain artifact
run: |
sudo tar -czf musl-${{ matrix.target }}-toolchain.tar.gz -C /opt musl-${{ matrix.target }}
- name: Upload toolchain artifact
uses: actions/upload-artifact@v4
with:
name: musl-${{ matrix.target }}-toolchain
path: musl-${{ matrix.target }}-toolchain.tar.gz
retention-days: 1
release-binary:
name: Release Go Binary
needs: [build, build-musl-toolchain]
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
cgo_enabled: "1"
musl_target: x86_64-linux-musl
cflags: "-O2 -static -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: 386
cgo_enabled: "1"
musl_target: i686-linux-musl
cflags: "-O1 -march=i686 -mtune=generic -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: arm64
cgo_enabled: "1"
musl_target: aarch64-linux-musl
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: riscv64
cgo_enabled: "1"
musl_target: riscv64-linux-musl
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: mips64
cgo_enabled: "1"
musl_target: mips64-linux-musl
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: mips64le
cgo_enabled: "1"
musl_target: mips64el-linux-musl
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: ppc64le
cgo_enabled: "1"
musl_target: powerpc64le-linux-musl
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-static"
runner: ubuntu-latest
- goos: linux
goarch: arm
cgo_enabled: "1"
musl_target: arm-linux-musleabihf
cflags: "-O1 -fno-stack-protector"
ldflags: "-extldflags=-latomic -static"
runner: ubuntu-latest
- goos: windows
goarch: amd64
cgo_enabled: "1"
cc: x86_64-w64-mingw32-gcc
cflags: "-O2 -static-libgcc -static-libstdc++"
ldflags: "-extldflags=-static"
packages: "build-essential gcc-mingw-w64-x86-64"
runner: ubuntu-latest
- goos: windows
goarch: 386
cgo_enabled: "1"
cc: i686-w64-mingw32-gcc
cflags: "-O2 -static-libgcc -static-libstdc++"
ldflags: "-extldflags=-static"
packages: "build-essential gcc-mingw-w64-i686"
runner: ubuntu-latest
- goos: windows
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
packages: "build-essential"
runner: ubuntu-latest
- goos: darwin
goarch: amd64
cgo_enabled: "0"
ldflags: "-s -w"
runner: macos-latest
- goos: darwin
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
runner: macos-latest
- goos: linux
goarch: s390x
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: mips
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: mipsle
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: linux
goarch: ppc64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: freebsd
goarch: amd64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
- goos: freebsd
goarch: arm64
cgo_enabled: "0"
ldflags: "-s -w"
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.5
- name: Configure Git for Private Modules
run: |
git config --global url."https://${{ secrets.GHT }}@github.com/".insteadOf "https://github.com/"
git config --global url."git@github.com:".insteadOf "https://github.com/"
env:
GITHUB_TOKEN: ${{ secrets.GHT }}
- name: Download musl toolchain
if: matrix.musl_target != ''
uses: actions/download-artifact@v4
with:
name: musl-${{ matrix.musl_target }}-toolchain
- name: Setup musl toolchain
if: matrix.musl_target != ''
run: |
sudo tar -xzf musl-${{ matrix.musl_target }}-toolchain.tar.gz -C /opt/
echo "/opt/musl-${{ matrix.musl_target }}/bin" >> $GITHUB_PATH
# Verify toolchain is working
/opt/musl-${{ matrix.musl_target }}/bin/${{ matrix.musl_target }}-gcc --version
# Test compiler
echo 'int main() { return 0; }' > test.c
/opt/musl-${{ matrix.musl_target }}/bin/${{ matrix.musl_target }}-gcc ${{ matrix.cflags }} test.c -o test
rm -f test.c test
- name: Install cross-compilation tools (non-musl)
if: matrix.runner != 'macos-latest' && matrix.musl_target == ''
run: |
sudo systemctl restart systemd-resolved || true
sudo apt-get update -qq || (sleep 10 && sudo apt-get update -qq)
case "${{ matrix.goos }}-${{ matrix.goarch }}" in
windows-amd64|windows-386)
for i in 1 2 3; do
sudo apt-get install -y build-essential gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 && break || sleep 10
done ;;
*)
sudo systemctl restart systemd-resolved || true
for i in 1 2 3; do
sudo apt-get install -y build-essential && break || sleep 10
done ;;
esac
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Build Binary
env:
CGO_ENABLED: ${{ matrix.cgo_enabled }}
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_CFLAGS: ${{ matrix.cflags }}
CGO_LDFLAGS: ${{ matrix.ldflags }}
run: |
go clean -cache -modcache -testcache
# Set CC based on target
if [[ "${{ matrix.musl_target }}" != "" ]]; then
export CC="/opt/musl-${{ matrix.musl_target }}/bin/${{ matrix.musl_target }}-gcc"
export CXX="/opt/musl-${{ matrix.musl_target }}/bin/${{ matrix.musl_target }}-g++"
elif [[ "${{ matrix.cc }}" != "" ]]; then
export CC="${{ matrix.cc }}"
fi
# 设置额外的环境变量
if [[ -n "${{ matrix.goarm }}" ]]; then
export GOARM=${{ matrix.goarm }}
fi
if [[ -n "${{ matrix.gomips }}" ]]; then
export GOMIPS=${{ matrix.gomips }}
fi
# 针对 Darwin 的特殊处理
if [[ "${{ matrix.cgo_enabled }}" == "1" && "${{ matrix.goos }}" == "darwin" ]]; then
if [[ "${{ matrix.goarch }}" == "amd64" ]]; then
export CC="x86_64-apple-darwin21.4-clang"
export CXX="x86_64-apple-darwin21.4-clang++"
elif [[ "${{ matrix.goarch }}" == "arm64" ]]; then
export CC="aarch64-apple-darwin21.4-clang"
export CXX="aarch64-apple-darwin21.4-clang++"
fi
export OSXCROSS_ROOT="${OSXCROSS_ROOT}"
fi
# 清理和准备
rm -rf vendor/
go mod download
go mod tidy
mkdir -p bin
# 设置二进制文件名
BINARY_NAME="goecs"
if [[ "${{ matrix.goos }}" == "windows" ]]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
# 构建 LDFLAGS
LDFLAGS="-s -w -X main.version=${{ steps.tag.outputs.version }} -X main.arch=${{ matrix.goarch }}"
if [[ "${{ matrix.cgo_enabled }}" == "1" ]]; then
LDFLAGS="${LDFLAGS} -checklinkname=0 ${{ matrix.ldflags }}"
else
LDFLAGS="${LDFLAGS} -checklinkname=0 ${{ matrix.ldflags }}"
fi
# 执行构建
echo "Building for GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=$CGO_ENABLED"
if [[ -n "$CC" ]]; then
echo "Using CC=$CC"
fi
go build -a -o bin/$BINARY_NAME -ldflags="$LDFLAGS" -trimpath ./
# 验证文件是否存在
[[ -f "bin/$BINARY_NAME" ]] || exit 1
# 显示构建信息
echo "Built binary: bin/$BINARY_NAME"
ls -la bin/
if command -v file >/dev/null 2>&1; then
file bin/$BINARY_NAME
fi
- name: Create ZIP archive
run: |
cd bin
BINARY_NAME="goecs"
if [[ "${{ matrix.goos }}" == "windows" ]]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
ZIP_NAME="goecs_${{ matrix.goos }}_${{ matrix.goarch }}"
if [[ -n "${{ matrix.goarm }}" ]]; then
ZIP_NAME="${ZIP_NAME}v${{ matrix.goarm }}"
fi
if [[ -n "${{ matrix.gomips }}" ]]; then
ZIP_NAME="${ZIP_NAME}_${{ matrix.gomips }}"
fi
ZIP_NAME="${ZIP_NAME}.zip"
zip "$ZIP_NAME" "$BINARY_NAME"
- name: Upload to Release
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
cd bin
for file in *.zip; do
if [[ -f "$file" ]]; then
curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$file"
fi
done
checksums:
name: Generate Checksums
runs-on: ubuntu-latest
needs: release-binary
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Download release assets
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
mkdir -p assets
ASSETS=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets")
echo "$ASSETS" | jq -r '.[] | select(.name | endswith(".zip")) | .browser_download_url' | while read url; do
filename=$(basename "$url")
curl -L -H "Authorization: Bearer ${{ secrets.GHT }}" "$url" -o "assets/$filename"
done
- name: Generate checksums
run: |
cd assets
sha256sum *.zip > checksums.txt
if [[ -f "../goecs.sh" ]]; then
sha256sum ../goecs.sh >> checksums.txt
fi
- name: Upload checksums
run: |
TAG="${{ steps.tag.outputs.tag }}"
RELEASE_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id')
curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" \
-H "Content-Type: text/plain" \
--data-binary @assets/checksums.txt \
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=checksums.txt"
update-script:
name: Update Script Version
runs-on: ubuntu-latest
needs: checksums
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
- name: Update goecs.sh version
run: |
VERSION="${{ steps.tag.outputs.version }}"
BRANCH="master"
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global --unset url."git@github.com:".insteadOf || true
git fetch origin $BRANCH
git checkout $BRANCH
if [ -f "goecs.sh" ]; then
sed -i "s/\(_yellow \"Unable to get version info, using default version \).*\(\".*\)/\1$VERSION\2/" "goecs.sh"
sed -i "s/\(ECS_VERSION=\"\).*\(\"\)/\1$VERSION\2/" "goecs.sh"
if ! git diff --quiet "goecs.sh"; then
git add "goecs.sh"
git commit -m "chore: update ECS_VERSION to $VERSION in goecs.sh"
git push origin $BRANCH
fi
fi
env:
GITHUB_TOKEN: ${{ secrets.GHT }}

View File

@@ -1,8 +1,10 @@
name: Build and Push Docker Image name: Build and Push Docker Image
on: on:
release: workflow_run:
types: [ published ] workflows: ["Build and Release"]
types:
- completed
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -26,12 +28,19 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to CNB Registry # - name: Login to CNB Registry
# uses: docker/login-action@v2
# with:
# registry: ${{ secrets.CNB_DOCKER_REGISTRY }}
# username: ${{ secrets.CNB_USERNAME }}
# password: ${{ secrets.CNB_TOKEN }}
- name: Login to Aliyun Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${{ secrets.CNB_DOCKER_REGISTRY }} registry: crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com
username: ${{ secrets.CNB_USERNAME }} username: ${{ secrets.ALIYUN_USERNAME }}
password: ${{ secrets.CNB_TOKEN }} password: ${{ secrets.ALIYUN_PASSWORD }}
- name: Build and push Docker images - name: Build and push Docker images
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
@@ -39,8 +48,9 @@ jobs:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/riscv64 platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/riscv64
# linux/mips,linux/mipsle 暂不支持 alpine, linux/s390x 编译卡死 # linux/mips,linux/mipsle 暂不支持 alpine, linux/s390x 编译卡死cnb组织空间不足无法推送
# ${{ secrets.CNB_DOCKER_REGISTRY }}/oneclickvirt/ecs:latest
push: true push: true
tags: | tags: |
${{ secrets.DOCKER_USERNAME }}/goecs:latest ${{ secrets.DOCKER_USERNAME }}/goecs:latest
${{ secrets.CNB_DOCKER_REGISTRY }}/oneclickvirt/ecs:latest crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest

View File

@@ -1,8 +1,10 @@
name: Public Build name: Public Build
on: on:
release: workflow_run:
types: [ published ] workflows: ["Build and Release"]
types:
- completed
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -17,7 +19,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.23.4' go-version: '1.24.5'
- name: Create public branch - name: Create public branch
run: | run: |
@@ -28,49 +30,21 @@ jobs:
- name: Remove security package references - name: Remove security package references
run: | run: |
# 移除 network 包中对 security 的引用
find . -type f -name "*.go" -exec sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' {} + find . -type f -name "*.go" -exec sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' {} +
# 修改 back/network/network.go
cat > back/network/network.go << 'EOF'
package network1
import "github.com/oneclickvirt/basics/network"
func NetworkCheck(checkType string, enableSecurityCheck bool, language string) (string, string, error) {
ipInfo, _, err := network.NetworkCheck(checkType, false, language)
return ipInfo, "", err
}
EOF
# 修改 utils/utils.go 中的 BasicsAndSecurityCheck 函数
sed -i '/SecurityUploadToken/d' utils/utils.go sed -i '/SecurityUploadToken/d' utils/utils.go
sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' utils/utils.go sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' utils/utils.go
# 在 utils/utils.go 中添加 token 常量(在 import 语句之后)
sed -i '/^import/,/^)/{/^)/a\'$'\n''const token = "OvwKx5qgJtf7PZgCKbtyojSU.MTcwMTUxNzY1MTgwMw"'$'\n''}' utils/utils.go sed -i '/^import/,/^)/{/^)/a\'$'\n''const token = "OvwKx5qgJtf7PZgCKbtyojSU.MTcwMTUxNzY1MTgwMw"'$'\n''}' utils/utils.go
# 修改 go.mod移除私有仓库依赖
sed -i '/github.com\/oneclickvirt\/security/d' go.mod sed -i '/github.com\/oneclickvirt\/security/d' go.mod
# 修改 goecs.go禁用 security 检测
sed -i 's|var securityFlag = flag.Bool("security", true,|var securityFlag = flag.Bool("security", false,|g' goecs.go sed -i 's|var securityFlag = flag.Bool("security", true,|var securityFlag = flag.Bool("security", false,|g' goecs.go
# 更新依赖
go mod tidy go mod tidy
# 修改 README.md 和 README_EN.md 中的敏感信息
sed -i 's|但二进制文件编译至 \[securityCheck\].*)|但已开源|g' README.md sed -i 's|但二进制文件编译至 \[securityCheck\].*)|但已开源|g' README.md
sed -i 's|but binary files compiled in \[securityCheck\].*)|but open sourced|g' README_EN.md sed -i 's|but binary files compiled in \[securityCheck\].*)|but open sourced|g' README_EN.md
# 修改命令行帮助信息
sed -i 's|security.*Enable/Disable security test (default true)|security Enable/Disable security test (default false)|g' README.md sed -i 's|security.*Enable/Disable security test (default true)|security Enable/Disable security test (default false)|g' README.md
sed -i 's|security.*Enable/Disable security test (default true)|security Enable/Disable security test (default false)|g' README_EN.md sed -i 's|security.*Enable/Disable security test (default true)|security Enable/Disable security test (default false)|g' README_EN.md
- name: Build and Test - name: Build and Test
run: | run: |
# 构建二进制文件
go build -o maintest go build -o maintest
# 测试无菜单模式是否正常运行(禁用 security 检测)
./maintest -menu=false -l en -security=false -upload=false || exit 1 ./maintest -menu=false -l en -security=false -upload=false || exit 1
rm -rf maintest rm -rf maintest

View File

@@ -1,8 +1,10 @@
name: Sync Latest Release name: Sync Latest Release
on: on:
release: workflow_run:
types: [published] workflows: ["Build and Release"]
types:
- completed
workflow_dispatch: workflow_dispatch:
jobs: jobs:

View File

@@ -6,9 +6,7 @@ builds:
env: env:
- CGO_ENABLED=0 - CGO_ENABLED=0
ldflags: ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos: goos:
- linux - linux
- windows - windows
@@ -20,6 +18,10 @@ builds:
- amd64 - amd64
- mips - mips
- mipsle - mipsle
- mips64
- mips64le
- ppc64
- ppc64le
- s390x - s390x
- riscv64 - riscv64
gomips: gomips:
@@ -36,8 +38,6 @@ builds:
- CXX=o64-clang++ - CXX=o64-clang++
ldflags: ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos: goos:
- darwin - darwin
goarch: goarch:
@@ -51,8 +51,6 @@ builds:
- CXX=oa64-clang++ - CXX=oa64-clang++
ldflags: ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 - -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos: goos:
- darwin - darwin
goarch: goarch:

View File

@@ -1,6 +1,6 @@
# ECS # ECS
[![release](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [![Build and Release](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield)
@@ -8,7 +8,7 @@
融合怪测评项目 - GO版本 融合怪测评项目 - GO版本
(环境安装[非必须]使用shell外无额外shell文件依赖环境安装只是为了测的更准极端情况下无环境依赖安装也可全测项目) (环境安装[非必须]使用shell外无额外shell文件依赖环境安装只是为了测的更准极端情况下无环境依赖安装也可全测项目)
如有问题请 [issues](https://github.com/oneclickvirt/ecs/issues) 反馈。 如有问题请 [issues](https://github.com/oneclickvirt/ecs/issues) 反馈。
@@ -28,25 +28,27 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
### **编译与测试支持情况** ### **编译与测试支持情况**
| 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 | | 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 |
|---------------------------|-----------|---------|-----------| |---------------------------|--------------|---------------------------|---------------|
| amd64 | amd64 | Linux | Linux | | amd64 | amd64 | Linux | Linux |
| arm | arm | Windows | Windows | | arm64 | arm64 | Windows | Windows |
| arm64 | arm64 | FreeBSD | FreeBSD | | arm | | MacOS(Darwin) | MacOS |
| 386 | 386 | OpenBSD | | | 386 | | FreeBSD | |
| mips | | MacOS | | | mips,mipsle | | Android | |
| mipsle | | | | | mips64,mips64le | | | |
| ppc64,ppc64le | | | |
| s390x | s390x | | | | s390x | s390x | | |
| riscv64 | | | | | riscv64 | | | |
> 更多架构与系统请自行测试或编译,如有问题请开 issues。
> 更多架构与系统请自行测试,如有问题请开 issues。
### **待支持的系统** ### **待支持的系统**
| 系统 | 说明 |
|-----|---------------------------|
| MacOS | 存在硬件测试 BUG 未修复,存在环境依赖未修复 |
| Android(arm64) | 存在权限问题未修复非安卓系统的ARM架构无问题 |
| 系统 | 说明 |
|----------------|---------------------------|
| Android(arm64) | 存在权限问题未修复非安卓系统的ARM架构无问题 |
| OpenBSD/NetBSD | 部分Goalng的官方库未支持本系统(尤其是net相关项目) |
| Windows虚拟机 | 无Admin权限的mbw测试性能不准确(内存测试) |
| Windows物理机(非Admin下) | 无Admin权限的mbw测试性能不准确(内存测试) |
--- ---
## **功能** ## **功能**
@@ -59,10 +61,11 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
- 常见流媒体测试并发查询:[UnlockTests](https://github.com/oneclickvirt/UnlockTests),逻辑借鉴 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) 等 - 常见流媒体测试并发查询:[UnlockTests](https://github.com/oneclickvirt/UnlockTests),逻辑借鉴 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) 等
- IP 质量/安全信息并发查询:二进制文件编译至 [securityCheck](https://github.com/oneclickvirt/securityCheck) - IP 质量/安全信息并发查询:二进制文件编译至 [securityCheck](https://github.com/oneclickvirt/securityCheck)
- 邮件端口测试:[portchecker](https://github.com/oneclickvirt/portchecker) - 邮件端口测试:[portchecker](https://github.com/oneclickvirt/portchecker)
- 三网回程测试:借鉴 [zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace),二次开发至 [oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace) - 上游及回程路由线路检测:借鉴 [zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace),二次开发至 [oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace)
- 三网路由测试:基于 [NTrace-core](https://github.com/nxtrace/NTrace-core),二次开发至 [nt3](https://github.com/oneclickvirt/nt3) - 三网路由测试:基于 [NTrace-core](https://github.com/nxtrace/NTrace-core),二次开发至 [nt3](https://github.com/oneclickvirt/nt3)
- 网速测试:基于 [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) 和 [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID) 数据,开发至 [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest) - 网速测试:基于 [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) 和 [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID) 数据,开发至 [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)
- 三网 Ping 值测试:借鉴 [ecsspeed](https://github.com/spiritLHLS/ecsspeed),二次开发至 [pingtest](https://github.com/oneclickvirt/pingtest) - 三网 Ping 值测试:借鉴 [ecsspeed](https://github.com/spiritLHLS/ecsspeed),二次开发至 [pingtest](https://github.com/oneclickvirt/pingtest)
- 支持root或admin环境下测试支持非root或非admin环境下测试支持离线环境下进行测试**暂未**支持无DNS环境下进行测试
**本项目初次使用建议查看说明:[跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)** **本项目初次使用建议查看说明:[跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)**
@@ -70,7 +73,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
## **使用说明** ## **使用说明**
### **Linux/FreeBSD/OpenBSD/MacOS** ### **Linux/FreeBSD/MacOS**
#### **一键命令** #### **一键命令**
@@ -265,22 +268,24 @@ docker run --rm spiritlhl/goecs:latest -menu=false -l zh
使用Docker执行测试硬件测试会有一些偏差和虚拟化架构判断失效还是推荐直接测试而不使用Docker测试。 使用Docker执行测试硬件测试会有一些偏差和虚拟化架构判断失效还是推荐直接测试而不使用Docker测试。
国内镜像地址https://cnb.cool/oneclickvirt/ecs/-/packages/docker/ecs 国内阿里云镜像加速
请确保执行下述命令前本机已安装Docker 请确保执行下述命令前本机已安装Docker
特权模式+host网络 特权模式+host网络
```shell ```shell
docker run --rm --privileged --network host docker.cnb.cool/oneclickvirt/ecs:latest -menu=false -l zh docker run --rm --privileged --network host crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest -menu=false -l zh
``` ```
非特权模式+非host网络 非特权模式+非host网络
```shell ```shell
docker run --rm docker.cnb.cool/oneclickvirt/ecs:latest -menu=false -l zh docker run --rm crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest -menu=false -l zh
``` ```
实际上还有CNB镜像地址 https://cnb.cool/oneclickvirt/ecs/-/packages/docker/ecs 但很可惜组织空间不足无法推送了,更推荐使用阿里云镜像加速
</details> </details>
--- ---
@@ -369,7 +374,7 @@ GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
## 致谢 ## 致谢
感谢 [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [ip.sb](https://ip.sb) [cheervision.co](https://cheervision.co) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [virustotal.com](https://www.virustotal.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) 等网站提供的API进行检测感谢互联网各网站提供的查询资源 感谢 [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) 等网站提供的API进行检测感谢互联网各网站提供的查询资源
感谢 感谢
@@ -393,6 +398,10 @@ GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
<img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;"> <img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;">
</a> </a>
## History Usage
![goecs](https://hits.spiritlhl.net/chart/goecs.svg)
## Stargazers over time ## Stargazers over time
[![Stargazers over time](https://starchart.cc/oneclickvirt/ecs.svg?variant=adaptive)](https://www.spiritlhl.net) [![Stargazers over time](https://starchart.cc/oneclickvirt/ecs.svg?variant=adaptive)](https://www.spiritlhl.net)

View File

@@ -1,6 +1,8 @@
# ecs # ECS
[![release](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [![Build and Release](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield)
[![Hits](https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net) [![Hits](https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net)
@@ -28,21 +30,26 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
| Supported for Compilation | Tested on | Supported OS for Compilation | Tested OS | | Supported for Compilation | Tested on | Supported OS for Compilation | Tested OS |
|---------------------------|-----------|------------------------------|-----------| |---------------------------|-----------|------------------------------|-----------|
| amd64 | amd64 | Linux | Linux | | amd64 | amd64 | Linux | Linux |
| arm | arm | Windows | Windows | | arm64 | arm64 | Windows | Windows |
| arm64 | arm64 | FreeBSD | FreeBSD | | arm | | MacOS(Darwin) | MacOS |
| 386 | 386 | OpenBSD | | | 386 | | FreeBSD | |
| mips | | MacOS | | | mips,mipsle | | Android | |
| mipsle | | | | | mips64,mips64le | | | |
| ppc64,ppc64le | | | |
| s390x | s390x | | | | s390x | s390x | | |
| riscv64 | | | | | riscv64 | | | |
> Please test additional architectures and systems yourself. If you encounter any issues, please open an issue. > For more information about the architecture and system, please test or compile it yourself, and open issues if you have any questions.
### **Systems Pending Support** ### **Systems Pending Support**
| OS | Notes | | OS | Notes |
|--------|-------------------------------------------------------------------------------------------------| |--------|-------------------------------------------------------------------------------------------------|
| MacOS | Hardware testing bugs and environment dependencies unresolved |
| Android(arm64) | Permission issues that are not fixed, no problems with ARM architecture for non-Android systems | | Android(arm64) | Permission issues that are not fixed, no problems with ARM architecture for non-Android systems |
| OpenBSD/NetBSD | Some of Goalng's official libraries do not support this system (especially net-related items) |
| Windows(Virtual Machines) | Inaccurate mbw test performance without Admin rights (memory tests) |
| Windows(Physical Machines)(not under Admin) | Inaccurate mbw test performance without Admin rights (memory tests) |
--- ---
## **Features** ## **Features**
@@ -59,6 +66,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
- Three-network route test: Modified from [NTrace-core](https://github.com/nxtrace/NTrace-core) to [nt3](https://github.com/oneclickvirt/nt3) - Three-network route test: Modified from [NTrace-core](https://github.com/nxtrace/NTrace-core) to [nt3](https://github.com/oneclickvirt/nt3)
- Speed test: Based on data from [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) and [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID), developed to [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest) - Speed test: Based on data from [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID) and [speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID), developed to [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)
- Three-network Ping test: Modified from [ecsspeed](https://github.com/spiritLHLS/ecsspeed) to [pingtest](https://github.com/oneclickvirt/pingtest) - Three-network Ping test: Modified from [ecsspeed](https://github.com/spiritLHLS/ecsspeed) to [pingtest](https://github.com/oneclickvirt/pingtest)
- Support root or admin environment testing, support non-root or non-admin environment testing, support offline environment for testing, not support no DNS environment for testing
**For first-time users of this project, it is recommended to check the instructions: [Jump to](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)** **For first-time users of this project, it is recommended to check the instructions: [Jump to](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)**
@@ -66,7 +74,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
## **Instructions for Use** ## **Instructions for Use**
### **Linux/FreeBSD/OpenBSD/MacOS** ### **Linux/FreeBSD/MacOS**
#### **One-click command** #### **One-click command**
@@ -338,6 +346,7 @@ GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
| Test stability | Core test components unchanged for 10+ years | Each major version updates test items, making scores hard to compare between versions (each version benchmarks against current best CPUs) | | Test stability | Core test components unchanged for 10+ years | Each major version updates test items, making scores hard to compare between versions (each version benchmarks against current best CPUs) |
| Test content | Only tests computing performance | Covers multiple performance aspects with weighted scores, though some tests aren't commonly used | | Test content | Only tests computing performance | Covers multiple performance aspects with weighted scores, though some tests aren't commonly used |
| Suitable scenarios | Good for quick tests, focuses on computing performance | Good for comprehensive testing | | Suitable scenarios | Good for quick tests, focuses on computing performance | Good for comprehensive testing |
| Ranking | [sysbench.spiritlhl.net](https://sysbench.spiritlhl.net/) | [browser.geekbench.com](https://browser.geekbench.com/) |
Note that `goecs` allows you to specify CPU test method via parameters. The default is chosen for faster testing across more systems. Note that `goecs` allows you to specify CPU test method via parameters. The default is chosen for faster testing across more systems.
@@ -363,7 +372,7 @@ Note that `goecs` allows you to specify CPU test method via parameters. The defa
## Thanks ## Thanks
Thank [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [ip.sb](https://ip.sb) [cheervision.co](https://cheervision.co) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [virustotal.com](https://www.virustotal.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) and others for providing APIs for testing, and thanks to various websites on the Internet for providing query resources. Thank [he.net](https://he.net) [bgp.tools](https://bgp.tools) [ipinfo.io](https://ipinfo.io) [maxmind.com](https://www.maxmind.com/en/home) [cloudflare.com](https://www.cloudflare.com/) [ip.sb](https://ip.sb) [scamalytics.com](https://scamalytics.com) [abuseipdb.com](https://www.abuseipdb.com/) [ip2location.com](https://ip2location.com/) [ip-api.com](https://ip-api.com) [ipregistry.co](https://ipregistry.co/) [ipdata.co](https://ipdata.co/) [ipgeolocation.io](https://ipgeolocation.io) [ipwhois.io](https://ipwhois.io) [ipapi.com](https://ipapi.com/) [ipapi.is](https://ipapi.is/) [ipqualityscore.com](https://www.ipqualityscore.com/) [bigdatacloud.com](https://www.bigdatacloud.com/) [dkly.net](https://data.dkly.net) [virustotal.com](https://www.virustotal.com/) and others for providing APIs for testing, and thanks to various websites on the Internet for providing query resources.
Thank Thank
@@ -387,6 +396,13 @@ Thanks also to the following platforms for editorial and testing support
<img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;"> <img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;">
</a> </a>
## History Usage
![goecs](https://hits.spiritlhl.net/chart/goecs.svg)
## Stargazers over time ## Stargazers over time
[![Stargazers over time](https://starchart.cc/oneclickvirt/ecs.svg?variant=adaptive)](https://www.spiritlhl.net) [![Stargazers over time](https://starchart.cc/oneclickvirt/ecs.svg?variant=adaptive)](https://www.spiritlhl.net)
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_large)

View File

@@ -15,7 +15,7 @@
- [流媒体解锁](#流媒体解锁) - [流媒体解锁](#流媒体解锁)
- [IP质量检测](#IP质量检测) - [IP质量检测](#IP质量检测)
- [邮件端口检测](#邮件端口检测) - [邮件端口检测](#邮件端口检测)
- [三网回城线路检测](#三网回城线路检测) - [上游及回程线路检测](#上游及回程线路检测)
- [三网回程路由检测](#三网回程路由检测) - [三网回程路由检测](#三网回程路由检测)
- [就近测速](#就近测速) - [就近测速](#就近测速)
@@ -101,6 +101,7 @@ IPV6 子网掩码根据宿主机信息查询的本机IPV6子网大小
| 测试稳定性 | 核心测试组件10年以上未变 | 每个大版本更新测试项,分数不同版本间难以对比(每个版本对标当前最好的CPU) | | 测试稳定性 | 核心测试组件10年以上未变 | 每个大版本更新测试项,分数不同版本间难以对比(每个版本对标当前最好的CPU) |
| 测试内容 | 仅测试计算性能,基于素数计算 | 覆盖多种性能测试,分数加权计算,但部分测试实际不常用 | | 测试内容 | 仅测试计算性能,基于素数计算 | 覆盖多种性能测试,分数加权计算,但部分测试实际不常用 |
| 适用场景 | 适合快速测试,仅测试计算性能 | 适合综合全面的测试 | | 适用场景 | 适合快速测试,仅测试计算性能 | 适合综合全面的测试 |
| 排行榜 | [sysbench.spiritlhl.net](https://sysbench.spiritlhl.net/) | [browser.geekbench.com](https://browser.geekbench.com/) |
默认使用```Sysbench```进行测试,基准大致如下: 默认使用```Sysbench```进行测试,基准大致如下:
@@ -186,11 +187,39 @@ AMD的7950x单核满血性能得分在6500左右AMD的5950x单核满血性能
具体当前宿主机不做邮局或者不收电子邮件,那么该项目指标不用理会。 具体当前宿主机不做邮局或者不收电子邮件,那么该项目指标不用理会。
### **三网回程线路检测** ### **上游及回程线路检测**
检测当前的宿主机的IP地址 到 四个主要POP点城市的三个主要运营商的接入点的IP地址 的线路,具体来说 #### 上游类型与运营商等级说明
电信163、联通4837、移动CMI 是常见的线路 - **直接上游Direct Upstream**
当前运营商直接购买网络服务的上级运营商,通常是 BGP 邻居。
- **间接上游Indirect Upstream**
直接上游的上级,形成层层向上的关系链。可通过 BGP 路由路径中的多跳信息识别。
| 等级 | 描述 |
|------|------|
| **Tier 1 Global** | 全球顶级运营商(如 AT&T、Verizon、NTT、Telia 等之间免费互联Settlement-Free Peering不依赖他人即可访问全球任意网络。 |
| **Tier 1 Regional** | 区域性顶级运营商,在特定区域具有一级能力,但在全球范围互联性稍弱。 |
| **Tier 1 Indirect** | 间接连接的 Tier 1非直接购买通过中间上游间接接入 Tier 1 网络。 |
| **Tier 2** | 需要向 Tier 1 付费购买上网能力的二级运营商,通常是各国主流电信商或 ISP。 |
| **CDN Provider** | 内容分发网络提供商,如 Cloudflare、Akamai、Fastly 等,主要用于内容加速而非传统上游。 |
| **Direct/Indirect Others** | 其他类型的直接或间接连接,如 IXInternet Exchange成员、私有对等互联等。 |
上游质量判断:直接接入的高等级上游(特别是 Tier 1 Global越多通常网络连通性越好。但实际网络质量也受到以下因素影响
- 上下游之间的商业结算关系;
- 购买的带宽套餐和服务质量;
- 对等端口Peering Ports大小和负载
- 网络拥塞、路由策略、延迟路径等。
无法完全从 BGP 路由中判断。
一般来说,**接入高质量上游越多,网络连通性越优**。但由于存在诸多不可见的商业和技术因素,**无法仅凭上游等级准确判断网络质量**上游检测约等于图一乐实际得看对应的路由情况和长时间Ping的情况。
然后是检测当前的宿主机的IP地址 到 四个主要POP点城市的三个主要运营商的接入点的IP地址 的线路,具体来说
电信163、联通4837、移动CMI 是常见的线路移动CMI对两广地区的移动运营商特供延迟低也能算优质仅限两广移动。
电信CN2GIA > 电信CN2GT 移动CMIN2 联通9929 算优质的线路 电信CN2GIA > 电信CN2GT 移动CMIN2 联通9929 算优质的线路
@@ -198,9 +227,9 @@ AMD的7950x单核满血性能得分在6500左右AMD的5950x单核满血性能
### **三网回程路由检测** ### **三网回程路由检测**
默认检测广州为目的地,实际可使用命令行参数指定目的地,见对应的说明。 默认检测广州为目的地,实际可使用命令行参数指定目的地,见对应的参数说明。
主要就是看是不是直连,是不是延迟低,是不是没有隐藏路由信息。如果路由全球跑,延迟起飞,那么线路自然不会好到哪里去。 主要就是看是不是直连,是不是延迟低,是不是没有隐藏路由信息。如果路由全球跑,延迟起飞,那么线路自然不会好到哪里去。有时候路由信息完全藏起来了,只知道实际使用的延迟低,实际可能也是优质线路只是查不到信息,这就没办法直接识别了。
### **就近测速** ### **就近测速**
@@ -250,9 +279,9 @@ Load: Displays system load.
Virtualization Architecture: Shows what virtualization architecture the host machine uses. Generally speaking, the recommended order is `Dedicated > KVM > Xen` virtualization. Other virtualization will have performance losses, leading to shared/degraded performance during use. However, this is not definitive. Only dedicated servers have completely independent resource usage; other virtualization methods basically all have resource sharing, depending on whether the host machine seller has a conscience. The specific performance merits still depend on the specialized tests that follow. Virtualization Architecture: Shows what virtualization architecture the host machine uses. Generally speaking, the recommended order is `Dedicated > KVM > Xen` virtualization. Other virtualization will have performance losses, leading to shared/degraded performance during use. However, this is not definitive. Only dedicated servers have completely independent resource usage; other virtualization methods basically all have resource sharing, depending on whether the host machine seller has a conscience. The specific performance merits still depend on the specialized tests that follow.
NAT Type: Displays NAT type. Specifically recommended in order: `Full Cone > Restricted Cone > Port Restricted Cone > Symmetric`. When not detectable, it will show `Inconclusive`. Generally speaking, if you're not using it for special purposes (related to special proxy and real-time communication needs), you don't need to pay attention to this metric. NAT Type: Displays NAT type. Specifically recommended in order: ```Full Cone > Restricted Cone > Port Restricted Cone > Symmetric```. When not detectable, it will show ```Inconclusive```. Generally speaking, if you're not using it for special purposes (related to special proxy and real-time communication needs), you don't need to pay attention to this metric.
TCP Acceleration Method: Generally this is the `cubic/bbr` congestion control protocol. Generally speaking, using bbr for proxy servers can improve network speed; for ordinary purposes, you don't need to pay attention to this indicator. TCP Acceleration Method: Generally this is the ```cubic/bbr``` congestion control protocol. Generally speaking, using bbr for proxy servers can improve network speed; for ordinary purposes, you don't need to pay attention to this indicator.
IPv4/IPv6 ASN: Displays the ASN organization ID and name that the host machine's IP belongs to. The same IDC may have multiple ASNs, and an ASN may have multiple vendors selling servers with different IP segments. The specific upstream and downstream relationships are complex and can be further viewed using bgp.tool. IPv4/IPv6 ASN: Displays the ASN organization ID and name that the host machine's IP belongs to. The same IDC may have multiple ASNs, and an ASN may have multiple vendors selling servers with different IP segments. The specific upstream and downstream relationships are complex and can be further viewed using bgp.tool.
@@ -272,18 +301,19 @@ Supports selecting `GeekBench` and `Sysbench` for testing through command line p
| Test Stability | Core test components unchanged for over 10 years | Test items updated with each major version, scores difficult to compare between different versions (each version benchmarks against current best CPUs) | | Test Stability | Core test components unchanged for over 10 years | Test items updated with each major version, scores difficult to compare between different versions (each version benchmarks against current best CPUs) |
| Test Content | Only tests computational performance, based on prime number calculation | Covers multiple performance tests, weighted score calculation, but some tests are not commonly used in practice | | Test Content | Only tests computational performance, based on prime number calculation | Covers multiple performance tests, weighted score calculation, but some tests are not commonly used in practice |
| Applicable Scenarios | Suitable for quick testing, only tests computational performance | Suitable for comprehensive testing | | Applicable Scenarios | Suitable for quick testing, only tests computational performance | Suitable for comprehensive testing |
| Ranking | [sysbench.spiritlhl.net](https://sysbench.spiritlhl.net/) | [browser.geekbench.com](https://browser.geekbench.com/) |
By default, `Sysbench` is used for testing, with the baseline roughly as follows: By default, ```Sysbench``` is used for testing, with the baseline roughly as follows:
CPU test single-core `Sysbench` scores above 5000 can be considered first tier, 4000 to 5000 points second tier, with roughly one tier per 1000 points. CPU test single-core ```Sysbench``` scores above 5000 can be considered first tier, 4000 to 5000 points second tier, with roughly one tier per 1000 points.
AMD's 7950x single-core full performance score is around 6500, AMD's 5950x single-core full performance score is around 5700, Intel's ordinary CPUs (E5 series, etc.) are around 1000~800, and single-core CPUs scoring below 500 can be said to have relatively poor performance. AMD's 7950x single-core full performance score is around 6500, AMD's 5950x single-core full performance score is around 5700, Intel's ordinary CPUs (E5 series, etc.) are around 1000~800, and single-core CPUs scoring below 500 can be said to have relatively poor performance.
Sometimes multi-core scores are the same as single-core scores, proving that the vendor is limiting program concurrent use of CPU, a typical example being Tencent Cloud. Sometimes multi-core scores are the same as single-core scores, proving that the vendor is limiting program concurrent use of CPU, a typical example being Tencent Cloud.
Benchmarks for ```Sysbench`` can be found in the [CPU Performance Ladder For Sysbench](https://sysbench.spiritlhl.net/) ladder chart, with specific scores regardless of the version of sysbench tested. Benchmarks for ```Sysbench``` can be found in the [CPU Performance Ladder For Sysbench](https://sysbench.spiritlhl.net/) ladder chart, with specific scores regardless of the version of sysbench tested.
For `GeekBench` baselines, see the [official website](https://browser.geekbench.com/processor-benchmarks/) ladder chart. Specific scores differ for each `GeekBench` version, so note which `GeekBench` version is being used when testing. For ```GeekBench``` baselines, see the [official website](https://browser.geekbench.com/processor-benchmarks/) ladder chart. Specific scores differ for each ```GeekBench``` version, so note which ```GeekBench``` version is being used when testing.
As an additional note, many things tested by `GeekBench` are not actually used in server usage processes, so the test is for reference only. Of course, `Sysbench` is very incomplete, but it can roughly compare CPU performance based on the most basic computational performance. As an additional note, many things tested by `GeekBench` are not actually used in server usage processes, so the test is for reference only. Of course, `Sysbench` is very incomplete, but it can roughly compare CPU performance based on the most basic computational performance.

View File

@@ -1,17 +1,17 @@
package cputest package cputest
import ( import (
"fmt"
"github.com/oneclickvirt/cputest/cpu"
"runtime" "runtime"
"strings" "strings"
"github.com/oneclickvirt/cputest/cpu"
) )
func CpuTest(language, testMethod, testThread string) { func CpuTest(language, testMethod, testThread string) (realTestMethod, res string) {
var res string
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
if testMethod != "winsat" && testMethod != "" { if testMethod != "winsat" && testMethod != "" {
res = "Detected host is Windows, using Winsat for testing.\n" // res = "Detected host is Windows, using Winsat for testing.\n"
realTestMethod = "winsat"
} }
res += cpu.WinsatTest(language, testThread) res += cpu.WinsatTest(language, testThread)
} else { } else {
@@ -19,21 +19,28 @@ func CpuTest(language, testMethod, testThread string) {
case "sysbench": case "sysbench":
res = cpu.SysBenchTest(language, testThread) res = cpu.SysBenchTest(language, testThread)
if res == "" { if res == "" {
res = "Sysbench test failed, switching to Geekbench for testing.\n" // res = "Sysbench test failed, switching to Geekbench for testing.\n"
realTestMethod = "geekbench"
res += cpu.GeekBenchTest(language, testThread) res += cpu.GeekBenchTest(language, testThread)
} else {
realTestMethod = "sysbench"
} }
case "geekbench": case "geekbench":
res = cpu.GeekBenchTest(language, testThread) res = cpu.GeekBenchTest(language, testThread)
if res == "" { if res == "" {
res = "Geekbench test failed, switching to Sysbench for testing.\n" // res = "Geekbench test failed, switching to Sysbench for testing.\n"
realTestMethod = "sysbench"
res += cpu.SysBenchTest(language, testThread) res += cpu.SysBenchTest(language, testThread)
} else {
realTestMethod = "geekbench"
} }
default: default:
res = "Invalid test method specified.\n" res = "Invalid test method specified.\n"
realTestMethod = "null"
} }
} }
if !strings.Contains(res, "\n") && res != "" { if !strings.Contains(res, "\n") && res != "" {
res += "\n" res += "\n"
} }
fmt.Print(res) return
} }

View File

@@ -1,9 +1,11 @@
package cputest package cputest
import ( import (
"fmt"
"testing" "testing"
) )
func Test(t *testing.T) { func Test(t *testing.T) {
CpuTest("zh", "sysbench", "1") _, res := CpuTest("zh", "sysbench", "1")
fmt.Print(res)
} }

View File

@@ -1,41 +1,41 @@
package disktest package disktest
import ( import (
"fmt"
"github.com/oneclickvirt/disktest/disk"
"runtime" "runtime"
"strings" "strings"
"github.com/oneclickvirt/disktest/disk"
) )
func DiskTest(language, testMethod, testPath string, isMultiCheck bool, autoChange bool) { func DiskTest(language, testMethod, testPath string, isMultiCheck bool, autoChange bool) (realTestMethod, res string) {
var res string
if runtime.GOOS == "windows" {
if testMethod != "winsat" && testMethod != "" {
res = "Detected host is Windows, using Winsat for testing.\n"
}
res = disk.WinsatTest(language, isMultiCheck, testPath)
} else {
switch testMethod { switch testMethod {
case "fio": case "fio":
res = disk.FioTest(language, isMultiCheck, testPath) res = disk.FioTest(language, isMultiCheck, testPath)
if res == "" && autoChange { if res == "" && autoChange {
res = "Fio test failed, switching to DD for testing.\n"
res += disk.DDTest(language, isMultiCheck, testPath) res += disk.DDTest(language, isMultiCheck, testPath)
realTestMethod = "dd"
} else {
realTestMethod = "fio"
} }
case "dd": case "dd":
res = disk.DDTest(language, isMultiCheck, testPath) res = disk.DDTest(language, isMultiCheck, testPath)
if res == "" && autoChange { if res == "" && autoChange {
res = "DD test failed, switching to Fio for testing.\n"
res += disk.FioTest(language, isMultiCheck, testPath) res += disk.FioTest(language, isMultiCheck, testPath)
realTestMethod = "fio"
} else {
realTestMethod = "dd"
} }
default: default:
res = "Unsupported test method specified.\n" if runtime.GOOS == "windows" {
realTestMethod = "winsat"
res = disk.WinsatTest(language, isMultiCheck, testPath)
} else {
res = disk.DDTest(language, isMultiCheck, testPath)
realTestMethod = "dd"
} }
} }
//fmt.Println("--------------------------------------------------")
if !strings.Contains(res, "\n") && res != "" { if !strings.Contains(res, "\n") && res != "" {
res += "\n" res += "\n"
} }
fmt.Printf("%s", res) return
//fmt.Println("--------------------------------------------------")
} }

View File

@@ -1,7 +1,11 @@
package disktest package disktest
import "testing" import (
"fmt"
"testing"
)
func TestDiskIoTest(t *testing.T) { func TestDiskIoTest(t *testing.T) {
DiskTest("zh", "sysbench", "", false, false) _, res := DiskTest("zh", "sysbench", "", false, false)
fmt.Print(res)
} }

88
go.mod
View File

@@ -1,52 +1,49 @@
module github.com/oneclickvirt/ecs module github.com/oneclickvirt/ecs
go 1.24.1 go 1.24.5
toolchain go1.24.2
require ( require (
github.com/imroc/req/v3 v3.50.0 github.com/imroc/req/v3 v3.54.0
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841
github.com/oneclickvirt/UnlockTests v0.0.27-20250628125053 github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204
github.com/oneclickvirt/backtrace v0.0.5-20250629024536 github.com/oneclickvirt/backtrace v0.0.7-20250811023541
github.com/oneclickvirt/basics v0.0.13-20250629023612 github.com/oneclickvirt/basics v0.0.15-20250805084236
github.com/oneclickvirt/cputest v0.0.10-20250404151448 github.com/oneclickvirt/cputest v0.0.12-20250720122317
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 github.com/oneclickvirt/defaultset v0.0.2-20240624082446
github.com/oneclickvirt/disktest v0.0.8-20250425015826 github.com/oneclickvirt/disktest v0.0.10-20250808140407
github.com/oneclickvirt/gostun v0.0.3-20250329105202 github.com/oneclickvirt/gostun v0.0.5-20250727155022
github.com/oneclickvirt/memorytest v0.0.5-20250406063420 github.com/oneclickvirt/memorytest v0.0.9-20250808065154
github.com/oneclickvirt/nt3 v0.0.5-20250416131047 github.com/oneclickvirt/nt3 v0.0.8-20250810151538
github.com/oneclickvirt/pingtest v0.0.7-20250413051539 github.com/oneclickvirt/pingtest v0.0.8-20250728015259
github.com/oneclickvirt/portchecker v0.0.3-20250329125750 github.com/oneclickvirt/portchecker v0.0.3-20250728015900
github.com/oneclickvirt/security v0.0.4-20250629033626 github.com/oneclickvirt/security v0.0.6-20250805090112
github.com/oneclickvirt/speedtest v0.0.9-20250521034111 github.com/oneclickvirt/speedtest v0.0.10-20250728015734
) )
require ( require (
github.com/PuerkitoBio/goquery v1.9.2 // indirect github.com/PuerkitoBio/goquery v1.9.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect github.com/andybalholm/brotli v1.2.0 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/cloudflare/circl v1.5.0 // indirect github.com/cloudflare/circl v1.6.1 // indirect
github.com/ebitengine/purego v0.8.4 // indirect
github.com/fatih/color v1.18.0 // indirect github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/gofrs/uuid/v5 v5.2.0 // indirect github.com/gofrs/uuid/v5 v5.2.0 // indirect
github.com/google/gopacket v1.1.19 // indirect github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/huin/goupnp v1.2.0 // indirect github.com/huin/goupnp v1.2.0 // indirect
github.com/icholy/digest v1.1.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jaypipes/ghw v0.12.0 // indirect github.com/jaypipes/ghw v0.17.0 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect github.com/jaypipes/pcidb v1.0.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.11 // indirect github.com/klauspost/compress v1.18.0 // indirect
github.com/koron/go-ssdp v0.0.4 // indirect github.com/koron/go-ssdp v0.0.4 // indirect
github.com/libp2p/go-nat v0.2.0 // indirect github.com/libp2p/go-nat v0.2.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-netroute v0.2.1 // indirect
@@ -60,10 +57,10 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxtrace/NTrace-core v1.4.0 // indirect github.com/nxtrace/NTrace-core v1.4.2 // indirect
github.com/oneclickvirt/dd v0.0.1-20250406062523 // indirect github.com/oneclickvirt/dd v0.0.2-20250808062818 // indirect
github.com/oneclickvirt/fio v0.0.1-20250406060851 // indirect github.com/oneclickvirt/fio v0.0.2-20250808045755 // indirect
github.com/onsi/ginkgo/v2 v2.22.1 // indirect github.com/oneclickvirt/mbw v0.0.1-20250808061222 // indirect
github.com/oschwald/maxminddb-golang v1.13.1 // indirect github.com/oschwald/maxminddb-golang v1.13.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pion/dtls/v2 v2.2.7 // indirect github.com/pion/dtls/v2 v2.2.7 // indirect
@@ -75,20 +72,19 @@ require (
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus-community/pro-bing v0.4.1 // indirect github.com/prometheus-community/pro-bing v0.4.1 // indirect
github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.48.2 // indirect github.com/quic-go/quic-go v0.53.0 // indirect
github.com/refraction-networking/utls v1.6.7 // indirect github.com/refraction-networking/utls v1.7.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect github.com/rivo/uniseg v0.4.7 // indirect
github.com/rodaine/table v1.3.0 // indirect github.com/rodaine/table v1.3.0 // indirect
github.com/sagikazarmark/locafero v0.9.0 // indirect github.com/sagikazarmark/locafero v0.9.0 // indirect
github.com/schollz/progressbar/v3 v3.14.4 // indirect github.com/schollz/progressbar/v3 v3.14.4 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v4 v4.24.5 // indirect github.com/shirou/gopsutil/v4 v4.25.6 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/showwin/speedtest-go v1.7.10 // indirect
github.com/showwin/speedtest-go v1.7.7 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.14.0 // indirect github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.7.1 // indirect github.com/spf13/cast v1.9.2 // indirect
github.com/spf13/pflag v1.0.6 // indirect github.com/spf13/pflag v1.0.7 // indirect
github.com/spf13/viper v1.20.1 // indirect github.com/spf13/viper v1.20.1 // indirect
github.com/subosito/gotenv v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect
@@ -98,19 +94,17 @@ require (
github.com/tklauser/numcpus v0.8.0 // indirect github.com/tklauser/numcpus v0.8.0 // indirect
github.com/tsosunchia/powclient v0.1.5 // indirect github.com/tsosunchia/powclient v0.1.5 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/mock v0.5.0 // indirect go.uber.org/mock v0.5.2 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.37.0 // indirect golang.org/x/crypto v0.40.0 // indirect
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect golang.org/x/mod v0.25.0 // indirect
golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.42.0 // indirect
golang.org/x/net v0.39.0 // indirect golang.org/x/sync v0.16.0 // indirect
golang.org/x/sync v0.13.0 // indirect golang.org/x/sys v0.34.0 // indirect
golang.org/x/sys v0.32.0 // indirect golang.org/x/term v0.33.0 // indirect
golang.org/x/term v0.31.0 // indirect golang.org/x/text v0.27.0 // indirect
golang.org/x/text v0.24.0 // indirect golang.org/x/tools v0.34.0 // indirect
golang.org/x/tools v0.29.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
howett.net/plist v1.0.0 // indirect howett.net/plist v1.0.0 // indirect
) )

183
go.sum
View File

@@ -2,43 +2,38 @@ github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk= github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss= github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU= github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw=
github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg=
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
@@ -50,20 +45,22 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY= github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY=
github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/imroc/req/v3 v3.50.0 h1:n3BVnZiTRpvkN5T1IB79LC/THhFU9iXksNRMH4ZNVaY= github.com/icholy/digest v1.1.0 h1:HfGg9Irj7i+IX1o1QAmPfIBNu/Q5A5Tu3n/MED9k9H4=
github.com/imroc/req/v3 v3.50.0/go.mod h1:tsOk8K7zI6cU4xu/VWCZVtq9Djw9IWm4MslKzme5woU= github.com/icholy/digest v1.1.0/go.mod h1:QNrsSGQ5v7v9cReDI0+eyjsXGUoRSUZQHeQ5C4XLa0Y=
github.com/imroc/req/v3 v3.54.0 h1:kwWJSpT7OvjJ/Q8ykp+69Ye5H486RKDcgEoepw1Ren4=
github.com/imroc/req/v3 v3.54.0/go.mod h1:P8gCJjG/XNUFeP6WOi40VAXfYwT+uPM00xvoBWiwzUQ=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jaypipes/ghw v0.12.0 h1:xU2/MDJfWmBhJnujHY9qwXQLs3DBsf0/Xa9vECY0Tho= github.com/jaypipes/ghw v0.17.0 h1:EVLJeNcy5z6GK/Lqby0EhBpynZo+ayl8iJWY0kbEUJA=
github.com/jaypipes/ghw v0.12.0/go.mod h1:jeJGbkRB2lL3/gxYzNYzEDETV1ZJ56OKr+CSeSEym+g= github.com/jaypipes/ghw v0.17.0/go.mod h1:In8SsaDqlb1oTyrbmTC14uy+fbBMvp+xdqX51MidlD8=
github.com/jaypipes/pcidb v1.0.0 h1:vtZIfkiCUE42oYbJS0TAq9XSfSmcsgo9IdxSm9qzYU8= github.com/jaypipes/pcidb v1.0.1 h1:WB2zh27T3nwg8AE8ei81sNRb9yWBii3JGNJtT7K9Oic=
github.com/jaypipes/pcidb v1.0.0/go.mod h1:TnYUvqhPBzCKnH34KrIX22kAeEbDCSRJ9cqLRCuNDfk= github.com/jaypipes/pcidb v1.0.1/go.mod h1:6xYUz/yYEyOkIkUt2t2J2folIuZ4Yg6uByCGFXMCeE4=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0=
github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
@@ -95,44 +92,42 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/nxtrace/NTrace-core v1.4.0 h1:pDN2BqxIYjedDKCDDOFBcDNOBnavGcx+4wbiG65Xqiw= github.com/nxtrace/NTrace-core v1.4.2 h1:dSRP18Bn3VGf5CZBzKt8gQWW9mDkq62Np9TCF9RAtp0=
github.com/nxtrace/NTrace-core v1.4.0/go.mod h1:0AWqbqiIJbpbFG6W48vtJ6pWM8PPF+lQ1fi2371y+zA= github.com/nxtrace/NTrace-core v1.4.2/go.mod h1:wIDOlccuYzY3wBqU89pv2KGHT41i3JA0eRqJU/x9eX4=
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRAKnnZYALmpBKvvuVaq34MEsuWwk6nc= github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRAKnnZYALmpBKvvuVaq34MEsuWwk6nc=
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4= github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
github.com/oneclickvirt/UnlockTests v0.0.27-20250628125053 h1:Ug8kySZR1weRUcsnGOv+f3HAl791AfkA7EWV3JmiMQA= github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204 h1:apFaEbHGKflYMZzK17nXzEai4GG873mTd+d9hCO/KdY=
github.com/oneclickvirt/UnlockTests v0.0.27-20250628125053/go.mod h1:yXWIZB6iLS88pEd9m4QJi1GENn+7I91zA72y5ONz2Oc= github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE=
github.com/oneclickvirt/backtrace v0.0.5-20250629024536 h1:caHCa0DHmbYWBFN1bqKxpvPnN0wOxDEqJv1VDvDdLWs= github.com/oneclickvirt/backtrace v0.0.7-20250811023541 h1:GzkzvUC6U9b6Dkz/Bl4JRPeQ7XBGoW7Qw1aWqzhF+MQ=
github.com/oneclickvirt/backtrace v0.0.5-20250629024536/go.mod h1:5AH00bo41hH3d2/JVuCTlBkZUs3AXX4nlKVXb6piZcI= github.com/oneclickvirt/backtrace v0.0.7-20250811023541/go.mod h1:/+KUtOWz48TyiTTbhVTsp3D6b5WY+4pCgvFBYtUGtns=
github.com/oneclickvirt/basics v0.0.13-20250629023612 h1:cQg+cGBt2NMRrjhJPH+CbevZrwtMU8pIZIY2Lp6zmt4= github.com/oneclickvirt/basics v0.0.15-20250805084236 h1:guYO6wGooSIOAIutuy/zfJ4sXj525nBITw8cjEPRaK8=
github.com/oneclickvirt/basics v0.0.13-20250629023612/go.mod h1:yN1IEOXN6v/GJqJSA70Pooo6nXBI/6rq72vTY72wJMQ= github.com/oneclickvirt/basics v0.0.15-20250805084236/go.mod h1:2PV+1ge01zb0Sqzj2V2I7P0wAdFSLF1XgAiumchJJbg=
github.com/oneclickvirt/cputest v0.0.10-20250404151448 h1:ovGtCwFXG0qmpyNDRqcNDIiAmhrtemCjIUXTJ1fPH0o= github.com/oneclickvirt/cputest v0.0.12-20250720122317 h1:toiwAK1hZE5b8klu2mOQ7J4sv5yV9lpPKwgPahfRYBQ=
github.com/oneclickvirt/cputest v0.0.10-20250404151448/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY= github.com/oneclickvirt/cputest v0.0.12-20250720122317/go.mod h1:vjlH8tkPFft1tlLOpeNskXVvurxkHaJ3+dgFxQGLXY4=
github.com/oneclickvirt/dd v0.0.1-20250406062523 h1:jegTww4fuoFEqwFozvGJEqUNI/5ew3QJ0XcKZZ/zuTs= github.com/oneclickvirt/dd v0.0.2-20250808062818 h1:0KHrKkdpL5oBE1OHsrRd2siRw4/2k6f9LBaP7T4JpOc=
github.com/oneclickvirt/dd v0.0.1-20250406062523/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU= github.com/oneclickvirt/dd v0.0.2-20250808062818/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc= github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc=
github.com/oneclickvirt/defaultset v0.0.2-20240624082446/go.mod h1:e9Jt4tf2sbemCtc84/XgKcHy9EZ2jkc5x2sW1NiJS+E= github.com/oneclickvirt/defaultset v0.0.2-20240624082446/go.mod h1:e9Jt4tf2sbemCtc84/XgKcHy9EZ2jkc5x2sW1NiJS+E=
github.com/oneclickvirt/disktest v0.0.8-20250425015826 h1:bwVg0zysB3uCwQV+KIIQpuq2IJXWdIcdjD2+FiKPo5w= github.com/oneclickvirt/disktest v0.0.10-20250808140407 h1:oUfi5zF3htUTB1ZJuClmK0o74ufP7icbu8LYCnxEOxE=
github.com/oneclickvirt/disktest v0.0.8-20250425015826/go.mod h1:sqVu6HwbnLmbnRj4389Xn08c301IhLnWCcbaEk2WzEc= github.com/oneclickvirt/disktest v0.0.10-20250808140407/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8=
github.com/oneclickvirt/fio v0.0.1-20250406060851 h1:b7xHKpPmU4q0NmvigRCEr3tQuAV/83ZIAGtHycLegw8= github.com/oneclickvirt/fio v0.0.2-20250808045755 h1:eWihCRWcalJjPIdrF8dMe68ZiPnMkSfHC8ENvElp/xE=
github.com/oneclickvirt/fio v0.0.1-20250406060851/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE= github.com/oneclickvirt/fio v0.0.2-20250808045755/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE=
github.com/oneclickvirt/gostun v0.0.3-20250329105202 h1:aJ6E91Lp94lq8iWRcCaxpXTjqOOaWvufr5oras6cFtM= github.com/oneclickvirt/gostun v0.0.5-20250727155022 h1:/e3gSUrOp1tg/1NTRx+P8B51OGcP26Q6//5EoSIjOvk=
github.com/oneclickvirt/gostun v0.0.3-20250329105202/go.mod h1:f7DPEXAxbmwXSW33dbxtb0/KzqvOBWhTs2Or5xBerQA= github.com/oneclickvirt/gostun v0.0.5-20250727155022/go.mod h1:pfp7MFZJK9n/KTLAVqqFcCAns4xqMykmjI+1UeF/vdE=
github.com/oneclickvirt/memorytest v0.0.5-20250406063420 h1:eHqpqFIx8Ss062uyNf7Ruv7FC4AdZbElR7u9vX2Oj3g= github.com/oneclickvirt/mbw v0.0.1-20250808061222 h1:WGXOe6QvHiDRhPVMI0VcctjzW08kGvJf50yq5YeZCtw=
github.com/oneclickvirt/memorytest v0.0.5-20250406063420/go.mod h1:HTd0sSxRjT4BcV8kcCh4fF2Nia0xgZNaVjhefsnypic= github.com/oneclickvirt/mbw v0.0.1-20250808061222/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
github.com/oneclickvirt/nt3 v0.0.5-20250416131047 h1:KL0xowq19cW+FMBGMJxdqpRNoeyR+eEmb+jYSubmlTk= github.com/oneclickvirt/memorytest v0.0.9-20250808065154 h1:mjYOvpFz2mpDU9MNjj66oIDcc2r6+zoW8veP616/+4Q=
github.com/oneclickvirt/nt3 v0.0.5-20250416131047/go.mod h1:CVsDJEaIdyyZHn3WKbhU8Wn6GOfmBNvJlC/dDLRqcSQ= github.com/oneclickvirt/memorytest v0.0.9-20250808065154/go.mod h1:DBxiVZX7mWCe0Fy+qu57ENheLo00sLfjKzvxiICrUtU=
github.com/oneclickvirt/pingtest v0.0.7-20250413051539 h1:mYOsEmMtwKr40hwM2NimVLpnbR2cjwuOh1c/9fQr2Dw= github.com/oneclickvirt/nt3 v0.0.8-20250810151538 h1:pXxtvTwTFWAh/+Hz89wDat42CFjqNdlFyASPRxSdE5g=
github.com/oneclickvirt/pingtest v0.0.7-20250413051539/go.mod h1:d3Ntx5m9lMll3a/k3+2B+5emj//vgDh4/NHTxs2qQE8= github.com/oneclickvirt/nt3 v0.0.8-20250810151538/go.mod h1:F1v+6xInBKnbUa8gV1M40R1HOzxg+obtduNhx3CTnmA=
github.com/oneclickvirt/portchecker v0.0.3-20250329125750 h1:TTNL0pnQlRsn046kW59I/9UWRpihttFHWnU7Ixycggk= github.com/oneclickvirt/pingtest v0.0.8-20250728015259 h1:egoxZRZBOWN3JqBwqEsULDyRo2/dpGMeWcmV3U87zig=
github.com/oneclickvirt/portchecker v0.0.3-20250329125750/go.mod h1:HQxSTrqM8/QFqHMTBZ7S8H9eEO5FkUXU1eb7ZX5Mk+k= github.com/oneclickvirt/pingtest v0.0.8-20250728015259/go.mod h1:gxwsxxwitNQiGq2OI0ZogYoOLwc8DtuOdSRe6/EvRqs=
github.com/oneclickvirt/security v0.0.4-20250629033626 h1:DEchQ7WKKz4CzQpMlweoqA993BGncvmp1rL1ICNDJ2g= github.com/oneclickvirt/portchecker v0.0.3-20250728015900 h1:AomzdppSOFB70AJESQhlp0IPbsHTTJGimAWDk2TzCWM=
github.com/oneclickvirt/security v0.0.4-20250629033626/go.mod h1:/5eVnZLvP7RUjwhoI6d8iIMP7msbkHC5So3ZxM+A7Zg= github.com/oneclickvirt/portchecker v0.0.3-20250728015900/go.mod h1:9sjMDPCd4Z40wkYB0S9gQPGH8YPtnNE1ZJthVIuHUzA=
github.com/oneclickvirt/speedtest v0.0.9-20250521034111 h1:yygDk+s5qFhPMDRzdMfyopm1xU512peNqY6WYyvYcfY= github.com/oneclickvirt/security v0.0.6-20250805090112 h1:lUNtsnpZ3JNLS4xxjFGGECaxA46yNyxbYjdust9W0M4=
github.com/oneclickvirt/speedtest v0.0.9-20250521034111/go.mod h1:zd5ZgIGslmtQLQehEfRjyumlvgDHTpCSMchKfKXoASI= github.com/oneclickvirt/security v0.0.6-20250805090112/go.mod h1:JB6SJWm5pbrngCgSTYLd2m4Hj8mHO6mJua1WgHMZOcE=
github.com/onsi/ginkgo/v2 v2.22.1 h1:QW7tbJAUDyVDVOM5dFa7qaybo+CRfR7bemlQUN6Z8aM= github.com/oneclickvirt/speedtest v0.0.10-20250728015734 h1:HKO7/JQ74ueXA8Wo8NIvcK9DphbEG/YTfAAVz/akSiY=
github.com/onsi/ginkgo/v2 v2.22.1/go.mod h1:S6aTpoRsSq2cZOd+pssHAlKW/Q/jZt6cPrPlnj4a1xM= github.com/oneclickvirt/speedtest v0.0.10-20250728015734/go.mod h1:0W8vnMbA3iucXLXFdGfe9Ia6RPS0izRO7jvu/SnH1P8=
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE= github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE=
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8= github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
@@ -158,10 +153,10 @@ github.com/prometheus-community/pro-bing v0.4.1 h1:aMaJwyifHZO0y+h8+icUz0xbToHbi
github.com/prometheus-community/pro-bing v0.4.1/go.mod h1:aLsw+zqCaDoa2RLVVSX3+UiCkBBXTMtZC3c7EkfWnAE= github.com/prometheus-community/pro-bing v0.4.1/go.mod h1:aLsw+zqCaDoa2RLVVSX3+UiCkBBXTMtZC3c7EkfWnAE=
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE= github.com/quic-go/quic-go v0.53.0 h1:QHX46sISpG2S03dPeZBgVIZp8dGagIaiu2FiVYvpCZI=
github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= github.com/quic-go/quic-go v0.53.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM= github.com/refraction-networking/utls v1.7.3 h1:L0WRhHY7Oq1T0zkdzVZMR6zWZv+sXbHB9zcuvsAEqCo=
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0= github.com/refraction-networking/utls v1.7.3/go.mod h1:TUhh27RHMGtQvjQq+RyO11P6ZNQNBb3N0v7wsEjKAIQ=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
@@ -175,22 +170,18 @@ github.com/schollz/progressbar/v3 v3.14.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9d
github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddUiuZ0kfQ/2tHlyNI= github.com/schollz/progressbar/v3 v3.14.4/go.mod h1:aT3UQ7yGm+2ZjeXPqsjTenwL3ddUiuZ0kfQ/2tHlyNI=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil/v4 v4.24.5 h1:gGsArG5K6vmsh5hcFOHaPm87UD003CaDMkAOweSQjhM= github.com/shirou/gopsutil/v4 v4.25.6 h1:kLysI2JsKorfaFPcYmcJqbzROzsBWEOAtw6A7dIfqXs=
github.com/shirou/gopsutil/v4 v4.24.5/go.mod h1:aoebb2vxetJ/yIDZISmduFvVNPHqXQ9SEJwRXxkf0RA= github.com/shirou/gopsutil/v4 v4.25.6/go.mod h1:PfybzyydfZcN+JMMjkF6Zb8Mq1A/VcogFFg7hj50W9c=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/showwin/speedtest-go v1.7.10 h1:9o5zb7KsuzZKn+IE2//z5btLKJ870JwO6ETayUkqRFw=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/showwin/speedtest-go v1.7.10/go.mod h1:Ei7OCTmNPdWofMadzcfgq1rUO7mvJy9Jycj//G7vyfA=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/showwin/speedtest-go v1.7.7 h1:VmK75SZOTKiuWjIVrs+mo7ZoKEw0utiGCvpnurS0olU=
github.com/showwin/speedtest-go v1.7.7/go.mod h1:uLgdWCNarXxlYsL2E5TOZpCIwpgSWnEANZp7gfHXHu0=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA= github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo= github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -227,8 +218,8 @@ github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
@@ -238,16 +229,14 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA=
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -256,14 +245,14 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -278,8 +267,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -287,38 +276,34 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU=
gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM=
howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g=

376
goecs.go
View File

@@ -7,6 +7,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"os" "os"
"os/exec"
"os/signal" "os/signal"
"regexp" "regexp"
"runtime" "runtime"
@@ -17,7 +18,6 @@ import (
"github.com/oneclickvirt/CommonMediaTests/commediatests" "github.com/oneclickvirt/CommonMediaTests/commediatests"
unlocktestmodel "github.com/oneclickvirt/UnlockTests/model" unlocktestmodel "github.com/oneclickvirt/UnlockTests/model"
backtrace "github.com/oneclickvirt/backtrace/bk"
backtracemodel "github.com/oneclickvirt/backtrace/model" backtracemodel "github.com/oneclickvirt/backtrace/model"
basicmodel "github.com/oneclickvirt/basics/model" basicmodel "github.com/oneclickvirt/basics/model"
cputestmodel "github.com/oneclickvirt/cputest/model" cputestmodel "github.com/oneclickvirt/cputest/model"
@@ -25,13 +25,14 @@ import (
"github.com/oneclickvirt/ecs/cputest" "github.com/oneclickvirt/ecs/cputest"
"github.com/oneclickvirt/ecs/disktest" "github.com/oneclickvirt/ecs/disktest"
"github.com/oneclickvirt/ecs/memorytest" "github.com/oneclickvirt/ecs/memorytest"
"github.com/oneclickvirt/ecs/nexttrace"
"github.com/oneclickvirt/ecs/speedtest" "github.com/oneclickvirt/ecs/speedtest"
"github.com/oneclickvirt/ecs/unlocktest" "github.com/oneclickvirt/ecs/unlocktest"
"github.com/oneclickvirt/ecs/upstreams"
"github.com/oneclickvirt/ecs/utils" "github.com/oneclickvirt/ecs/utils"
gostunmodel "github.com/oneclickvirt/gostun/model" gostunmodel "github.com/oneclickvirt/gostun/model"
memorytestmodel "github.com/oneclickvirt/memorytest/memory" memorytestmodel "github.com/oneclickvirt/memorytest/memory"
nt3model "github.com/oneclickvirt/nt3/model" nt3model "github.com/oneclickvirt/nt3/model"
"github.com/oneclickvirt/nt3/nt"
ptmodel "github.com/oneclickvirt/pingtest/model" ptmodel "github.com/oneclickvirt/pingtest/model"
"github.com/oneclickvirt/pingtest/pt" "github.com/oneclickvirt/pingtest/pt"
"github.com/oneclickvirt/portchecker/email" "github.com/oneclickvirt/portchecker/email"
@@ -39,7 +40,7 @@ import (
) )
var ( var (
ecsVersion = "v0.1.41" ecsVersion = "v0.1.77"
menuMode bool menuMode bool
onlyChinaTest bool onlyChinaTest bool
input, choice string input, choice string
@@ -59,7 +60,7 @@ var (
autoChangeDiskTestMethod = true autoChangeDiskTestMethod = true
filePath = "goecs.txt" filePath = "goecs.txt"
enabelUpload = true enabelUpload = true
help bool onlyIpInfoCheckStatus, help bool
goecsFlag = flag.NewFlagSet("goecs", flag.ContinueOnError) goecsFlag = flag.NewFlagSet("goecs", flag.ContinueOnError)
finish bool finish bool
) )
@@ -143,7 +144,7 @@ func parseFlags() {
goecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)") goecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)")
goecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root") goecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root")
goecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false") goecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false")
goecsFlag.StringVar(&nt3Location, "nt3loc", "GZ", "Specify NT3 test location (supported: GZ, SH, BJ, CD for Guangzhou, Shanghai, Beijing, Chengdu)") goecsFlag.StringVar(&nt3Location, "nt3loc", "GZ", "Specify NT3 test location (supported: GZ, SH, BJ, CD, ALL for Guangzhou, Shanghai, Beijing, Chengdu and all)")
goecsFlag.StringVar(&nt3CheckType, "nt3t", "ipv4", "Set NT3 test type (supported: both, ipv4, ipv6)") goecsFlag.StringVar(&nt3CheckType, "nt3t", "ipv4", "Set NT3 test type (supported: both, ipv4, ipv6)")
goecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test") goecsFlag.IntVar(&spNum, "spnum", 2, "Set the number of servers per operator for speed test")
goecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path") goecsFlag.BoolVar(&enableLogger, "log", false, "Enable/Disable logging in the current path")
@@ -185,11 +186,13 @@ func handleMenuMode(preCheck utils.NetCheckResult) {
commTestStatus, utTestStatus, securityTestStatus, emailTestStatus = false, false, false, false commTestStatus, utTestStatus, securityTestStatus, emailTestStatus = false, false, false, false
backtraceStatus, nt3Status, speedTestStatus = false, false, false backtraceStatus, nt3Status, speedTestStatus = false, false, false
autoChangeDiskTestMethod = true autoChangeDiskTestMethod = true
printMenuOptions() printMenuOptions(preCheck)
Loop: Loop:
for { for {
choice = getMenuChoice(language) choice = getMenuChoice(language)
switch choice { switch choice {
case "0":
os.Exit(0)
case "1": case "1":
setFullTestStatus(preCheck) setFullTestStatus(preCheck)
onlyChinaTest = utils.CheckChina(enableLogger) onlyChinaTest = utils.CheckChina(enableLogger)
@@ -235,6 +238,7 @@ Loop:
fmt.Println("Can not test without network connection!") fmt.Println("Can not test without network connection!")
return return
} }
nt3Location = "ALL"
setRouteTestStatus() setRouteTestStatus()
break Loop break Loop
default: default:
@@ -243,23 +247,99 @@ Loop:
} }
} }
func printMenuOptions() { // clearScreen 清屏
func clearScreen() {
var cmd *exec.Cmd
switch runtime.GOOS {
case "windows":
cmd = exec.Command("cmd", "/c", "cls")
case "darwin":
cmd = exec.Command("clear")
default:
cmd = exec.Command("clear")
}
cmd.Stdout = os.Stdout
_ = cmd.Run()
}
func printMenuOptions(preCheck utils.NetCheckResult) {
clearScreen() // 清屏
var stats *utils.StatsResponse
var statsErr error
var githubInfo *utils.GitHubRelease
var githubErr error
// 只有在网络连接正常时才获取统计信息和版本信息
if preCheck.Connected {
var pwg sync.WaitGroup
pwg.Add(2)
go func() {
defer pwg.Done()
stats, statsErr = utils.GetGoescStats()
}()
go func() {
defer pwg.Done()
githubInfo, githubErr = utils.GetLatestEcsRelease()
}()
pwg.Wait()
} else {
statsErr = fmt.Errorf("network not connected")
githubErr = fmt.Errorf("network not connected")
}
var statsInfo string
var cmp int
if preCheck.Connected {
// 网络连接正常时处理统计信息和版本比较
if statsErr != nil {
statsInfo = "NULL"
} else {
switch language { switch language {
case "zh": case "zh":
fmt.Println("VPS融合怪版本: ", ecsVersion) statsInfo = fmt.Sprintf("总使用量: %s | 今日使用: %s",
fmt.Println("1. 融合怪完全体") utils.FormatGoecsNumber(stats.Total),
utils.FormatGoecsNumber(stats.Daily))
case "en":
statsInfo = fmt.Sprintf("Total Usage: %s | Daily Usage: %s",
utils.FormatGoecsNumber(stats.Total),
utils.FormatGoecsNumber(stats.Daily))
}
}
if githubErr == nil {
cmp = utils.CompareVersions(ecsVersion, githubInfo.TagName)
} else {
cmp = 0
}
}
switch language {
case "zh":
fmt.Printf("VPS融合怪版本: %s\n", ecsVersion)
if preCheck.Connected {
switch cmp {
case -1:
fmt.Printf("检测到新版本 %s 如有必要请更新!\n", githubInfo.TagName)
}
fmt.Printf("使用统计: %s\n", statsInfo)
}
fmt.Println("1. 融合怪完全体(能测全测)")
fmt.Println("2. 极简版(系统信息+CPU+内存+磁盘+测速节点5个)") fmt.Println("2. 极简版(系统信息+CPU+内存+磁盘+测速节点5个)")
fmt.Println("3. 精简版(系统信息+CPU+内存+磁盘+常用流媒体+路由+测速节点5个)") fmt.Println("3. 精简版(系统信息+CPU+内存+磁盘+常用流媒体+路由+测速节点5个)")
fmt.Println("4. 精简网络版(系统信息+CPU+内存+磁盘+回程+路由+测速节点5个)") fmt.Println("4. 精简网络版(系统信息+CPU+内存+磁盘+回程+路由+测速节点5个)")
fmt.Println("5. 精简解锁版(系统信息+CPU+内存+磁盘IO+御三家+常用流媒体+测速节点5个)") fmt.Println("5. 精简解锁版(系统信息+CPU+内存+磁盘IO+御三家+常用流媒体+测速节点5个)")
fmt.Println("6. 网络单项(IP质量检测+三网回程+三网路由与延迟+测速节点11个)") fmt.Println("6. 网络单项(IP质量检测+上游及三网回程+广州三网回程详细路由+全国延迟+测速节点11个)")
fmt.Println("7. 解锁单项(御三家解锁+常用流媒体解锁)") fmt.Println("7. 解锁单项(御三家解锁+常用流媒体解锁)")
fmt.Println("8. 硬件单项(系统信息+CPU+内存+dd磁盘测试+fio磁盘测试)") fmt.Println("8. 硬件单项(系统信息+CPU+dd磁盘测试+fio磁盘测试)")
fmt.Println("9. IP质量检测(15个数据库的IP检测+邮件端口检测)") fmt.Println("9. IP质量检测(15个数据库的IP质量检测+邮件端口检测)")
fmt.Println("10. 三网回程线路+广州三网路由+全国三网延迟") fmt.Println("10. 三网回程线路检测+三网回程详细路由(北京上海广州成都)+三网延迟测试(全国)")
fmt.Println("0. 退出程序")
case "en": case "en":
fmt.Println("VPS Fusion Monster Test Version: ", ecsVersion) fmt.Printf("VPS Fusion Monster Test Version: %s\n", ecsVersion)
fmt.Println("1. VPS Fusion Monster Test Comprehensive Test Suite") if preCheck.Connected {
switch cmp {
case -1:
fmt.Printf("New version detected %s update if necessary!\n", githubInfo.TagName)
}
fmt.Printf("%s\n", statsInfo)
}
fmt.Println("1. VPS Fusion Monster Test (Full Test)")
fmt.Println("2. Minimal Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)") fmt.Println("2. Minimal Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)")
fmt.Println("3. Standard Test Suite (System Info + CPU + Memory + Disk + Basic Unlock Tests + 5 Speed Test Nodes)") fmt.Println("3. Standard Test Suite (System Info + CPU + Memory + Disk + Basic Unlock Tests + 5 Speed Test Nodes)")
fmt.Println("4. Network-Focused Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)") fmt.Println("4. Network-Focused Test Suite (System Info + CPU + Memory + Disk + 5 Speed Test Nodes)")
@@ -268,6 +348,7 @@ func printMenuOptions() {
fmt.Println("7. Unlock-Only Test (Basic Unlock Tests + Common Streaming Services Unlock)") fmt.Println("7. Unlock-Only Test (Basic Unlock Tests + Common Streaming Services Unlock)")
fmt.Println("8. Hardware-Only Test (System Info + CPU + Memory + dd Disk Test + fio Disk Test)") fmt.Println("8. Hardware-Only Test (System Info + CPU + Memory + dd Disk Test + fio Disk Test)")
fmt.Println("9. IP Quality Test (IP Test with 15 Databases + Email Port Test)") fmt.Println("9. IP Quality Test (IP Test with 15 Databases + Email Port Test)")
fmt.Println("0. Exit Program")
} }
} }
@@ -334,39 +415,41 @@ func setUnlockFocusedTestStatus(preCheck utils.NetCheckResult) {
} }
func setNetworkOnlyTestStatus() { func setNetworkOnlyTestStatus() {
onlyIpInfoCheckStatus = true
securityTestStatus = true securityTestStatus = true
speedTestStatus = true speedTestStatus = true
backtraceStatus = true backtraceStatus = true
nt3Status = true nt3Status = true
pingTestStatus = true
} }
func setUnlockOnlyTestStatus() { func setUnlockOnlyTestStatus() {
onlyIpInfoCheckStatus = true
commTestStatus = true commTestStatus = true
utTestStatus = true utTestStatus = true
enabelUpload = false
} }
func setHardwareOnlyTestStatus(preCheck utils.NetCheckResult) { func setHardwareOnlyTestStatus(preCheck utils.NetCheckResult) {
_ = preCheck
basicStatus = true basicStatus = true
cpuTestStatus = true cpuTestStatus = true
memoryTestStatus = true memoryTestStatus = true
diskTestStatus = true diskTestStatus = true
if preCheck.Connected {
securityTestStatus = false securityTestStatus = false
autoChangeDiskTestMethod = false autoChangeDiskTestMethod = false
}
} }
func setIPQualityTestStatus() { func setIPQualityTestStatus() {
onlyIpInfoCheckStatus = true
securityTestStatus = true securityTestStatus = true
emailTestStatus = true emailTestStatus = true
} }
func setRouteTestStatus() { func setRouteTestStatus() {
onlyIpInfoCheckStatus = true
backtraceStatus = true backtraceStatus = true
nt3Status = true nt3Status = true
pingTestStatus = true pingTestStatus = true
enabelUpload = false
} }
func printInvalidChoice() { func printInvalidChoice() {
@@ -387,7 +470,7 @@ func handleLanguageSpecificSettings() {
} }
} }
func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *string, tempOutput string, uploadDone chan bool, outputMutex *sync.Mutex) { func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *string, _ string, uploadDone chan bool, outputMutex *sync.Mutex) {
select { select {
case <-sig: case <-sig:
if !finish { if !finish {
@@ -397,21 +480,26 @@ func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *str
seconds := int(duration.Seconds()) % 60 seconds := int(duration.Seconds()) % 60
currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006") currentTime := time.Now().Format("Mon Jan 2 15:04:05 MST 2006")
outputMutex.Lock() outputMutex.Lock()
*output = utils.PrintAndCapture(func() { timeInfo := utils.PrintAndCapture(func() {
utils.PrintCenteredTitle("", width) utils.PrintCenteredTitle("", width)
if language == "zh" {
fmt.Printf("花费 : %d 分 %d 秒\n", minutes, seconds)
fmt.Printf("时间 : %s\n", currentTime)
} else {
fmt.Printf("Cost Time : %d min %d sec\n", minutes, seconds) fmt.Printf("Cost Time : %d min %d sec\n", minutes, seconds)
fmt.Printf("Current Time : %s\n", currentTime) fmt.Printf("Current Time : %s\n", currentTime)
}
utils.PrintCenteredTitle("", width) utils.PrintCenteredTitle("", width)
}, tempOutput, *output) }, "", "")
*output += timeInfo
finalOutput := *output
outputMutex.Unlock() outputMutex.Unlock()
resultChan := make(chan struct { resultChan := make(chan struct {
httpURL string httpURL string
httpsURL string httpsURL string
}, 1) }, 1)
if enabelUpload {
go func() { go func() {
outputMutex.Lock()
finalOutput := *output
outputMutex.Unlock()
httpURL, httpsURL := utils.ProcessAndUpload(finalOutput, filePath, enabelUpload) httpURL, httpsURL := utils.ProcessAndUpload(finalOutput, filePath, enabelUpload)
resultChan <- struct { resultChan <- struct {
httpURL string httpURL string
@@ -446,21 +534,32 @@ func handleSignalInterrupt(sig chan os.Signal, startTime *time.Time, output *str
} }
os.Exit(1) os.Exit(1)
} }
} else {
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
fmt.Println("Press Enter to exit...")
fmt.Scanln()
}
os.Exit(0)
}
} }
os.Exit(0) os.Exit(0)
} }
} }
func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string { func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3, wg4, wg5 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) {
output = runBasicTests(preCheck, basicInfo, securityInfo, output, tempOutput, outputMutex) *output = runBasicTests(preCheck, basicInfo, securityInfo, *output, tempOutput, outputMutex)
output = runCPUTest(output, tempOutput, outputMutex) *output = runCPUTest(*output, tempOutput, outputMutex)
output = runMemoryTest(output, tempOutput, outputMutex) *output = runMemoryTest(*output, tempOutput, outputMutex)
output = runDiskTest(output, tempOutput, outputMutex) *output = runDiskTest(*output, tempOutput, outputMutex)
if (onlyChinaTest || pingTestStatus) && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if onlyIpInfoCheckStatus && !basicStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
wg3.Add(1) *output = runIpInfoCheck(*output, tempOutput, outputMutex)
}
var backtraceInfo, nt3Info string
if utTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" && !onlyChinaTest {
wg1.Add(1)
go func() { go func() {
defer wg3.Done() defer wg1.Done()
*ptInfo = pt.PingTest() *mediaInfo = unlocktest.MediaTest(language)
}() }()
} }
if emailTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if emailTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
@@ -470,32 +569,57 @@ func runChineseTests(preCheck utils.NetCheckResult, wg1, wg2, wg3 *sync.WaitGrou
*emailInfo = email.EmailCheck() *emailInfo = email.EmailCheck()
}() }()
} }
if utTestStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if (onlyChinaTest || pingTestStatus) && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
wg1.Add(1) wg3.Add(1)
go func() { go func() {
defer wg1.Done() defer wg3.Done()
*mediaInfo = unlocktest.MediaTest(language) *ptInfo = pt.PingTest()
}() }()
} }
if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
if backtraceStatus && !onlyChinaTest {
wg4.Add(1)
go func() {
defer wg4.Done()
backtraceInfo = utils.PrintAndCapture(func() {
utils.PrintCenteredTitle("上游及回程线路检测", width)
upstreams.UpstreamsCheck()
}, "", "")
}()
}
if nt3Status && !onlyChinaTest {
wg5.Add(1)
go func() {
defer wg5.Done()
nt3Info = utils.PrintAndCapture(func() {
utils.PrintCenteredTitle("三网回程路由检测", width)
nexttrace.NextTrace3Check(language, nt3Location, nt3CheckType)
}, "", "")
}()
}
}
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runStreamingTests(wg1, *mediaInfo, output, tempOutput, outputMutex) *output = runStreamingTests(wg1, mediaInfo, *output, tempOutput, outputMutex)
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex) *output = runSecurityTests(*securityInfo, *output, tempOutput, outputMutex)
output = runEmailTests(wg2, *emailInfo, output, tempOutput, outputMutex) *output = runEmailTests(wg2, emailInfo, *output, tempOutput, outputMutex)
} }
if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if runtime.GOOS != "windows" && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runNetworkTests(wg3, *ptInfo, output, tempOutput, outputMutex) *output = runNetworkTests(wg3, wg4, wg5, ptInfo, &backtraceInfo, &nt3Info, *output, tempOutput, outputMutex)
} }
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
output = runSpeedTests(output, tempOutput, outputMutex) *output = runSpeedTests(*output, tempOutput, outputMutex)
} }
return appendTimeInfo(output, tempOutput, startTime, outputMutex) *output = appendTimeInfo(*output, tempOutput, startTime, outputMutex)
} }
func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo *string, output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string { func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, basicInfo, securityInfo, emailInfo, mediaInfo *string, output *string, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) {
output = runBasicTests(preCheck, basicInfo, securityInfo, output, tempOutput, outputMutex) *output = runBasicTests(preCheck, basicInfo, securityInfo, *output, tempOutput, outputMutex)
output = runCPUTest(output, tempOutput, outputMutex) *output = runCPUTest(*output, tempOutput, outputMutex)
output = runMemoryTest(output, tempOutput, outputMutex) *output = runMemoryTest(*output, tempOutput, outputMutex)
output = runDiskTest(output, tempOutput, outputMutex) *output = runDiskTest(*output, tempOutput, outputMutex)
if onlyIpInfoCheckStatus && !basicStatus && preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
*output = runIpInfoCheck(*output, tempOutput, outputMutex)
}
if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" { if preCheck.Connected && preCheck.StackType != "" && preCheck.StackType != "None" {
if utTestStatus { if utTestStatus {
wg1.Add(1) wg1.Add(1)
@@ -511,15 +635,35 @@ func runEnglishTests(preCheck utils.NetCheckResult, wg1, wg2 *sync.WaitGroup, ba
*emailInfo = email.EmailCheck() *emailInfo = email.EmailCheck()
}() }()
} }
output = runStreamingTests(wg1, *mediaInfo, output, tempOutput, outputMutex) *output = runStreamingTests(wg1, mediaInfo, *output, tempOutput, outputMutex)
output = runSecurityTests(*securityInfo, output, tempOutput, outputMutex) *output = runSecurityTests(*securityInfo, *output, tempOutput, outputMutex)
output = runEmailTests(wg2, *emailInfo, output, tempOutput, outputMutex) *output = runEmailTests(wg2, emailInfo, *output, tempOutput, outputMutex)
output = runEnglishSpeedTests(output, tempOutput, outputMutex) *output = runEnglishSpeedTests(*output, tempOutput, outputMutex)
} }
return appendTimeInfo(output, tempOutput, startTime, outputMutex) *output = appendTimeInfo(*output, tempOutput, startTime, outputMutex)
}
// runIpInfoCheck 系统和网络基础信息检测不进行测试的时候该函数检测取得本机IP信息并显示(单项测试中输出)
func runIpInfoCheck(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() {
var ipinfo string
upstreams.IPV4, upstreams.IPV6, ipinfo = utils.OnlyBasicsIpInfo(language)
if ipinfo != "" {
if language == "zh" {
utils.PrintCenteredTitle("IP信息", width)
} else {
utils.PrintCenteredTitle("IP-Information", width)
}
fmt.Printf("%s", ipinfo)
}
}, tempOutput, output)
} }
func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string { func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
utils.PrintHead(language, width, ecsVersion) utils.PrintHead(language, width, ecsVersion)
if basicStatus || securityTestStatus { if basicStatus || securityTestStatus {
@@ -531,13 +675,13 @@ func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *strin
} }
} }
if preCheck.Connected && preCheck.StackType == "DualStack" { if preCheck.Connected && preCheck.StackType == "DualStack" {
*basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, nt3CheckType, securityTestStatus) upstreams.IPV4, upstreams.IPV6, *basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, nt3CheckType, securityTestStatus)
} else if preCheck.Connected && preCheck.StackType == "IPv4" { } else if preCheck.Connected && preCheck.StackType == "IPv4" {
*basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "ipv4", securityTestStatus) upstreams.IPV4, upstreams.IPV6, *basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "ipv4", securityTestStatus)
} else if preCheck.Connected && preCheck.StackType == "IPv6" { } else if preCheck.Connected && preCheck.StackType == "IPv6" {
*basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "ipv6", securityTestStatus) upstreams.IPV4, upstreams.IPV6, *basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "ipv6", securityTestStatus)
} else { } else {
*basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "", false) upstreams.IPV4, upstreams.IPV6, *basicInfo, *securityInfo, nt3CheckType = utils.BasicsAndSecurityCheck(language, "", false)
securityTestStatus = false securityTestStatus = false
} }
if basicStatus { if basicStatus {
@@ -556,57 +700,72 @@ func runBasicTests(preCheck utils.NetCheckResult, basicInfo, securityInfo *strin
} }
func runCPUTest(output, tempOutput string, outputMutex *sync.Mutex) string { func runCPUTest(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if cpuTestStatus { if cpuTestStatus {
realTestMethod, res := cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode)
if language == "zh" { if language == "zh" {
utils.PrintCenteredTitle(fmt.Sprintf("CPU测试-通过%s测试", cpuTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("CPU测试-通过%s测试", realTestMethod), width)
} else { } else {
utils.PrintCenteredTitle(fmt.Sprintf("CPU-Test--%s-Method", cpuTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("CPU-Test--%s-Method", realTestMethod), width)
} }
cputest.CpuTest(language, cpuTestMethod, cpuTestThreadMode) fmt.Print(res)
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runMemoryTest(output, tempOutput string, outputMutex *sync.Mutex) string { func runMemoryTest(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if memoryTestStatus { if memoryTestStatus {
realTestMethod, res := memorytest.MemoryTest(language, memoryTestMethod)
if language == "zh" { if language == "zh" {
utils.PrintCenteredTitle(fmt.Sprintf("内存测试-通过%s测试", memoryTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("内存测试-通过%s测试", realTestMethod), width)
} else { } else {
utils.PrintCenteredTitle(fmt.Sprintf("Memory-Test--%s-Method", memoryTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("Memory-Test--%s-Method", realTestMethod), width)
} }
memorytest.MemoryTest(language, memoryTestMethod) fmt.Print(res)
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runDiskTest(output, tempOutput string, outputMutex *sync.Mutex) string { func runDiskTest(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if diskTestStatus && autoChangeDiskTestMethod { if diskTestStatus && autoChangeDiskTestMethod {
realTestMethod, res := disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck, autoChangeDiskTestMethod)
if language == "zh" { if language == "zh" {
utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", diskTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", realTestMethod), width)
} else { } else {
utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", diskTestMethod), width) utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", realTestMethod), width)
} }
disktest.DiskTest(language, diskTestMethod, diskTestPath, diskMultiCheck, autoChangeDiskTestMethod) fmt.Print(res)
} else if diskTestStatus && !autoChangeDiskTestMethod { } else if diskTestStatus && !autoChangeDiskTestMethod {
if language == "zh" { if language == "zh" {
utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", "dd"), width) utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", "dd"), width)
disktest.DiskTest(language, "dd", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod) _, res := disktest.DiskTest(language, "dd", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod)
fmt.Print(res)
utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", "fio"), width) utils.PrintCenteredTitle(fmt.Sprintf("硬盘测试-通过%s测试", "fio"), width)
disktest.DiskTest(language, "fio", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod) _, res = disktest.DiskTest(language, "fio", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod)
fmt.Print(res)
} else { } else {
utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", "dd"), width) utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", "dd"), width)
disktest.DiskTest(language, "dd", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod) _, res := disktest.DiskTest(language, "dd", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod)
fmt.Print(res)
utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", "fio"), width) utils.PrintCenteredTitle(fmt.Sprintf("Disk-Test--%s-Method", "fio"), width)
disktest.DiskTest(language, "fio", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod) _, res = disktest.DiskTest(language, "fio", diskTestPath, diskMultiCheck, autoChangeDiskTestMethod)
fmt.Print(res)
} }
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo string, output, tempOutput string, outputMutex *sync.Mutex) string { func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if language == "zh" { if language == "zh" {
if commTestStatus && !onlyChinaTest { if commTestStatus && !onlyChinaTest {
@@ -621,14 +780,14 @@ func runStreamingTests(wg1 *sync.WaitGroup, mediaInfo string, output, tempOutput
} else { } else {
utils.PrintCenteredTitle("Cross-Border-Streaming-Media-Unlock", width) utils.PrintCenteredTitle("Cross-Border-Streaming-Media-Unlock", width)
} }
fmt.Printf("%s", mediaInfo) fmt.Printf("%s", *mediaInfo)
} else {
wg1.Wait()
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runSecurityTests(securityInfo, output, tempOutput string, outputMutex *sync.Mutex) string { func runSecurityTests(securityInfo, output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if securityTestStatus { if securityTestStatus {
if language == "zh" { if language == "zh" {
@@ -641,7 +800,9 @@ func runSecurityTests(securityInfo, output, tempOutput string, outputMutex *sync
}, tempOutput, output) }, tempOutput, output)
} }
func runEmailTests(wg2 *sync.WaitGroup, emailInfo string, output, tempOutput string, outputMutex *sync.Mutex) string { func runEmailTests(wg2 *sync.WaitGroup, emailInfo *string, output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if emailTestStatus { if emailTestStatus {
wg2.Wait() wg2.Wait()
@@ -650,42 +811,38 @@ func runEmailTests(wg2 *sync.WaitGroup, emailInfo string, output, tempOutput str
} else { } else {
utils.PrintCenteredTitle("Email-Port-Check", width) utils.PrintCenteredTitle("Email-Port-Check", width)
} }
fmt.Println(emailInfo) fmt.Println(*emailInfo)
} else {
wg2.Wait()
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runNetworkTests(wg3 *sync.WaitGroup, ptInfo string, output, tempOutput string, outputMutex *sync.Mutex) string { func runNetworkTests(wg3, wg4, wg5 *sync.WaitGroup, ptInfo, backtraceInfo, nt3Info *string, output, tempOutput string, outputMutex *sync.Mutex) string {
output = utils.PrintAndCapture(func() { outputMutex.Lock()
if backtraceStatus && !onlyChinaTest { defer outputMutex.Unlock()
utils.PrintCenteredTitle("三网回程线路检测", width) if wg4 != nil {
if strings.Contains(output, "IPV6") { wg4.Wait()
backtrace.BackTrace(true)
} else {
backtrace.BackTrace(false)
} }
if wg5 != nil {
wg5.Wait()
} }
}, tempOutput, output)
output = utils.PrintAndCapture(func() {
if nt3Status && !onlyChinaTest {
utils.PrintCenteredTitle("三网回程路由检测", width)
nt.TraceRoute(language, nt3Location, nt3CheckType)
}
}, tempOutput, output)
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if backtraceStatus && !onlyChinaTest && *backtraceInfo != "" {
fmt.Print(*backtraceInfo)
}
if nt3Status && !onlyChinaTest && *nt3Info != "" {
fmt.Print(*nt3Info)
}
if onlyChinaTest || pingTestStatus { if onlyChinaTest || pingTestStatus {
wg3.Wait() wg3.Wait()
utils.PrintCenteredTitle("三网ICMP的PING值检测", width) utils.PrintCenteredTitle("三网ICMP的PING值检测", width)
fmt.Println(ptInfo) fmt.Println(*ptInfo)
} else {
wg3.Wait()
} }
}, tempOutput, output) }, tempOutput, output)
} }
func runSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) string { func runSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if speedTestStatus { if speedTestStatus {
utils.PrintCenteredTitle("就近节点测速", width) utils.PrintCenteredTitle("就近节点测速", width)
@@ -706,6 +863,8 @@ func runSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) string {
} }
func runEnglishSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) string { func runEnglishSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
return utils.PrintAndCapture(func() { return utils.PrintAndCapture(func() {
if speedTestStatus { if speedTestStatus {
utils.PrintCenteredTitle("Speed-Test", width) utils.PrintCenteredTitle("Speed-Test", width)
@@ -717,6 +876,8 @@ func runEnglishSpeedTests(output, tempOutput string, outputMutex *sync.Mutex) st
} }
func appendTimeInfo(output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string { func appendTimeInfo(output, tempOutput string, startTime time.Time, outputMutex *sync.Mutex) string {
outputMutex.Lock()
defer outputMutex.Unlock()
endTime := time.Now() endTime := time.Now()
duration := endTime.Sub(startTime) duration := endTime.Sub(startTime)
minutes := int(duration.Minutes()) minutes := int(duration.Minutes())
@@ -752,16 +913,23 @@ func main() {
return return
} }
initLogger() initLogger()
go func() {
http.Get("https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false")
}()
preCheck := utils.CheckPublicAccess(3 * time.Second) preCheck := utils.CheckPublicAccess(3 * time.Second)
go func() {
if preCheck.Connected {
http.Get("https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false")
}
}()
if menuMode { if menuMode {
handleMenuMode(preCheck) handleMenuMode(preCheck)
} else {
onlyIpInfoCheckStatus = true
} }
handleLanguageSpecificSettings() handleLanguageSpecificSettings()
if !preCheck.Connected {
enabelUpload = false
}
var ( var (
wg1, wg2, wg3 sync.WaitGroup wg1, wg2, wg3, wg4, wg5 sync.WaitGroup
basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string basicInfo, securityInfo, emailInfo, mediaInfo, ptInfo string
output, tempOutput string output, tempOutput string
outputMutex sync.Mutex outputMutex sync.Mutex
@@ -773,13 +941,15 @@ func main() {
go handleSignalInterrupt(sig, &startTime, &output, tempOutput, uploadDone, &outputMutex) go handleSignalInterrupt(sig, &startTime, &output, tempOutput, uploadDone, &outputMutex)
switch language { switch language {
case "zh": case "zh":
output = runChineseTests(preCheck, &wg1, &wg2, &wg3, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, output, tempOutput, startTime, &outputMutex) runChineseTests(preCheck, &wg1, &wg2, &wg3, &wg4, &wg5, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &ptInfo, &output, tempOutput, startTime, &outputMutex)
case "en": case "en":
output = runEnglishTests(preCheck, &wg1, &wg2, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, output, tempOutput, startTime, &outputMutex) runEnglishTests(preCheck, &wg1, &wg2, &basicInfo, &securityInfo, &emailInfo, &mediaInfo, &output, tempOutput, startTime, &outputMutex)
default: default:
fmt.Println("Unsupported language") fmt.Println("Unsupported language")
} }
if preCheck.Connected {
handleUploadResults(output) handleUploadResults(output)
}
finish = true finish = true
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
fmt.Println("Press Enter to exit...") fmt.Println("Press Enter to exit...")

View File

@@ -143,7 +143,7 @@ goecs_check() {
os=$(uname -s 2>/dev/null || echo "Unknown") os=$(uname -s 2>/dev/null || echo "Unknown")
arch=$(uname -m 2>/dev/null || echo "Unknown") arch=$(uname -m 2>/dev/null || echo "Unknown")
check_china check_china
ECS_VERSION="0.1.40" ECS_VERSION="0.1.76"
for api in \ for api in \
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \ "https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \ "https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
@@ -155,8 +155,8 @@ goecs_check() {
sleep 1 sleep 1
done done
if [ -z "$ECS_VERSION" ]; then if [ -z "$ECS_VERSION" ]; then
_yellow "Unable to get version info, using default version 0.1.40" _yellow "Unable to get version info, using default version 0.1.76"
ECS_VERSION="0.1.40" ECS_VERSION="0.1.76"
fi fi
version_output="" version_output=""
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do

View File

@@ -1,17 +1,16 @@
package memorytest package memorytest
import ( import (
"fmt"
"github.com/oneclickvirt/memorytest/memory"
"runtime" "runtime"
"strings" "strings"
"github.com/oneclickvirt/memorytest/memory"
) )
func MemoryTest(language, testMethod string) { func MemoryTest(language, testMethod string) (realTestMethod, res string) {
var res string
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
if testMethod != "winsat" && testMethod != "" { if testMethod != "winsat" && testMethod != "" {
res = "Detected host is Windows, using Winsat for testing.\n" realTestMethod = "winsat"
} }
res += memory.WinsatTest(language) res += memory.WinsatTest(language)
} else { } else {
@@ -19,17 +18,21 @@ func MemoryTest(language, testMethod string) {
case "sysbench": case "sysbench":
res = memory.SysBenchTest(language) res = memory.SysBenchTest(language)
if res == "" { if res == "" {
res = "sysbench test failed, switch to use dd test.\n"
res += memory.DDTest(language) res += memory.DDTest(language)
realTestMethod = "dd"
} else {
realTestMethod = "sysbench"
} }
case "dd": case "dd":
res = memory.DDTest(language) res = memory.DDTest(language)
realTestMethod = "dd"
default: default:
res = "Unsupported test method" res += memory.DDTest(language)
realTestMethod = "dd"
} }
} }
if !strings.Contains(res, "\n") && res != "" { if !strings.Contains(res, "\n") && res != "" {
res += "\n" res += "\n"
} }
fmt.Printf("%s", res) return
} }

View File

@@ -1,9 +1,11 @@
package memorytest package memorytest
import ( import (
"fmt"
"testing" "testing"
) )
func Test(t *testing.T) { func Test(t *testing.T) {
MemoryTest("zh", "sysbench") _, res := MemoryTest("zh", "sysbench")
fmt.Print(res)
} }

44
nexttrace/nexttrace.go Normal file
View File

@@ -0,0 +1,44 @@
package nexttrace
import (
"fmt"
"strings"
"github.com/oneclickvirt/nt3/nt"
)
func NextTrace3Check(language, nt3Location, nt3CheckType string) {
resultChan := make(chan nt.TraceResult, 100)
go nt.TraceRoute(language, nt3Location, nt3CheckType, resultChan)
for result := range resultChan {
if result.Index == -1 {
for index, res := range result.Output {
res = strings.TrimSpace(res)
if res != "" && index == 0 {
fmt.Println(res)
}
}
continue
}
if result.ISPName == "Error" {
for _, res := range result.Output {
res = strings.TrimSpace(res)
if res != "" {
fmt.Println(res)
}
}
return
}
for _, res := range result.Output {
res = strings.TrimSpace(res)
if res == "" {
continue
}
if strings.Contains(res, "ICMP") {
fmt.Print(res)
} else {
fmt.Println(res)
}
}
}
}

View File

@@ -0,0 +1,13 @@
package nexttrace
import (
"testing"
"time"
)
func TestNextTrace3Check(t *testing.T) {
start := time.Now()
NextTrace3Check("zh", "ALL", "ipv4")
duration := time.Since(start)
t.Logf("执行耗时: %s", duration)
}

66
upstreams/upstreams.go Normal file
View File

@@ -0,0 +1,66 @@
package upstreams
import (
"fmt"
"sync"
"time"
"github.com/oneclickvirt/UnlockTests/uts"
bgptools "github.com/oneclickvirt/backtrace/bgptools"
backtrace "github.com/oneclickvirt/backtrace/bk"
. "github.com/oneclickvirt/defaultset"
)
type IpInfo struct {
Ip string `json:"ip"`
City string `json:"city"`
Region string `json:"region"`
Country string `json:"country"`
Org string `json:"org"`
}
type ConcurrentResults struct {
bgpResult string
backtraceResult string
bgpError error
// backtraceError error
}
var IPV4, IPV6 string
func UpstreamsCheck() {
results := ConcurrentResults{}
var wg sync.WaitGroup
if IPV4 != "" {
wg.Add(1)
go func() {
defer wg.Done()
for i := 0; i < 2; i++ {
result, err := bgptools.GetPoPInfo(IPV4)
results.bgpError = err
if err == nil && result.Result != "" {
results.bgpResult = result.Result
return
}
if i == 0 {
time.Sleep(3 * time.Second)
}
}
}()
}
wg.Add(1)
go func() {
defer wg.Done()
result := backtrace.BackTrace(uts.IPV6)
results.backtraceResult = result
}()
wg.Wait()
if results.bgpResult != "" {
fmt.Print(results.bgpResult)
}
if results.backtraceResult != "" {
fmt.Printf("%s\n", results.backtraceResult)
}
fmt.Println(Yellow("准确线路自行查看详细路由,本测试结果仅作参考"))
fmt.Println(Yellow("同一目标地址多个线路时,检测可能已越过汇聚层,除第一个线路外,后续信息可能无效"))
}

View File

@@ -0,0 +1,8 @@
package upstreams
import "testing"
func TestUpstreamsCheck(t *testing.T) {
IPV4 = "148.100.85.25"
UpstreamsCheck()
}

View File

@@ -11,6 +11,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
@@ -18,11 +19,28 @@ import (
"github.com/imroc/req/v3" "github.com/imroc/req/v3"
"github.com/oneclickvirt/UnlockTests/uts" "github.com/oneclickvirt/UnlockTests/uts"
bnetwork "github.com/oneclickvirt/basics/network"
"github.com/oneclickvirt/basics/system" "github.com/oneclickvirt/basics/system"
butils "github.com/oneclickvirt/basics/utils"
. "github.com/oneclickvirt/defaultset" . "github.com/oneclickvirt/defaultset"
"github.com/oneclickvirt/security/network" "github.com/oneclickvirt/security/network"
) )
// 获取本程序本日及总执行的统计信息
type StatsResponse struct {
Counter string `json:"counter"`
Action string `json:"action"`
Total int `json:"total"`
Daily int `json:"daily"`
Date string `json:"date"`
Timestamp string `json:"timestamp"`
}
// 获取最新的Github的仓库中的版本
type GitHubRelease struct {
TagName string `json:"tag_name"`
}
// PrintCenteredTitle 根据指定的宽度打印居中标题 // PrintCenteredTitle 根据指定的宽度打印居中标题
func PrintCenteredTitle(title string, width int) { func PrintCenteredTitle(title string, width int) {
// 计算字符串的字符数 // 计算字符串的字符数
@@ -98,18 +116,38 @@ func CheckChina(enableLogger bool) bool {
return selectChina return selectChina
} }
// OnlyBasicsIpInfo 仅检查和输出IP信息
func OnlyBasicsIpInfo(language string) (string, string, string) {
ipv4, ipv6, ipInfo, _, err := bnetwork.NetworkCheck("both", false, language)
if err != nil {
return "", "", ""
}
basicInfo := ipInfo
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") && ipv4 != "" && ipv6 != "" {
uts.IPV4 = true
uts.IPV6 = true
} else if strings.Contains(ipInfo, "IPV4") && ipv4 != "" {
uts.IPV4 = true
uts.IPV6 = false
} else if strings.Contains(ipInfo, "IPV6") && ipv6 != "" {
uts.IPV6 = true
uts.IPV4 = false
}
basicInfo = strings.ReplaceAll(basicInfo, "\n\n", "\n")
return ipv4, ipv6, basicInfo
}
// BasicsAndSecurityCheck 执行安全检查 // BasicsAndSecurityCheck 执行安全检查
func BasicsAndSecurityCheck(language, nt3CheckType string, securityCheckStatus bool) (string, string, string) { func BasicsAndSecurityCheck(language, nt3CheckType string, securityCheckStatus bool) (string, string, string, string, string) {
var wgt sync.WaitGroup var wgt sync.WaitGroup
var ipInfo, securityInfo, systemInfo string var ipv4, ipv6, ipInfo, securityInfo, systemInfo string
var err error
wgt.Add(1) wgt.Add(1)
go func() { go func() {
defer wgt.Done() defer wgt.Done()
ipInfo, securityInfo, err = network.NetworkCheck("both", securityCheckStatus, language) ipv4, ipv6, ipInfo, securityInfo, _ = network.NetworkCheck("both", securityCheckStatus, language)
if err != nil { // if err != nil {
fmt.Println(err.Error()) // fmt.Println(err.Error())
} // }
}() }()
wgt.Add(1) wgt.Add(1)
go func() { go func() {
@@ -118,19 +156,19 @@ func BasicsAndSecurityCheck(language, nt3CheckType string, securityCheckStatus b
}() }()
wgt.Wait() wgt.Wait()
basicInfo := systemInfo + ipInfo basicInfo := systemInfo + ipInfo
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") { if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") && ipv4 != "" && ipv6 != "" {
uts.IPV4 = true uts.IPV4 = true
uts.IPV6 = true uts.IPV6 = true
if nt3CheckType == "" { if nt3CheckType == "" {
nt3CheckType = "ipv4" nt3CheckType = "ipv4"
} }
} else if strings.Contains(ipInfo, "IPV4") { } else if strings.Contains(ipInfo, "IPV4") && ipv4 != "" {
uts.IPV4 = true uts.IPV4 = true
uts.IPV6 = false uts.IPV6 = false
if nt3CheckType == "" { if nt3CheckType == "" {
nt3CheckType = "ipv4" nt3CheckType = "ipv4"
} }
} else if strings.Contains(ipInfo, "IPV6") { } else if strings.Contains(ipInfo, "IPV6") && ipv6 != "" {
uts.IPV6 = true uts.IPV6 = true
uts.IPV4 = false uts.IPV4 = false
if nt3CheckType == "" { if nt3CheckType == "" {
@@ -143,7 +181,7 @@ func BasicsAndSecurityCheck(language, nt3CheckType string, securityCheckStatus b
nt3CheckType = "ipv4" nt3CheckType = "ipv4"
} }
basicInfo = strings.ReplaceAll(basicInfo, "\n\n", "\n") basicInfo = strings.ReplaceAll(basicInfo, "\n\n", "\n")
return basicInfo, securityInfo, nt3CheckType return ipv4, ipv6, basicInfo, securityInfo, nt3CheckType
} }
// CaptureOutput 捕获函数输出和错误输出,实时输出,并返回字符串 // CaptureOutput 捕获函数输出和错误输出,实时输出,并返回字符串
@@ -335,8 +373,6 @@ func ProcessAndUpload(output string, filePath string, enableUplaod bool) (string
return "", "" return "", ""
} }
// ============================= 前置联网能力检测 =============================
var StackType string var StackType string
type NetCheckResult struct { type NetCheckResult struct {
@@ -358,6 +394,7 @@ func makeResolver(proto, dnsAddr string) *net.Resolver {
} }
} }
// 前置联网能力检测
func CheckPublicAccess(timeout time.Duration) NetCheckResult { func CheckPublicAccess(timeout time.Duration) NetCheckResult {
if timeout < 2*time.Second { if timeout < 2*time.Second {
timeout = 2 * time.Second timeout = 2 * time.Second
@@ -483,6 +520,7 @@ result:
stack = "IPv6" stack = "IPv6"
} }
StackType = stack StackType = stack
butils.CheckPublicAccess(3 * time.Second) // 设置basics检测避免部分测试未启用
return NetCheckResult{ return NetCheckResult{
HasIPv4: hasV4, HasIPv4: hasV4,
HasIPv6: hasV6, HasIPv6: hasV6,
@@ -490,3 +528,77 @@ result:
StackType: stack, StackType: stack,
} }
} }
// 获取每日/总的程序执行统计信息
func GetGoescStats() (*StatsResponse, error) {
client := req.C().SetTimeout(5 * time.Second)
var stats StatsResponse
resp, err := client.R().
SetSuccessResult(&stats).
Get("https://hits.spiritlhl.net/goecs")
if err != nil {
return nil, err
}
if !resp.IsSuccessState() {
return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}
return &stats, nil
}
// 统计结果单位转换
func FormatGoecsNumber(num int) string {
if num >= 1000000 {
return fmt.Sprintf("%.1fM", float64(num)/1000000)
} else if num >= 1000 {
return fmt.Sprintf("%.1fK", float64(num)/1000)
}
return fmt.Sprintf("%d", num)
}
// 通过Github的API检索仓库最新TAG的版本
func GetLatestEcsRelease() (*GitHubRelease, error) {
urls := []string{
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest",
"https://fd.spiritlhl.top/https://api.github.com/repos/oneclickvirt/ecs/releases/latest",
"https://githubapi.spiritlhl.top/repos/oneclickvirt/ecs/releases/latest",
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest",
}
client := req.C().SetTimeout(3 * time.Second)
for _, url := range urls {
var release GitHubRelease
resp, err := client.R().
SetSuccessResult(&release).
Get(url)
if err != nil {
continue
}
if resp.IsSuccessState() && release.TagName != "" {
return &release, nil
}
}
return nil, fmt.Errorf("failed to fetch release from all sources")
}
// 比较程序版本是否需要升级
func CompareVersions(v1, v2 string) int {
normalize := func(s string) []int {
s = strings.TrimPrefix(strings.ToLower(s), "v")
parts := strings.Split(s, ".")
result := make([]int, 3)
for i := 0; i < 3 && i < len(parts); i++ {
n, _ := strconv.Atoi(parts[i])
result[i] = n
}
return result
}
a := normalize(v1)
b := normalize(v2)
for i := 0; i < 3; i++ {
if a[i] < b[i] {
return -1
} else if a[i] > b[i] {
return 1
}
}
return 0
}

View File

@@ -6,7 +6,17 @@ import (
"time" "time"
) )
func TestCheckPublicAccess(t *testing.T) { // func TestCheckPublicAccess(t *testing.T) {
// timeout := 3 * time.Second
// result := CheckPublicAccess(timeout)
// if result.Connected {
// fmt.Print("✅ 本机有公网连接,类型: %s\n", result.StackType)
// } else {
// fmt.Println("❌ 本机未检测到公网连接")
// }
// }
func TestBasicsAndSecurityCheck(t *testing.T) {
timeout := 3 * time.Second timeout := 3 * time.Second
result := CheckPublicAccess(timeout) result := CheckPublicAccess(timeout)
if result.Connected { if result.Connected {
@@ -14,4 +24,8 @@ func TestCheckPublicAccess(t *testing.T) {
} else { } else {
fmt.Println("❌ 本机未检测到公网连接") fmt.Println("❌ 本机未检测到公网连接")
} }
_, _, basicInfo, securityInfo, nt3CheckType := BasicsAndSecurityCheck("zh", "ipv4", false)
fmt.Println(basicInfo)
fmt.Println(securityInfo)
fmt.Println(nt3CheckType)
} }