mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-27 11:42:23 +08:00
Compare commits
362 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f6ee1e40ec | ||
![]() |
cb2bf0a7e5 | ||
![]() |
ad017db5a6 | ||
![]() |
a99f58518a | ||
![]() |
2e59bac322 | ||
![]() |
4132b1daff | ||
![]() |
53296b745a | ||
![]() |
74630e9615 | ||
![]() |
5ec7924214 | ||
![]() |
7a7fdc26a0 | ||
![]() |
d4c855de92 | ||
![]() |
7c22dee443 | ||
![]() |
797496b640 | ||
![]() |
5b686abdc8 | ||
![]() |
f99a37edbe | ||
![]() |
4ff49c8b90 | ||
![]() |
1d9257beb3 | ||
![]() |
fc6ccb9f92 | ||
![]() |
88a2a7fdc9 | ||
![]() |
5ff18ed7c7 | ||
![]() |
df897db244 | ||
![]() |
9a8680491c | ||
![]() |
33f81fd6aa | ||
![]() |
940703c3f9 | ||
![]() |
1c2e9cdab9 | ||
![]() |
3e6524fa0e | ||
![]() |
026f40dc4c | ||
![]() |
110c58d401 | ||
![]() |
06e76a9c33 | ||
![]() |
6b88a81c02 | ||
![]() |
5482506bab | ||
![]() |
b7130db8ce | ||
![]() |
dc5e3b7852 | ||
![]() |
6937e69a0a | ||
![]() |
a68d33739c | ||
![]() |
94e0441801 | ||
![]() |
39be183fda | ||
![]() |
dbc1506518 | ||
![]() |
149f5673d2 | ||
![]() |
c1b7302485 | ||
![]() |
bf44ea9324 | ||
![]() |
191ddfd668 | ||
![]() |
89a99a7428 | ||
![]() |
c474c71091 | ||
![]() |
43b2c8aca3 | ||
![]() |
96117a040e | ||
![]() |
c5aeda45bd | ||
![]() |
0b2ac51f09 | ||
![]() |
ffe1b65a2b | ||
![]() |
a4bfd4d143 | ||
![]() |
edbcf1c245 | ||
![]() |
4c65417ea6 | ||
![]() |
2cf7484881 | ||
![]() |
d5da2a59b6 | ||
![]() |
372deb59eb | ||
![]() |
8e4c6dfd3e | ||
![]() |
8fc828d416 | ||
![]() |
8a3fbd79e6 | ||
![]() |
5628f1bb9c | ||
![]() |
cadbb2a45c | ||
![]() |
56d7560471 | ||
![]() |
75e7eb1b25 | ||
![]() |
24ba56cfa6 | ||
![]() |
ebefd64a3d | ||
![]() |
4d83ffea02 | ||
![]() |
01a4084462 | ||
![]() |
6674093425 | ||
![]() |
6d2e56b1ec | ||
![]() |
2a736d3e70 | ||
![]() |
d02383b8cb | ||
![]() |
0caba0ea60 | ||
![]() |
6f92b8a994 | ||
![]() |
cc34baf9e1 | ||
![]() |
84d8963684 | ||
![]() |
a94e9a6284 | ||
![]() |
06007c191f | ||
![]() |
d013b8f90c | ||
![]() |
42002fdae1 | ||
![]() |
d7628a5a57 | ||
![]() |
e5f3ca1ec3 | ||
![]() |
e70a295a5f | ||
![]() |
58821f2603 | ||
![]() |
33a656304b | ||
![]() |
33d9a3ccb0 | ||
![]() |
1d5758999c | ||
![]() |
94ce394e04 | ||
![]() |
ede04bd2c2 | ||
![]() |
50f6ef1f60 | ||
![]() |
e5129ab244 | ||
![]() |
15b6ba4eb8 | ||
![]() |
6c77f74003 | ||
![]() |
61a1508b53 | ||
![]() |
022284018d | ||
![]() |
1d682213fe | ||
![]() |
649a09b50a | ||
![]() |
0fa2ff9300 | ||
![]() |
b174e5cfa8 | ||
![]() |
afd667db59 | ||
![]() |
d846dcbf4f | ||
![]() |
f47b1e3023 | ||
![]() |
63658bb2dc | ||
![]() |
b1a8368af3 | ||
![]() |
df6d1236cc | ||
![]() |
7c64102581 | ||
![]() |
58cb4f3831 | ||
![]() |
20bddae048 | ||
![]() |
3c0590ca8d | ||
![]() |
a752eeeeb0 | ||
![]() |
630a28f2f2 | ||
![]() |
cfd70e100b | ||
![]() |
9114f5b97a | ||
![]() |
8c0fc16384 | ||
![]() |
2ded570639 | ||
![]() |
42f0cb3399 | ||
![]() |
14adbddeb9 | ||
![]() |
27fd06b007 | ||
![]() |
88db8df827 | ||
![]() |
ec728796f4 | ||
![]() |
147e8c1113 | ||
![]() |
b9b1d5ca76 | ||
![]() |
1500c8342e | ||
![]() |
e523ca3c84 | ||
![]() |
42943370bb | ||
![]() |
7339f0336c | ||
![]() |
54bbe16563 | ||
![]() |
2a66452f40 | ||
![]() |
aab6bf197d | ||
![]() |
9206088bad | ||
![]() |
48e150036d | ||
![]() |
486b767a25 | ||
![]() |
5a2e68bf92 | ||
![]() |
97d05f4b57 | ||
![]() |
4f08a33de8 | ||
![]() |
ff8712a743 | ||
![]() |
abd38554b6 | ||
![]() |
918a9b3a46 | ||
![]() |
d9dac50487 | ||
![]() |
cd65f04433 | ||
![]() |
8b5193eca1 | ||
![]() |
4797ff0b34 | ||
![]() |
9886cad73e | ||
![]() |
ca0470f01a | ||
![]() |
5a6d6845c1 | ||
![]() |
487dd7c1d2 | ||
![]() |
2dbf97de8c | ||
![]() |
97e7cae2c2 | ||
![]() |
d61a1879f5 | ||
![]() |
29dd4ac57e | ||
![]() |
dc3eff1fe3 | ||
![]() |
0a0f2199bc | ||
![]() |
91004d87f5 | ||
![]() |
8f41c37203 | ||
![]() |
12b1ae0702 | ||
![]() |
653cd75a97 | ||
![]() |
ea36e88c9f | ||
![]() |
c81ebb3c7a | ||
![]() |
7896b3ead5 | ||
![]() |
eb98a7b857 | ||
![]() |
d4d86229de | ||
![]() |
651a183382 | ||
![]() |
afc313a2a8 | ||
![]() |
39ac8d198d | ||
![]() |
a70dc2bab1 | ||
![]() |
5041a16a9a | ||
![]() |
21deb3587e | ||
![]() |
3bac30edc2 | ||
![]() |
9ef2ec4a9e | ||
![]() |
ac33e00e0a | ||
![]() |
7a439f7095 | ||
![]() |
e3bfa65f66 | ||
![]() |
74e33a212c | ||
![]() |
bba8595033 | ||
![]() |
530181be87 | ||
![]() |
7deb986209 | ||
![]() |
ea8e5efbd3 | ||
![]() |
db88ee8479 | ||
![]() |
67a3bfdaad | ||
![]() |
e57ce05c0c | ||
![]() |
62137f0bb1 | ||
![]() |
f9d8c9ee4c | ||
![]() |
913a1725c1 | ||
![]() |
f1acbd361b | ||
![]() |
d6f62f8624 | ||
![]() |
94da890522 | ||
![]() |
42b94260de | ||
![]() |
16e2603176 | ||
![]() |
0ed9840038 | ||
![]() |
31b53e13b0 | ||
![]() |
fb697fa25f | ||
![]() |
2510b3ead0 | ||
![]() |
b64b8a2d96 | ||
![]() |
663614117d | ||
![]() |
a96c9b6c7d | ||
![]() |
e8f73ba4b8 | ||
![]() |
dd6fbff943 | ||
![]() |
e473851a02 | ||
![]() |
86fc407ccb | ||
![]() |
8e6037c340 | ||
![]() |
be59af4411 | ||
![]() |
7ae753a4e2 | ||
![]() |
3956420ffe | ||
![]() |
6ebe25af2d | ||
![]() |
fe02bd295a | ||
![]() |
172b520702 | ||
![]() |
d460e2b167 | ||
![]() |
03f5fd9e48 | ||
![]() |
0b0972cc3e | ||
![]() |
8273895def | ||
![]() |
3e31671502 | ||
![]() |
42b3ab3cff | ||
![]() |
0bef8161e7 | ||
![]() |
4f7e37f37c | ||
![]() |
c0dcea53e3 | ||
![]() |
02034da2d7 | ||
![]() |
aa6c835aed | ||
![]() |
2ebfdf7533 | ||
![]() |
28e21f0838 | ||
![]() |
23aae0b32b | ||
![]() |
abaf021e1c | ||
![]() |
be4e46ceba | ||
![]() |
4746ae14cf | ||
![]() |
eb702c4d97 | ||
![]() |
86bde156a4 | ||
![]() |
08be6238d2 | ||
![]() |
c0472209b4 | ||
![]() |
e751b76099 | ||
![]() |
bf653ab620 | ||
![]() |
c4b7ba00a1 | ||
![]() |
87a288907a | ||
![]() |
c3aa62753b | ||
![]() |
83b8efd7ee | ||
![]() |
2fa0270e4e | ||
![]() |
3bd1136683 | ||
![]() |
d5837ed535 | ||
![]() |
080c62cd93 | ||
![]() |
ce690aab2d | ||
![]() |
05ec4d75b8 | ||
![]() |
553e0ddef6 | ||
![]() |
819d155fd5 | ||
![]() |
d7519801b0 | ||
![]() |
d6302be4ae | ||
![]() |
a8366005dc | ||
![]() |
4e3249b590 | ||
![]() |
8a52f6df76 | ||
![]() |
ebe85216bb | ||
![]() |
7909d4ba78 | ||
![]() |
4939d155d8 | ||
![]() |
d69f85d0db | ||
![]() |
f4dea6ce6e | ||
![]() |
bc596e8e48 | ||
![]() |
116ae33505 | ||
![]() |
a32846638b | ||
![]() |
d84fb21f82 | ||
![]() |
f199336cf0 | ||
![]() |
a1196ab8d2 | ||
![]() |
9431fe3944 | ||
![]() |
5dcef9f4c3 | ||
![]() |
865ca62f06 | ||
![]() |
eea78a7c30 | ||
![]() |
2f5feace7b | ||
![]() |
615ffca90f | ||
![]() |
685fe735f6 | ||
![]() |
5545990854 | ||
![]() |
91d1aa4461 | ||
![]() |
94f9576383 | ||
![]() |
ef91a61d22 | ||
![]() |
bafd77e2f5 | ||
![]() |
eb03d50cd2 | ||
![]() |
dbd921d8ca | ||
![]() |
8b9df2c385 | ||
![]() |
ce57c141a0 | ||
![]() |
da3dc7e11e | ||
![]() |
d4cbd0772a | ||
![]() |
2ff558ae7b | ||
![]() |
f5d9752e89 | ||
![]() |
1f563c823a | ||
![]() |
807141751a | ||
![]() |
e55a18b3de | ||
![]() |
920054c844 | ||
![]() |
3c5405dd07 | ||
![]() |
a33702f164 | ||
![]() |
daf07945dc | ||
![]() |
88b39c0ae3 | ||
![]() |
65ddb32d74 | ||
![]() |
acf2f0e98c | ||
![]() |
e63dc4d3f4 | ||
![]() |
7fb4e358e8 | ||
![]() |
15ba7fb00f | ||
![]() |
916f21a72f | ||
![]() |
f00d5db69c | ||
![]() |
6dbb171d3b | ||
![]() |
0921aef041 | ||
![]() |
dd4a4e317b | ||
![]() |
d80f3451ff | ||
![]() |
ebce9e493d | ||
![]() |
176899d3e9 | ||
![]() |
e58da9e921 | ||
![]() |
651bbb94d0 | ||
![]() |
91ffbfa417 | ||
![]() |
84b0303468 | ||
![]() |
f3e10a999b | ||
![]() |
76a6e09d97 | ||
![]() |
9c9dbc6200 | ||
![]() |
20c8063e5e | ||
![]() |
fbe5eb8e58 | ||
![]() |
290f0d8d8c | ||
![]() |
140347c2a6 | ||
![]() |
aeda7a6e88 | ||
![]() |
a205ca38be | ||
![]() |
43bf9c81ed | ||
![]() |
d47f8987a7 | ||
![]() |
ffbe5a539a | ||
![]() |
4b8ae06df8 | ||
![]() |
859e783241 | ||
![]() |
3cd912219e | ||
![]() |
a85a06b440 | ||
![]() |
681da08f01 | ||
![]() |
bdd00d46f8 | ||
![]() |
1f213bb788 | ||
![]() |
1dec7c323b | ||
![]() |
391cc351c4 | ||
![]() |
282a947156 | ||
![]() |
73916d324a | ||
![]() |
6cce2a7e8e | ||
![]() |
2a653930a8 | ||
![]() |
2295035706 | ||
![]() |
3e8c7112a0 | ||
![]() |
a8175219d5 | ||
![]() |
a827583b76 | ||
![]() |
82a1d19c6c | ||
![]() |
4ef0ac8d5a | ||
![]() |
3bb70191e7 | ||
![]() |
1bca0052c5 | ||
![]() |
7c06d278e0 | ||
![]() |
5cec395f3c | ||
![]() |
4994994d4f | ||
![]() |
91ad962b13 | ||
![]() |
8356d95566 | ||
![]() |
1428087818 | ||
![]() |
7b1e78fb7e | ||
![]() |
0a62c62dd8 | ||
![]() |
34b4f66289 | ||
![]() |
eca268048f | ||
![]() |
c3ffe741ad | ||
![]() |
9de837ef71 | ||
![]() |
2c3da79871 | ||
![]() |
e7ad87ecbd | ||
![]() |
a89a79c11c | ||
![]() |
ee38b65a5a | ||
![]() |
0a756f04ca | ||
![]() |
f040ffb1d4 | ||
![]() |
efb870a9de | ||
![]() |
9151cd3b70 | ||
![]() |
ef8e2789e2 | ||
![]() |
2dad691bd6 | ||
![]() |
a9c5ed359a | ||
![]() |
e3c88308c9 | ||
![]() |
617c6c2f98 | ||
![]() |
d42d6999a2 | ||
![]() |
4c0f54181c | ||
![]() |
f2828970f5 | ||
![]() |
7d84d55823 |
84
.back/.goreleaser.old
Normal file
84
.back/.goreleaser.old
Normal 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
522
.back/.goreleaser.yaml
Normal 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
|
@@ -4,6 +4,6 @@ import (
|
|||||||
"github.com/oneclickvirt/backtrace/bk"
|
"github.com/oneclickvirt/backtrace/bk"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BackTrace() {
|
func BackTrace(enableIpv6 bool) {
|
||||||
backtrace.BackTrace()
|
backtrace.BackTrace(enableIpv6)
|
||||||
}
|
}
|
@@ -15,6 +15,7 @@ import (
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
// 本包仅测试,无实际使用
|
||||||
func TestBackTrace(t *testing.T) {
|
func TestBackTrace(t *testing.T) {
|
||||||
BackTrace()
|
BackTrace(false)
|
||||||
}
|
}
|
@@ -7,10 +7,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 本包不在main中使用,仅做测试使用
|
// 本包不在main中使用,仅做测试使用,真正调用的在 utils 中的 BasicsAndSecurityCheck
|
||||||
func Basic(language string) {
|
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
132
.back/build.yaml
Normal 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 }}
|
@@ -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)
|
||||||
}
|
}
|
@@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 本包仅测试无实际使用
|
||||||
func TestMedia(t *testing.T) {
|
func TestMedia(t *testing.T) {
|
||||||
ComMediaTest("zh")
|
ComMediaTest("zh")
|
||||||
}
|
}
|
@@ -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("--------------------------------------------------")
|
||||||
}
|
}
|
@@ -3,6 +3,7 @@ package ntrace
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
// https://github.com/nxtrace/NTrace-core/blob/main/fast_trace/fast_trace.go
|
// https://github.com/nxtrace/NTrace-core/blob/main/fast_trace/fast_trace.go
|
||||||
|
// 本包仅测试无实际使用
|
||||||
func TestTraceRoute(t *testing.T) {
|
func TestTraceRoute(t *testing.T) {
|
||||||
TraceRoute3("en", "GZ", "ipv4")
|
TraceRoute3("en", "GZ", "ipv4")
|
||||||
}
|
}
|
74
.github/workflows/build_binary.yaml
vendored
Normal file
74
.github/workflows/build_binary.yaml
vendored
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
name: Build and Release
|
||||||
|
|
||||||
|
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:
|
||||||
|
- run: |
|
||||||
|
git config --global --add safe.directory /__w/ecs/ecs
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
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: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v6
|
||||||
|
with:
|
||||||
|
distribution: goreleaser
|
||||||
|
# version: latest
|
||||||
|
version: '~> v2'
|
||||||
|
args: release
|
||||||
|
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 }}
|
467
.github/workflows/build_binary_cgo.old
vendored
Normal file
467
.github/workflows/build_binary_cgo.old
vendored
Normal 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
527
.github/workflows/build_binary_musl.old
vendored
Normal 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 }}
|
56
.github/workflows/build_docker.yaml
vendored
Normal file
56
.github/workflows/build_docker.yaml
vendored
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build and Release"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
# - 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
|
||||||
|
with:
|
||||||
|
registry: crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com
|
||||||
|
username: ${{ secrets.ALIYUN_USERNAME }}
|
||||||
|
password: ${{ secrets.ALIYUN_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/riscv64
|
||||||
|
# linux/mips,linux/mipsle 暂不支持 alpine, linux/s390x 编译卡死,cnb组织空间不足无法推送
|
||||||
|
# ${{ secrets.CNB_DOCKER_REGISTRY }}/oneclickvirt/ecs:latest
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKER_USERNAME }}/goecs:latest
|
||||||
|
crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest
|
66
.github/workflows/ci.yaml_back
vendored
66
.github/workflows/ci.yaml_back
vendored
@@ -1,66 +0,0 @@
|
|||||||
name: go-ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: set up
|
|
||||||
uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: 1.22.4
|
|
||||||
id: go
|
|
||||||
- name: check out
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Cache
|
|
||||||
uses: actions/cache@v2.1.0
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- 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 }}
|
|
||||||
env:
|
|
||||||
GOPRIVATE: github.com/oneclickvirt/security
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- 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: build
|
|
||||||
run: go build ./...
|
|
||||||
env:
|
|
||||||
GOPRIVATE: github.com/oneclickvirt/security
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
||||||
|
|
||||||
# test:
|
|
||||||
# needs: setup
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v3
|
|
||||||
# - 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: test
|
|
||||||
# run: go test ./goecs_test.go
|
|
||||||
# env:
|
|
||||||
# GOPRIVATE: github.com/oneclickvirt/security
|
|
||||||
# GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
42
.github/workflows/main.yaml
vendored
42
.github/workflows/main.yaml
vendored
@@ -1,42 +0,0 @@
|
|||||||
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:
|
|
||||||
- run: |
|
|
||||||
git config --global --add safe.directory /__w/ecs/ecs
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
|
||||||
go-version: 1.22.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: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v2
|
|
||||||
with:
|
|
||||||
distribution: goreleaser
|
|
||||||
version: latest
|
|
||||||
args: release
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GHT }}
|
|
||||||
GOPRIVATE: github.com/oneclickvirt/security
|
|
55
.github/workflows/public_build.yml
vendored
Normal file
55
.github/workflows/public_build.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Public Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build and Release"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.24.5'
|
||||||
|
|
||||||
|
- name: Create public branch
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'GitHub Actions'
|
||||||
|
git config --global user.email 'actions@github.com'
|
||||||
|
git checkout -b public || git checkout public
|
||||||
|
git merge ${{ github.ref_name }} --no-edit || true
|
||||||
|
|
||||||
|
- name: Remove security package references
|
||||||
|
run: |
|
||||||
|
find . -type f -name "*.go" -exec sed -i 's|"github.com/oneclickvirt/security/network"|"github.com/oneclickvirt/basics/network"|g' {} +
|
||||||
|
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 '/^import/,/^)/{/^)/a\'$'\n''const token = "OvwKx5qgJtf7PZgCKbtyojSU.MTcwMTUxNzY1MTgwMw"'$'\n''}' utils/utils.go
|
||||||
|
sed -i '/github.com\/oneclickvirt\/security/d' go.mod
|
||||||
|
sed -i 's|var securityFlag = flag.Bool("security", true,|var securityFlag = flag.Bool("security", false,|g' goecs.go
|
||||||
|
go mod tidy
|
||||||
|
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|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
|
||||||
|
|
||||||
|
- name: Build and Test
|
||||||
|
run: |
|
||||||
|
go build -o maintest
|
||||||
|
./maintest -menu=false -l en -security=false -upload=false || exit 1
|
||||||
|
rm -rf maintest
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git add .
|
||||||
|
git commit -m "Auto update public version (no security package)" || echo "No changes to commit"
|
||||||
|
git push -f origin public
|
58
.github/workflows/sync.yaml
vendored
Normal file
58
.github/workflows/sync.yaml
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
name: Sync Latest Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Build and Release"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout source repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get latest release
|
||||||
|
id: get_release
|
||||||
|
run: |
|
||||||
|
echo "RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create temporary directory
|
||||||
|
run: |
|
||||||
|
mkdir -p temp_repo
|
||||||
|
cd temp_repo
|
||||||
|
git init
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
|
||||||
|
- name: Copy repository files
|
||||||
|
run: |
|
||||||
|
cp goecs.sh temp_repo/
|
||||||
|
cp README_EN.md temp_repo/
|
||||||
|
cp README.md temp_repo/
|
||||||
|
cp LICENSE temp_repo/
|
||||||
|
|
||||||
|
- name: Download release assets
|
||||||
|
run: |
|
||||||
|
cd temp_repo
|
||||||
|
gh release download ${{ env.RELEASE_TAG }} --repo ${{ github.repository }} --dir .
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push to target repository
|
||||||
|
run: |
|
||||||
|
cd temp_repo
|
||||||
|
git add .
|
||||||
|
git commit -m "Sync release ${{ env.RELEASE_TAG }} from ${{ github.repository }}"
|
||||||
|
git branch -M main
|
||||||
|
git remote add target https://cnb.cool/oneclickvirt/ecs.git
|
||||||
|
echo "machine cnb.cool login ${{ secrets.CNB_USERNAME }} password ${{ secrets.CNB_TOKEN }}" > ~/.netrc
|
||||||
|
chmod 600 ~/.netrc
|
||||||
|
git push -f target main
|
||||||
|
env:
|
||||||
|
CNB_USERNAME: ${{ secrets.CNB_USERNAME }}
|
||||||
|
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
vendor/
|
vendor/
|
||||||
|
.idea/
|
@@ -6,7 +6,7 @@ builds:
|
|||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- windows
|
- windows
|
||||||
@@ -18,6 +18,10 @@ builds:
|
|||||||
- amd64
|
- amd64
|
||||||
- mips
|
- mips
|
||||||
- mipsle
|
- mipsle
|
||||||
|
- mips64
|
||||||
|
- mips64le
|
||||||
|
- ppc64
|
||||||
|
- ppc64le
|
||||||
- s390x
|
- s390x
|
||||||
- riscv64
|
- riscv64
|
||||||
gomips:
|
gomips:
|
||||||
@@ -33,7 +37,7 @@ builds:
|
|||||||
- CC=o64-clang
|
- CC=o64-clang
|
||||||
- CXX=o64-clang++
|
- CXX=o64-clang++
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
goos:
|
goos:
|
||||||
- darwin
|
- darwin
|
||||||
goarch:
|
goarch:
|
||||||
@@ -46,7 +50,7 @@ builds:
|
|||||||
- CC=oa64-clang
|
- CC=oa64-clang
|
||||||
- CXX=oa64-clang++
|
- CXX=oa64-clang++
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
|
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
|
||||||
goos:
|
goos:
|
||||||
- darwin
|
- darwin
|
||||||
goarch:
|
goarch:
|
||||||
@@ -75,4 +79,4 @@ changelog:
|
|||||||
- Merge pull request
|
- Merge pull request
|
||||||
- Merge branch
|
- Merge branch
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
- New translations
|
- New translations
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
9
.idea/ecs.iml
generated
9
.idea/ecs.iml
generated
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="Go" enabled="true" />
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/ecs.iml" filepath="$PROJECT_DIR$/.idea/ecs.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
8
.idea/sshConfigs.xml
generated
8
.idea/sshConfigs.xml
generated
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="SshConfigs">
|
|
||||||
<configs>
|
|
||||||
<sshConfig authType="PASSWORD" host="49.234.158.14" id="950b8219-3ab3-47e7-ad76-6b6a5d0857b0" port="22" nameFormat="DESCRIPTIVE" username="root" useOpenSSHConfig="true" />
|
|
||||||
</configs>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM alpine:latest
|
||||||
|
# 安装必要的工具
|
||||||
|
RUN apk add --no-cache wget curl bash
|
||||||
|
RUN apk add --no-cache bind-tools
|
||||||
|
# --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||||
|
RUN apk add --no-cache grep openssl ca-certificates uuidgen
|
||||||
|
RUN export noninteractive=true
|
||||||
|
# 下载并执行 goecs.sh 脚本
|
||||||
|
RUN curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && \
|
||||||
|
chmod +x goecs.sh && \
|
||||||
|
bash goecs.sh env && \
|
||||||
|
bash goecs.sh install
|
||||||
|
# 设置 goecs 为入口点
|
||||||
|
ENTRYPOINT ["goecs"]
|
395
README.md
395
README.md
@@ -1,137 +1,187 @@
|
|||||||
# ecs
|
# ECS
|
||||||
|
|
||||||
[](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [](https://www.spiritlhl.net/)
|
[](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml)
|
||||||
|
|
||||||
融合怪测评脚本 - GO重构版本 - 由于未正式发版,如有问题请issues反馈
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield)
|
||||||
|
|
||||||
Shell版本: https://github.com/spiritLHLS/ecs
|
[](https://hits.spiritlhl.net)
|
||||||
|
|
||||||
## 语言
|
融合怪测评项目 - GO版本
|
||||||
|
|
||||||
|
(仅环境安装[非必须]使用shell外无额外shell文件依赖,环境安装只是为了测的更准,极端情况下无环境依赖安装也可全测项目)
|
||||||
|
|
||||||
|
如有问题请 [issues](https://github.com/oneclickvirt/ecs/issues) 反馈。
|
||||||
|
|
||||||
|
Go 版本:[https://github.com/oneclickvirt/ecs](https://github.com/oneclickvirt/ecs)
|
||||||
|
|
||||||
|
Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS/ecs)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## **语言**
|
||||||
|
|
||||||
[中文文档](README.md) | [English Docs](README_EN.md)
|
[中文文档](README.md) | [English Docs](README_EN.md)
|
||||||
|
|
||||||
## 适配系统和架构
|
---
|
||||||
|
|
||||||
编译支持的架构: amd64、arm、arm64、386、s390x、mips、mipsle、s390x、riscv64
|
## **适配系统和架构**
|
||||||
|
|
||||||
测试支持的架构: amd64、arm64
|
### **编译与测试支持情况**
|
||||||
|
| 编译支持的架构 | 测试支持的架构 | 编译支持的系统 | 测试支持的系统 |
|
||||||
|
|---------------------------|--------------|---------------------------|---------------|
|
||||||
|
| amd64 | amd64 | Linux | Linux |
|
||||||
|
| arm64 | arm64 | Windows | Windows |
|
||||||
|
| arm | | MacOS(Darwin) | MacOS |
|
||||||
|
| 386 | | FreeBSD | |
|
||||||
|
| mips,mipsle | | Android | |
|
||||||
|
| mips64,mips64le | | | |
|
||||||
|
| ppc64,ppc64le | | | |
|
||||||
|
| s390x | s390x | | |
|
||||||
|
| riscv64 | | | |
|
||||||
|
|
||||||
更多架构请自行测试
|
> 更多架构与系统请自行测试或编译,如有问题请开 issues。
|
||||||
|
|
||||||
编译支持的系统: Linux、Windows、MacOS、FreeBSD、OpenBSD
|
### **待支持的系统**
|
||||||
|
|
||||||
测试支持的系统: Linux、Windows
|
| 系统 | 说明 |
|
||||||
|
|----------------|---------------------------|
|
||||||
|
| Android(arm64) | 存在权限问题未修复,非安卓系统的ARM架构无问题 |
|
||||||
|
| OpenBSD/NetBSD | 部分Goalng的官方库未支持本系统(尤其是net相关项目) |
|
||||||
|
| Windows虚拟机 | 无Admin权限的mbw测试性能不准确(内存测试) |
|
||||||
|
| Windows物理机(非Admin下) | 无Admin权限的mbw测试性能不准确(内存测试) |
|
||||||
|
---
|
||||||
|
|
||||||
更多系统请自行测试
|
## **功能**
|
||||||
|
|
||||||
待支持的系统(存在硬件测试BUG未修复): MacOS、FreeBSD、OpenBSD
|
- 系统基础信息查询,IP基础信息并发查询:[basics](https://github.com/oneclickvirt/basics)、[gostun](https://github.com/oneclickvirt/gostun)
|
||||||
|
- CPU 测试:[cputest](https://github.com/oneclickvirt/cputest),支持 sysbench(lua/golang版本)、geekbench、winsat
|
||||||
|
- 内存测试:[memorytest](https://github.com/oneclickvirt/memorytest),支持 sysbench、dd
|
||||||
|
- 硬盘测试:[disktest](https://github.com/oneclickvirt/disktest),支持 dd、fio、winsat
|
||||||
|
- 流媒体解锁信息并发查询:[netflix-verify](https://github.com/sjlleo/netflix-verify) 等逻辑,开发至 [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)
|
||||||
|
- 常见流媒体测试并发查询:[UnlockTests](https://github.com/oneclickvirt/UnlockTests),逻辑借鉴 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) 等
|
||||||
|
- IP 质量/安全信息并发查询:二进制文件编译至 [securityCheck](https://github.com/oneclickvirt/securityCheck)
|
||||||
|
- 邮件端口测试:[portchecker](https://github.com/oneclickvirt/portchecker)
|
||||||
|
- 上游及回程路由线路检测:借鉴 [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)
|
||||||
|
- 网速测试:基于 [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)
|
||||||
|
- 支持root或admin环境下测试,支持非root或非admin环境下测试,支持离线环境下进行测试,**暂未**支持无DNS环境下进行测试
|
||||||
|
|
||||||
## 功能
|
**本项目初次使用建议查看说明:[跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md)**
|
||||||
|
|
||||||
- [x] 系统基础信息查询[自研[basics](https://github.com/oneclickvirt/basics)、[gostun](https://github.com/oneclickvirt/gostun)]
|
---
|
||||||
- [x] IP基础信息并发查询[自研[basics](https://github.com/oneclickvirt/basics)]
|
|
||||||
- [x] CPU测试[自研[cputest](https://github.com/oneclickvirt/cputest)支持sysbench、geekbench、winsat]
|
|
||||||
- [x] 内存测试[自研[memorytest](https://github.com/oneclickvirt/memorytest)支持sysbench、dd]
|
|
||||||
- [x] 硬盘测试[自研[disktest](https://github.com/oneclickvirt/disktest)支持dd、fio、winsat]
|
|
||||||
- [x] 御三家流媒体解锁信息并发查询[借鉴[netflix-verify](https://github.com/sjlleo/netflix-verify)、[VerifyDisneyPlus](https://github.com/sjlleo/VerifyDisneyPlus)、[TubeCheck](https://github.com/sjlleo/TubeCheck)二次开发至于[CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)]
|
|
||||||
- [x] 常见流媒体测试并发查询[自研代码,逻辑借鉴[RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck)、[MediaUnlockTest](https://github.com/HsukqiLee/MediaUnlockTest)并自行修复错漏至于[UnlockTests](https://github.com/oneclickvirt/UnlockTests)]
|
|
||||||
- [x] IP质量/安全信息并发查询[自研,由于测试含密钥信息,故而私有化开发,但二进制文件编译至于[securityCheck](https://github.com/oneclickvirt/securityCheck)]
|
|
||||||
- [x] 邮件端口测试[自研[portchecker](https://github.com/oneclickvirt/portchecker)]
|
|
||||||
- [x] 三网回程测试[借鉴[zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace)二次开发至于[oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace)]
|
|
||||||
- [x] 三网路由测试[借鉴[NTrace-core](https://github.com/nxtrace/NTrace-core)二次开发至于[nt3](https://github.com/oneclickvirt/nt3)]
|
|
||||||
- [x] 测试网速[基于[speedtest.net-爬虫](https://github.com/spiritLHLS/speedtest.net-CN-ID)、[speedtest.cn-爬虫](https://github.com/spiritLHLS/speedtest.cn-CN-ID)的数据,借鉴[speedtest-go](https://github.com/showwin/speedtest-go)二次开发至于[oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)]
|
|
||||||
- [x] 测试三网Ping值[借鉴[ecsspeed](https://github.com/spiritLHLS/ecsspeed)的逻辑二次开发至于[pingtest](https://github.com/oneclickvirt/pingtest)]
|
|
||||||
|
|
||||||
## Linux/FreeBSD/MacOS上使用的说明
|
## **使用说明**
|
||||||
|
|
||||||
### 一键命令
|
### **Linux/FreeBSD/MacOS**
|
||||||
|
|
||||||
```
|
#### **一键命令**
|
||||||
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
|
||||||
```
|
|
||||||
|
|
||||||
或
|
**一键命令**将**默认安装依赖**,**默认更新包管理器**,**默认非互动模式**
|
||||||
|
|
||||||
```
|
- **国际用户无加速:**
|
||||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
|
||||||
```
|
|
||||||
|
|
||||||
### 详细说明
|
```bash
|
||||||
|
export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
||||||
|
```
|
||||||
|
|
||||||
下载脚本
|
- **国际/国内使用 CDN 加速:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
||||||
```
|
```
|
||||||
|
|
||||||
或
|
- **国内用户使用 CNB 加速:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
||||||
```
|
```
|
||||||
|
|
||||||
安装环境
|
- **短链接:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./goecs.sh env
|
export noninteractive=true && curl -L https://bash.spiritlhl.net/goecs -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
||||||
```
|
```
|
||||||
|
|
||||||
安装goecs
|
#### **详细说明**
|
||||||
|
|
||||||
```
|
**详细说明**中的命令**可控制是否安装依赖**,**是否更新包管理器**,**默认互动模式可进行选择**
|
||||||
./goecs.sh install
|
|
||||||
```
|
|
||||||
|
|
||||||
升级goecs
|
<details>
|
||||||
|
<summary>展开查看详细说明</summary>
|
||||||
|
|
||||||
```
|
1. **下载脚本**
|
||||||
./goecs.sh upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
卸载goecs
|
**国际用户无加速:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./goecs.sh uninstall
|
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
shell脚本的说明
|
**国际/国内使用 CDN 加速:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
可用命令:
|
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
|
```
|
||||||
|
|
||||||
./goecs.sh env 检查并安装的包:
|
**国内用户使用 CNB 加速:**
|
||||||
sudo (几乎所有类 Unix 系统都有。)
|
|
||||||
tar (几乎所有类 Unix 系统都有。)
|
|
||||||
unzip (几乎所有类 Unix 系统都有。)
|
|
||||||
dd (几乎所有类 Unix 系统都有。)
|
|
||||||
fio (几乎所有类 Unix 系统可以通过系统的包管理器安装。)
|
|
||||||
sysbench (几乎所有类 Unix 系统可以通过系统的包管理器安装。)
|
|
||||||
geekbench (geekbench5) (仅支持 IPV4 环境,且内存大于 1GB 并需要持续联网,仅支持 amd64 和 arm64 架构。)
|
|
||||||
speedtest (使用官方提供的二进制文件以获得更准确的测试结果。)
|
|
||||||
ping (使用官方提供的二进制文件以获得更准确的测试结果。)
|
|
||||||
systemd-detect-virt 或 dmidecode (几乎所有类 Unix 系统都有,安装以获得更准确的测试结果。)
|
|
||||||
事实上,sysbench/geekbench 是上述依赖项中唯一必须安装的,没有它们无法测试 CPU 分数。
|
|
||||||
./goecs.sh install 安装 goecs 命令
|
|
||||||
./goecs.sh upgrade 升级 goecs 命令
|
|
||||||
./goecs.sh uninstall 卸载 goecs 命令
|
|
||||||
./goecs.sh help 显示此消息
|
|
||||||
```
|
|
||||||
|
|
||||||
goecs唤起菜单
|
```bash
|
||||||
|
curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
|
```
|
||||||
|
|
||||||
```
|
2. **更新包管理器(可选择)并安装环境**
|
||||||
goecs
|
|
||||||
```
|
|
||||||
|
|
||||||
或
|
```bash
|
||||||
|
./goecs.sh env
|
||||||
|
```
|
||||||
|
|
||||||
```
|
**非互动模式:**
|
||||||
./goecs
|
|
||||||
```
|
|
||||||
|
|
||||||
goecs命令参数化
|
```bash
|
||||||
|
export noninteractive=true && ./goecs.sh env
|
||||||
|
```
|
||||||
|
|
||||||
```
|
3. **安装 `goecs` 本体(仅下载二进制文件无依赖安装)**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh install
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **升级 `goecs` 本体**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **卸载 `goecs` 本体**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh uninstall
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **帮助命令**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh -h
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **唤起菜单**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
goecs
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### **命令参数化**
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>展开查看各参数说明</summary>
|
||||||
|
|
||||||
|
```bash
|
||||||
Usage: goecs [options]
|
Usage: goecs [options]
|
||||||
-backtrace
|
-backtrace
|
||||||
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
|
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
|
||||||
@@ -163,7 +213,7 @@ Usage: goecs [options]
|
|||||||
-memory
|
-memory
|
||||||
Enable/Disable memory test (default true)
|
Enable/Disable memory test (default true)
|
||||||
-memorym string
|
-memorym string
|
||||||
Set memory test method (supported: sysbench, dd, winsat) (default "dd")
|
Set memory test method (supported: sysbench, dd, winsat) (default "sysbench")
|
||||||
-menu
|
-menu
|
||||||
Enable/Disable menu mode, disable example: -menu=false (default true)
|
Enable/Disable menu mode, disable example: -menu=false (default true)
|
||||||
-nt3
|
-nt3
|
||||||
@@ -184,18 +234,105 @@ Usage: goecs [options]
|
|||||||
Enable/Disable unlock media test (default true)
|
Enable/Disable unlock media test (default true)
|
||||||
-v Display version information
|
-v Display version information
|
||||||
```
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## Windows上使用的说明
|
---
|
||||||
|
|
||||||
下载带exe文件的压缩文件
|
### **Windows**
|
||||||
|
|
||||||
https://github.com/oneclickvirt/ecs/releases
|
1. 下载带 exe 文件的压缩包:[Releases](https://github.com/oneclickvirt/ecs/releases)
|
||||||
|
2. 解压后,右键以管理员模式运行。
|
||||||
|
|
||||||
找其中最新的版本,按照对应架构下载对应的 .zip 文件,解压后文件夹内有一个exe文件
|
---
|
||||||
|
|
||||||
选择该exe文件,右键点击选择管理员模式运行(非管理员模式运行无法进行硬件测试),唤起菜单自选
|
### **Docker**
|
||||||
|
|
||||||
windows测试无需进行环境安装
|
<details>
|
||||||
|
<summary>展开查看使用说明</summary>
|
||||||
|
|
||||||
|
国际镜像地址:https://hub.docker.com/r/spiritlhl/goecs
|
||||||
|
|
||||||
|
请确保执行下述命令前本机已安装Docker
|
||||||
|
|
||||||
|
特权模式+host网络
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm --privileged --network host spiritlhl/goecs:latest -menu=false -l zh
|
||||||
|
```
|
||||||
|
|
||||||
|
非特权模式+非host网络
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm spiritlhl/goecs:latest -menu=false -l zh
|
||||||
|
```
|
||||||
|
|
||||||
|
使用Docker执行测试,硬件测试会有一些偏差和虚拟化架构判断失效,还是推荐直接测试而不使用Docker测试。
|
||||||
|
|
||||||
|
国内阿里云镜像加速
|
||||||
|
|
||||||
|
请确保执行下述命令前本机已安装Docker
|
||||||
|
|
||||||
|
特权模式+host网络
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm --privileged --network host crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest -menu=false -l zh
|
||||||
|
```
|
||||||
|
|
||||||
|
非特权模式+非host网络
|
||||||
|
|
||||||
|
```shell
|
||||||
|
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>
|
||||||
|
<summary>展开查看编译说明</summary>
|
||||||
|
|
||||||
|
1. 克隆仓库的 public 分支(不含私有依赖)
|
||||||
|
```bash
|
||||||
|
git clone -b public https://github.com/oneclickvirt/ecs.git
|
||||||
|
cd ecs
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 安装 Go 环境(如已安装可跳过)
|
||||||
|
```bash
|
||||||
|
# 下载并安装 Go
|
||||||
|
wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
|
||||||
|
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 编译
|
||||||
|
```bash
|
||||||
|
go build -o goecs
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 运行测试
|
||||||
|
```bash
|
||||||
|
./goecs -menu=false -l zh
|
||||||
|
```
|
||||||
|
|
||||||
|
支持的编译参数:
|
||||||
|
- GOOS:支持 linux、windows、darwin、freebsd、openbsd
|
||||||
|
- GOARCH:支持 amd64、arm、arm64、386、mips、mipsle、s390x、riscv64
|
||||||
|
|
||||||
|
跨平台编译示例:
|
||||||
|
```bash
|
||||||
|
# 编译 Windows 版本
|
||||||
|
GOOS=windows GOARCH=amd64 go build -o goecs.exe
|
||||||
|
# 编译 MacOS 版本
|
||||||
|
GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## QA
|
## QA
|
||||||
|
|
||||||
@@ -203,15 +340,15 @@ windows测试无需进行环境安装
|
|||||||
|
|
||||||
#### A: 比较二者特点
|
#### A: 比较二者特点
|
||||||
|
|
||||||
```
|
| 比较项 | sysbench | geekbench |
|
||||||
sysbench geekbench
|
|------------------|----------|-----------|
|
||||||
轻量几乎所有服务器都能跑 重型小机器跑不动
|
| 适用范围 | 轻量级,几乎可在任何服务器上运行 | 重量级,小型机器无法运行 |
|
||||||
测试无联网需求,无硬件需求 测试必须联网,且必须IPV4环境,且有内存大小1G的最低需求
|
| 测试要求 | 无需网络,无特殊硬件需求 | 需联网,IPV4环境,至少1G内存 |
|
||||||
LUA编写且开源,各架构系统可自行编译 仅官方二进制文件且不开源,无对应架构时无法自行编译
|
| 开源情况 | 基于LUA,开源,可自行编译各架构版本 | 官方二进制闭源代码,不支持自行编译 |
|
||||||
核心测试组件十多年不变 每次大版本更新对标的CPU,不同版本间得分互相之间难转化,你只能以对标的CPU为准
|
| 测试稳定性 | 核心测试组件10年以上未变 | 每个大版本更新测试项,分数不同版本间难以对比(每个版本对标当前最好的CPU) |
|
||||||
测试仅测试计算性能 测试涵盖多种性能测试,得分以权重计算,但实际很多测试项目实际是用不到的
|
| 测试内容 | 仅测试计算性能 | 覆盖多种性能测试,分数加权计算,但部分测试实际不常用 |
|
||||||
适合快速测试 适合全面测试
|
| 适用场景 | 适合快速测试,仅测试计算性能 | 适合综合全面的测试 |
|
||||||
```
|
| 排行榜 | [sysbench.spiritlhl.net](https://sysbench.spiritlhl.net/) | [browser.geekbench.com](https://browser.geekbench.com/) |
|
||||||
|
|
||||||
且```goecs```测试使用何种CPU测试方式可使用参数指定,默认只是为了更多用户快速测试的需求
|
且```goecs```测试使用何种CPU测试方式可使用参数指定,默认只是为了更多用户快速测试的需求
|
||||||
|
|
||||||
@@ -227,3 +364,47 @@ LUA编写且开源,各架构系统可自行编译 仅官方二进制文件且
|
|||||||
|
|
||||||
#### A: 每个测试项目有对应的维护仓库,自行点击查看仓库说明
|
#### A: 每个测试项目有对应的维护仓库,自行点击查看仓库说明
|
||||||
|
|
||||||
|
#### Q: 测试进行到一半如何手动终止?
|
||||||
|
|
||||||
|
#### A: 按ctrl键和c键终止程序,终止后依然会在当前目录下生成goecs.txt文件和分享链接,里面是已经测试到的信息。
|
||||||
|
|
||||||
|
#### Q: 非Root环境如何进行测试?
|
||||||
|
|
||||||
|
#### A: 手动执行安装命令,实在装不上也没问题,直接在release中下载对应架构的压缩包解压后执行即可,只要你能执行的了文件。或者你能使用docker的话用docker执行。
|
||||||
|
|
||||||
|
## 致谢
|
||||||
|
|
||||||
|
感谢 [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进行检测,感谢互联网各网站提供的查询资源
|
||||||
|
|
||||||
|
感谢
|
||||||
|
|
||||||
|
<a href="https://h501.io/?from=69" target="_blank">
|
||||||
|
<img src="https://github.com/spiritLHLS/ecs/assets/103393591/dfd47230-2747-4112-be69-b5636b34f07f" alt="h501" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
提供的免费托管支持本开源项目的共享测试结果存储
|
||||||
|
|
||||||
|
同时感谢以下平台提供编辑和测试支持
|
||||||
|
|
||||||
|
<a href="https://www.jetbrains.com/go/" target="_blank">
|
||||||
|
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/GoLand.png" alt="goland" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://community.ibm.com/zsystems/form/l1cc-oss-vm-request/" target="_blank">
|
||||||
|
<img src="https://linuxone.cloud.marist.edu/oss/resources/images/linuxonelogo03.png" alt="ibm" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://console.zmto.com/?affid=1524" target="_blank">
|
||||||
|
<img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## History Usage
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Stargazers over time
|
||||||
|
|
||||||
|
[](https://www.spiritlhl.net)
|
||||||
|
|
||||||
|
## License
|
||||||
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_large)
|
||||||
|
402
README_EN.md
402
README_EN.md
@@ -1,125 +1,187 @@
|
|||||||
# ecs
|
# ECS
|
||||||
|
|
||||||
[](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [](https://www.spiritlhl.net/)
|
[](https://github.com/oneclickvirt/ecs/actions/workflows/build_binary.yaml)
|
||||||
|
|
||||||
Fusion Monster Evaluation Script - GO Refactored Version - Since it has not been officially released, please report any issues via issues.
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_shield)
|
||||||
|
|
||||||
Shell version: https://github.com/spiritLHLS/ecs/blob/main/README_EN.md
|
[](https://hits.spiritlhl.net)
|
||||||
|
|
||||||
## Language
|
Fusion Monster Evaluation Project - GO Version
|
||||||
|
|
||||||
|
(No additional shell file dependencies unless necessary to install the environment using the shell, the environment is installed just to measure more accurately, in extreme cases no environment dependencies can also be fully measured project)
|
||||||
|
|
||||||
|
Please report any issues via [issues](https://github.com/oneclickvirt/ecs/issues).
|
||||||
|
|
||||||
|
Go version: [https://github.com/oneclickvirt/ecs](https://github.com/oneclickvirt/ecs)
|
||||||
|
|
||||||
|
Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https://github.com/spiritLHLS/ecs/blob/main/README_EN.md)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## **Language**
|
||||||
|
|
||||||
[中文文档](README.md) | [English Docs](README_EN.md)
|
[中文文档](README.md) | [English Docs](README_EN.md)
|
||||||
|
|
||||||
## Supported Systems and Architectures
|
---
|
||||||
|
|
||||||
Architectures supported for compilation: amd64、arm、arm64、386、s390x、mips、mipsle、s390x、riscv64
|
## **Supported Systems and Architectures**
|
||||||
|
|
||||||
Tested architectures: amd64, arm64
|
### **Compilation and Testing Support**
|
||||||
|
| Supported for Compilation | Tested on | Supported OS for Compilation | Tested OS |
|
||||||
|
|---------------------------|-----------|------------------------------|-----------|
|
||||||
|
| amd64 | amd64 | Linux | Linux |
|
||||||
|
| arm64 | arm64 | Windows | Windows |
|
||||||
|
| arm | | MacOS(Darwin) | MacOS |
|
||||||
|
| 386 | | FreeBSD | |
|
||||||
|
| mips,mipsle | | Android | |
|
||||||
|
| mips64,mips64le | | | |
|
||||||
|
| ppc64,ppc64le | | | |
|
||||||
|
| s390x | s390x | | |
|
||||||
|
| riscv64 | | | |
|
||||||
|
|
||||||
More architectures please test by yourself
|
> For more information about the architecture and system, please test or compile it yourself, and open issues if you have any questions.
|
||||||
|
|
||||||
Compilation support: Linux, Windows、MacOS、FreeBSD、OpenBSD
|
### **Systems Pending Support**
|
||||||
|
|
||||||
Tested on: Linux, Windows
|
| OS | Notes |
|
||||||
|
|--------|-------------------------------------------------------------------------------------------------|
|
||||||
|
| 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) |
|
||||||
|
|
||||||
More systems to be tested
|
---
|
||||||
|
|
||||||
Systems to be supported (hardware testing bugs not yet fixed): MacOS、FreeBSD、OpenBSD
|
## **Features**
|
||||||
|
|
||||||
## Features
|
- System basic information query and concurrent IP basic information query: Self-developed [basics](https://github.com/oneclickvirt/basics), [gostun](https://github.com/oneclickvirt/gostun)
|
||||||
|
- CPU test: Self-developed [cputest](https://github.com/oneclickvirt/cputest) supporting sysbench(lua/golang version), geekbench, winsat
|
||||||
|
- Memory test: Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd
|
||||||
|
- Disk test: Self-developed [disktest](https://github.com/oneclickvirt/disktest) supporting dd, fio, winsat
|
||||||
|
- Streaming media unlock information concurrent query: Modified from [netflix-verify](https://github.com/sjlleo/netflix-verify) and more to [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)
|
||||||
|
- Common streaming media tests concurrent query: Self-developed to [UnlockTests](https://github.com/oneclickvirt/UnlockTests), logic modified from [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) and others
|
||||||
|
- IP quality/security information concurrent query: Self-developed, binary files compiled in [securityCheck](https://github.com/oneclickvirt/securityCheck)
|
||||||
|
- Email port test: Self-developed [portchecker](https://github.com/oneclickvirt/portchecker)
|
||||||
|
- Three-network return path test: Modified from [zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace) to [oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace)
|
||||||
|
- 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)
|
||||||
|
- 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
|
||||||
|
|
||||||
- [x] System basic information query [Self-developed [basics](https://github.com/oneclickvirt/basics), [gostun](https://github.com/oneclickvirt/gostun)]
|
**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)**
|
||||||
- [x] Concurrent IP basic information query [Self-developed [basics](https://github.com/oneclickvirt/basics)]
|
|
||||||
- [x] CPU test [Self-developed [cputest](https://github.com/oneclickvirt/cputest) supporting sysbench, geekbench, winsat]
|
|
||||||
- [x] Memory test [Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd]
|
|
||||||
- [x] Disk test [Self-developed [disktest](https://github.com/oneclickvirt/disktest) supporting dd, fio, winsat]
|
|
||||||
- [x] Concurrent streaming media unlock information query for three major platforms [Modified from [netflix-verify](https://github.com/sjlleo/netflix-verify), [VerifyDisneyPlus](https://github.com/sjlleo/VerifyDisneyPlus), [TubeCheck](https://github.com/sjlleo/TubeCheck) to [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)]
|
|
||||||
- [x] Concurrent common streaming media tests [Self-developed code, logic modified from [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck), [MediaUnlockTest](https://github.com/HsukqiLee/MediaUnlockTest) to [UnlockTests](https://github.com/oneclickvirt/UnlockTests)]
|
|
||||||
- [x] Concurrent IP quality/security information query [Self-developed, due to testing with key information, privately developed, but binary files compiled in [securityCheck](https://github.com/oneclickvirt/securityCheck)]
|
|
||||||
- [x] Email port test [Self-developed [portchecker](https://github.com/oneclickvirt/portchecker)]
|
|
||||||
- [x] Three-network return path test [Modified from [zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace) to [oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace)]
|
|
||||||
- [x] Three-network route test [Modified from [NTrace-core](https://github.com/nxtrace/NTrace-core) to [nt3](https://github.com/oneclickvirt/nt3)]
|
|
||||||
- [x] Speed test [Based on data from [speedtest.net-crawler](https://github.com/spiritLHLS/speedtest.net-CN-ID), [speedtest.cn-crawler](https://github.com/spiritLHLS/speedtest.cn-CN-ID), modified from [speedtest-go](https://github.com/showwin/speedtest-go) to [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)]
|
|
||||||
- [x] Three-network Ping test [Modified from [ecsspeed](https://github.com/spiritLHLS/ecsspeed) logic to [pingtest](https://github.com/oneclickvirt/pingtest)]
|
|
||||||
|
|
||||||
## Instructions for Use on Linux/FreeBSD/MacOS
|
---
|
||||||
|
|
||||||
### one-click command
|
## **Instructions for Use**
|
||||||
|
|
||||||
```
|
### **Linux/FreeBSD/MacOS**
|
||||||
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
|
||||||
```
|
|
||||||
|
|
||||||
### explain in detail
|
#### **One-click command**
|
||||||
|
|
||||||
Download the script
|
**One-Click Command** will **Install Dependencies by Default**, **Update Package Manager by Default**, **Default Non-Interactive Mode***
|
||||||
|
|
||||||
```
|
- **International users without acceleration:**
|
||||||
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Install environment
|
```bash
|
||||||
|
export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en
|
||||||
|
```
|
||||||
|
|
||||||
```
|
- **International/domestic users with CDN acceleration:**
|
||||||
./goecs.sh env
|
|
||||||
```
|
|
||||||
|
|
||||||
Install goecs
|
```bash
|
||||||
|
export noninteractive=true && curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en
|
||||||
|
```
|
||||||
|
|
||||||
```
|
- **Domestic users with CNB acceleration:**
|
||||||
./goecs.sh install
|
|
||||||
```
|
|
||||||
|
|
||||||
Upgrade goecs
|
```bash
|
||||||
|
export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs -l en
|
||||||
|
```
|
||||||
|
|
||||||
```
|
- **Short Link:**
|
||||||
./goecs.sh upgrade
|
|
||||||
```
|
|
||||||
|
|
||||||
Uninstall goecs
|
```bash
|
||||||
|
export noninteractive=true && curl -L https://bash.spiritlhl.net/goecs -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs
|
||||||
|
``
|
||||||
|
|
||||||
```
|
#### **Detailed instructions**
|
||||||
./goecs.sh uninstall
|
|
||||||
```
|
|
||||||
|
|
||||||
Explanation of the shell script
|
**Detailed description** of the commands in **Command **Controls whether to install dependencies**, **Whether to update the package manager**, **Default interaction mode can be selected***
|
||||||
|
|
||||||
```
|
<details>
|
||||||
Available commands:
|
<summary>Expand to view detailed instructions</summary>
|
||||||
|
|
||||||
./goecs.sh env Check and Install package:
|
1. **Download the script**
|
||||||
sudo (Almost all unix-like systems have it.)
|
|
||||||
tar (Almost all unix-like systems have it.)
|
|
||||||
unzip (Almost all unix-like systems have it.)
|
|
||||||
dd (Almost all unix-like systems have it.)
|
|
||||||
fio (Almost all unix-like systems can be installed through the system's package manager.)
|
|
||||||
sysbench (Almost all unix-like systems can be installed through the system's package manager.)
|
|
||||||
geekbench (geekbench5)(Only support IPV4 environment, and memory greater than 1GB network detection, only support amd64 and arm64 architecture.)
|
|
||||||
speedtest (Use the officially provided binaries for more accurate test results.)
|
|
||||||
ping (Use the officially provided binaries for more accurate test results.)
|
|
||||||
systemd-detect-virt OR dmidecode (Almost all unix-like systems have it, for more accurate test results.)
|
|
||||||
In fact, sysbench/geekbench is the only one of the above dependencies that must be installed, without which the CPU score cannot be tested.
|
|
||||||
./goecs.sh install Install goecs command
|
|
||||||
./goecs.sh upgrade Upgrade goecs command
|
|
||||||
./goecs.sh uninstall Uninstall goecs command
|
|
||||||
./goecs.sh help Show this message
|
|
||||||
```
|
|
||||||
|
|
||||||
Invoke the goecs menu
|
**International users without acceleration:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
goecs
|
curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
**International/domestic users with CDN acceleration:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./goecs
|
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Parameterized goecs command
|
**Domestic users with CNB acceleration:**
|
||||||
|
|
||||||
```
|
```bash
|
||||||
|
curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Update package manager (optional) and install environment**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh env
|
||||||
|
```
|
||||||
|
|
||||||
|
**Non-interactive mode:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export noninteractive=true && ./goecs.sh env
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Install `goecs`**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh install
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Upgrade `goecs`**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Uninstall `goecs`**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh uninstall
|
||||||
|
|
||||||
|
6. **help command**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./goecs.sh -h
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **Invoke the menu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
goecs -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### **Command parameterization**
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand to view parameter descriptions</summary>
|
||||||
|
|
||||||
|
```bash
|
||||||
Usage: goecs [options]
|
Usage: goecs [options]
|
||||||
-backtrace
|
-backtrace
|
||||||
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
|
Enable/Disable backtrace test (in 'en' language or on windows it always false) (default true)
|
||||||
@@ -151,7 +213,7 @@ Usage: goecs [options]
|
|||||||
-memory
|
-memory
|
||||||
Enable/Disable memory test (default true)
|
Enable/Disable memory test (default true)
|
||||||
-memorym string
|
-memorym string
|
||||||
Set memory test method (supported: sysbench, dd, winsat) (default "dd")
|
Set memory test method (supported: sysbench, dd, winsat) (default "sysbench")
|
||||||
-menu
|
-menu
|
||||||
Enable/Disable menu mode, disable example: -menu=false (default true)
|
Enable/Disable menu mode, disable example: -menu=false (default true)
|
||||||
-nt3
|
-nt3
|
||||||
@@ -172,15 +234,175 @@ Usage: goecs [options]
|
|||||||
Enable/Disable unlock media test (default true)
|
Enable/Disable unlock media test (default true)
|
||||||
-v Display version information
|
-v Display version information
|
||||||
```
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
## Instructions for Use on Windows
|
---
|
||||||
|
|
||||||
Download the compressed file with the exe file
|
### **Windows**
|
||||||
|
|
||||||
https://github.com/oneclickvirt/ecs/releases
|
1. Download the compressed file with the .exe file: [Releases](https://github.com/oneclickvirt/ecs/releases)
|
||||||
|
2. After unzipping, right-click and run as administrator.
|
||||||
|
|
||||||
Find the latest version, download the .zip file corresponding to your architecture, and unzip it to get an exe file.
|
---
|
||||||
|
|
||||||
Right-click the exe file and select Run as administrator (running without administrator mode will not allow hardware testing), and invoke the menu to choose.
|
### **Docker**
|
||||||
|
|
||||||
No environment installation is required for Windows testing.
|
<details>
|
||||||
|
<summary>Expand to view how to use it</summary>
|
||||||
|
|
||||||
|
International image: https://hub.docker.com/r/spiritlhl/goecs
|
||||||
|
|
||||||
|
Please ensure Docker is installed on your machine before executing the following commands
|
||||||
|
|
||||||
|
Privileged mode + host network
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm --privileged --network host spiritlhl/goecs:latest -menu=false -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
Unprivileged mode + non-host network
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm spiritlhl/goecs:latest -menu=false -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
Using Docker to execute tests will result in some hardware testing bias and virtualization architecture detection failure. Direct testing is recommended over Docker testing.
|
||||||
|
|
||||||
|
Mirror image: https://cnb.cool/oneclickvirt/ecs/-/packages/docker/ecs
|
||||||
|
|
||||||
|
Please ensure Docker is installed on your machine before executing the following commands
|
||||||
|
|
||||||
|
Privileged mode + host network
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm --privileged --network host docker.cnb.cool/oneclickvirt/ecs:latest -menu=false -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
Unprivileged mode + non-host network
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker run --rm docker.cnb.cool/oneclickvirt/ecs:latest -menu=false -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Compiling from source code
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand to view compilation instructions</summary>
|
||||||
|
|
||||||
|
1. Clone the public branch of the repository (without private dependencies)
|
||||||
|
```bash
|
||||||
|
git clone -b public https://github.com/oneclickvirt/ecs.git
|
||||||
|
cd ecs
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Install Go environment (skip if already installed)
|
||||||
|
```bash
|
||||||
|
# Download and install Go
|
||||||
|
wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz
|
||||||
|
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Compile
|
||||||
|
```bash
|
||||||
|
go build -o goecs
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Run test
|
||||||
|
```bash
|
||||||
|
./goecs -menu=false -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
Supported compilation parameters:
|
||||||
|
- GOOS: supports linux, windows, darwin, freebsd, openbsd
|
||||||
|
- GOARCH: supports amd64, arm, arm64, 386, mips, mipsle, s390x, riscv64
|
||||||
|
|
||||||
|
Cross-platform compilation examples:
|
||||||
|
```bash
|
||||||
|
# Compile Windows version
|
||||||
|
GOOS=windows GOARCH=amd64 go build -o goecs.exe
|
||||||
|
# Compile MacOS version
|
||||||
|
GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## QA
|
||||||
|
|
||||||
|
#### Q: Why is sysbench used by default instead of geekbench?
|
||||||
|
|
||||||
|
#### A: Comparing the characteristics of both:
|
||||||
|
|
||||||
|
| Comparison | sysbench | geekbench |
|
||||||
|
|------------|----------|-----------|
|
||||||
|
| Application scope | Lightweight, runs on almost any server | Heavyweight, won't run on small machines |
|
||||||
|
| Test requirements | No network needed, no special hardware requirements | Requires internet, IPv4 environment, minimum 1GB memory |
|
||||||
|
| Open source status | Based on LUA, open source, can compile for various architectures | Official binaries are closed source, cannot compile your own version |
|
||||||
|
| 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 |
|
||||||
|
| 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.
|
||||||
|
|
||||||
|
#### Q: Why use Golang instead of Rust for refactoring?
|
||||||
|
|
||||||
|
#### A: Because network-related projects currently trend toward Golang, with many components maintained by open source communities. Many Rust components would require building from scratch, ~~I'm too lazy~~ I don't have that technical capability.
|
||||||
|
|
||||||
|
#### Q: Why not continue developing the Shell version instead of refactoring?
|
||||||
|
|
||||||
|
#### A: Because there were too many varied environment issues. Pre-compiled binary files are easier for solving environment problems (better generalization).
|
||||||
|
|
||||||
|
#### Q: Are there explanations for each test item?
|
||||||
|
|
||||||
|
#### A: Each test project has its own maintenance repository. Click through to view the repository description.
|
||||||
|
|
||||||
|
#### Q: How do I manually terminate a test halfway through?
|
||||||
|
|
||||||
|
#### A: Press Ctrl+C to terminate the program. After termination, a goecs.txt file and share link will still be generated in the current directory containing information tested so far.
|
||||||
|
|
||||||
|
#### Q: How do I test in a non-Root environment?
|
||||||
|
|
||||||
|
#### A: Execute the installation command manually. If you can't install it, simply download the appropriate architecture package from releases, extract it, and run the file if you have execution permissions. Alternatively, use Docker if you can.
|
||||||
|
|
||||||
|
## Thanks
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
<a href="https://h501.io/?from=69" target="_blank">
|
||||||
|
<img src="https://github.com/spiritLHLS/ecs/assets/103393591/dfd47230-2747-4112-be69-b5636b34f07f" alt="h501" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
provided free hosting support for this open source project's shared test results storage
|
||||||
|
|
||||||
|
Thanks also to the following platforms for editorial and testing support
|
||||||
|
|
||||||
|
<a href="https://www.jetbrains.com/go/" target="_blank">
|
||||||
|
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/GoLand.png" alt="goland" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://community.ibm.com/zsystems/form/l1cc-oss-vm-request/" target="_blank">
|
||||||
|
<img src="https://linuxone.cloud.marist.edu/oss/resources/images/linuxonelogo03.png" alt="ibm" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://console.zmto.com/?affid=1524" target="_blank">
|
||||||
|
<img src="https://console.zmto.com/templates/2019/dist/images/logo_dark.svg" alt="zmto" style="height: 50px;">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## History Usage
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Stargazers over time
|
||||||
|
|
||||||
|
[](https://www.spiritlhl.net)
|
||||||
|
|
||||||
|
## License
|
||||||
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Foneclickvirt%2Fecs?ref=badge_large)
|
||||||
|
537
README_NEW_USER.md
Normal file
537
README_NEW_USER.md
Normal file
@@ -0,0 +1,537 @@
|
|||||||
|
## 目录 / Table of Contents / 目次
|
||||||
|
|
||||||
|
[](https://hits.spiritlhl.net)
|
||||||
|
|
||||||
|
## 语言 / Languages / 言語
|
||||||
|
- [中文](#中文)
|
||||||
|
- [English](#English)
|
||||||
|
- [日本語](#日本語)
|
||||||
|
|
||||||
|
## 中文
|
||||||
|
- [系统基础信息](#系统基础信息)
|
||||||
|
- [CPU测试](#CPU测试)
|
||||||
|
- [内存测试](#内存测试)
|
||||||
|
- [硬盘测试](#硬盘测试)
|
||||||
|
- [流媒体解锁](#流媒体解锁)
|
||||||
|
- [IP质量检测](#IP质量检测)
|
||||||
|
- [邮件端口检测](#邮件端口检测)
|
||||||
|
- [上游及回程线路检测](#上游及回程线路检测)
|
||||||
|
- [三网回程路由检测](#三网回程路由检测)
|
||||||
|
- [就近测速](#就近测速)
|
||||||
|
|
||||||
|
## English
|
||||||
|
- [Basic System Information](#Basic-System-Information)
|
||||||
|
- [CPU Testing](#CPU-Testing)
|
||||||
|
- [Memory Testing](#Memory-Testing)
|
||||||
|
- [Disk Testing](#Disk-Testing)
|
||||||
|
- [Streaming Media Unlocking](#Streaming-Media-Unlocking)
|
||||||
|
- [IP Quality Detection](#IP-Quality-Detection)
|
||||||
|
- [Email Port Detection](#Email-Port-Detection)
|
||||||
|
|
||||||
|
## 日本語
|
||||||
|
- [システム基本情報](#システム基本情報)
|
||||||
|
- [CPUテスト](#CPUテスト)
|
||||||
|
- [メモリテスト](#メモリテスト)
|
||||||
|
- [ディスクテスト](#ディスクテスト)
|
||||||
|
- [ストリーミングメディアロック解除](#ストリーミングメディアロック解除)
|
||||||
|
- [IP品質検出](#IP品質検出)
|
||||||
|
- [メールポート検出](#メールポート検出)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 中文
|
||||||
|
|
||||||
|
### **系统基础信息**
|
||||||
|
|
||||||
|
CPU型号: 不必多说,大概的说,按CPU的发布时间,都是新款则AMD好于Intel,都是旧款则Intel好于AMD。
|
||||||
|
|
||||||
|
CPU数量: 会检测是物理核心还是逻辑核心,优先展示物理核心,查不到物理核心才去展示逻辑核心。在服务器实际使用过程中,程序一般是按逻辑核心分配执行的,非视频转码和科学计算,物理核心一般都是开超线程成逻辑核心用,横向比较的时候,对应类型的核心数量才有比较的意义。
|
||||||
|
|
||||||
|
CPU缓存:显示的宿主机的CPU三级缓存信息。
|
||||||
|
|
||||||
|
AES-NI: 指令集是加密解密加速用的,有的话常规网络请求会更快一些,性能更高一些,没有的话会影响网络请求(含代理用途)。
|
||||||
|
|
||||||
|
VM-x/AMD-V/Hyper-V: 是当前测试宿主机是否支持嵌套虚拟化的指标,如果测试环境是套在docker里测或者没有root权限,那么这个默认就是检测不到显示不支持嵌套虚拟化。这个指标在你需要在宿主机上开设虚拟机(如 KVM、VirtualBox、VMware)的时候有用,其他用途该指标用处不大。
|
||||||
|
|
||||||
|
内存: 显示内存 正在使用的大小/总大小 ,不含虚拟内存。
|
||||||
|
|
||||||
|
气球驱动: 显示宿主机是否使用了气球驱动,使用了证明母机有共享内存使用,需要结合下面的内存读写测试查看是否有超售/严格的限制。
|
||||||
|
|
||||||
|
内核页合并:显示宿主机是否使用了KSM内存融合,使用了证明母机有共享内存使用,需要结合下面的内存读写测试查看是否有超售/严格的限制。
|
||||||
|
|
||||||
|
虚拟内存: 显示 SWAP虚拟内存
|
||||||
|
|
||||||
|
硬盘空间: 显示硬盘 正在使用的大小/总大小
|
||||||
|
|
||||||
|
启动盘路径:显示启动盘的路径
|
||||||
|
|
||||||
|
系统: 显示系统名字和架构
|
||||||
|
|
||||||
|
内核: 显示系统内核版本
|
||||||
|
|
||||||
|
系统在线时间: 显示宿主机自从开机到测试时已在线时长
|
||||||
|
|
||||||
|
时区: 显示宿主机系统时区
|
||||||
|
|
||||||
|
负载: 显示系统负载
|
||||||
|
|
||||||
|
虚拟化架构: 显示宿主机来自什么虚拟化架构,一般来说推荐```Dedicated > KVM > Xen```虚拟化,其他虚拟化都会存在性能损耗,导致使用的时候存在性能共享/损耗,但这个也说不准,独立服务器才拥有完全独立的资源占用,其他虚拟化基本都会有资源共享,取决于宿主机的售卖者是否有良心,具体性能优劣还是得看后面的专项测试。
|
||||||
|
|
||||||
|
NAT类型: 显示NAT类型,具体推荐```Full Cone > Restricted Cone > Port Restricted Cone > Symmetric```,测不出来时会显示```Inconclusive```,一般来说不拿来做特殊用途(有关于特殊的代理和实时通讯需求的),都不用关注本指标。
|
||||||
|
|
||||||
|
TCP加速方式:一般是```cubic/bbr```拥塞控制协议,一般来说做代理服务器用bbr可以改善网速,普通用途不必关注此指标。
|
||||||
|
|
||||||
|
IPV4/IPV6 ASN: 显示宿主机IP所属的ASN组织ID和名字,同一个IDC可能会有多个ASN,ASN下可能有多个商家售卖不同段的IP的服务器,具体的上下游关系错综复杂,可使用 bgp.tool 进一步查看。
|
||||||
|
|
||||||
|
IPV4/IPV6 Location: 显示对应协议的IP在数据库中的地理位置。
|
||||||
|
|
||||||
|
IPV4 Active IPs: 根据 bgp.tools 信息查询当前CIDR分块中 活跃邻居数量/总邻居数量
|
||||||
|
|
||||||
|
IPV6 子网掩码:根据宿主机信息查询的本机IPV6子网大小
|
||||||
|
|
||||||
|
### **CPU测试**
|
||||||
|
|
||||||
|
支持通过命令行参数选择```GeekBench```和```Sysbench```进行测试:
|
||||||
|
|
||||||
|
| 比较项 | sysbench | geekbench |
|
||||||
|
|------------------|----------|-----------|
|
||||||
|
| 适用范围 | 轻量级,几乎可在任何服务器上运行 | 重量级,小型机器无法运行 |
|
||||||
|
| 测试要求 | 无需网络,无特殊硬件需求 | 需联网,IPV4环境,至少1G内存 |
|
||||||
|
| 开源情况 | 基于LUA,开源,可自行编译各架构版本(本项目有重构为Go版本内置) | 官方二进制闭源代码,不支持自行编译 |
|
||||||
|
| 测试稳定性 | 核心测试组件10年以上未变 | 每个大版本更新测试项,分数不同版本间难以对比(每个版本对标当前最好的CPU) |
|
||||||
|
| 测试内容 | 仅测试计算性能,基于素数计算 | 覆盖多种性能测试,分数加权计算,但部分测试实际不常用 |
|
||||||
|
| 适用场景 | 适合快速测试,仅测试计算性能 | 适合综合全面的测试 |
|
||||||
|
| 排行榜 | [sysbench.spiritlhl.net](https://sysbench.spiritlhl.net/) | [browser.geekbench.com](https://browser.geekbench.com/) |
|
||||||
|
|
||||||
|
默认使用```Sysbench```进行测试,基准大致如下:
|
||||||
|
|
||||||
|
CPU测试单核```Sysbench```得分在5000以上的可以算第一梯队,4000到5000分算第二梯队,每1000分大致算一档。
|
||||||
|
|
||||||
|
AMD的7950x单核满血性能得分在6500左右,AMD的5950x单核满血性能得分5700左右,Intel普通的CPU(E5之类的)在1000~800左右,低于500的单核CPU可以说是性能比较差的了。
|
||||||
|
|
||||||
|
有时候多核得分和单核得分一样,证明商家在限制程序并发使用CPU,典型例子腾讯云。
|
||||||
|
|
||||||
|
```Sysbench```的基准可见 [CPU Performance Ladder For Sysbench](https://sysbench.spiritlhl.net/) 天梯图,具体得分不分测试的sysbench的版本。
|
||||||
|
|
||||||
|
```GeekBench```的基准可见 [官方网站](https://browser.geekbench.com/processor-benchmarks/) 天梯图,具体得分每个```GeekBench```版本都不一样,注意使用时测试的```GeekBench```版本是什么。
|
||||||
|
|
||||||
|
多说一句,```GeekBench```测的很多内容,实际在服务器使用过程中根本用不到,测试仅供参考。当然```Sysbench```非常不全面,但它基于最基础的计算性能可以大致比较CPU的性能。
|
||||||
|
|
||||||
|
实际上CPU性能测试够用就行,除非是科学计算以及视频转码,一般不需要特别追求高性能CPU。
|
||||||
|
|
||||||
|
### **内存测试**
|
||||||
|
|
||||||
|
一般来说,只需要判断IO速度是否低于```10240MB/s```,如果低于这个值那么证明内存性能不佳,极大概率存在超售超卖问题。
|
||||||
|
|
||||||
|
至于超开的原因可能是开了虚拟内存(硬盘当内存用)、可能是开了ZRAM(牺牲CPU性能)、可能是开了气球驱动、可能是开了KSM内存融合,原因多种多样。
|
||||||
|
|
||||||
|
### **硬盘测试**
|
||||||
|
|
||||||
|
```dd```测试可能误差偏大但测试速度快无硬盘大小限制,```fio```测试真实一些但测试速度慢有硬盘以及内存大小的最低需求。
|
||||||
|
|
||||||
|
同时,服务器可能有不同的文件系统,某些文件系统的IO引擎在同样的硬件条件下测试的读写速度更快,这是正常的。项目默认使用```fio```进行测试,测试使用的IO引擎优先级为```libaio > posixaio > psync```,备选项```dd```测试在```fio```测试不可用时自动替换。
|
||||||
|
|
||||||
|
以```fio```测试结果为例基准如下:
|
||||||
|
|
||||||
|
| 操作系统类型 | 主要指标 | 次要指标 |
|
||||||
|
|---------|-------------------|---------------------|
|
||||||
|
| Windows/Mac | 4K读 → 64K读 → 写入测试 | 图形界面系统优先考虑读取性能 |
|
||||||
|
| Linux (无图形界面) | 4K读 + 4K写 + 1M读写| 读/写值通常相似 |
|
||||||
|
|
||||||
|
以下硬盘类型对于指标值指 常规~满血 性能状态,指```libaio```作为IO测试引擎,指在```Linux```下进行测试
|
||||||
|
|
||||||
|
| 驱动类型 | 4K(IOPS)性能 | 1M(IOPS)性能 |
|
||||||
|
|------------|--------------------------|----------------------|
|
||||||
|
| NVMe SSD | ≥ 200 MB/s | 5-10 GB/s |
|
||||||
|
| 标准SSD | 50-100 MB/s | 2-3 GB/s |
|
||||||
|
| HDD (机械硬盘) | 10-40 MB/s | 500-600 MB/s |
|
||||||
|
| 性能不佳 | < 10 MB/s | < 200 MB/s |
|
||||||
|
|
||||||
|
快速评估:
|
||||||
|
|
||||||
|
1. **主要检查**: 4K读(IOPS) 4K写(IOPS)
|
||||||
|
- 几乎相同差别不大
|
||||||
|
- ≥ 200 MB/s = NVMe SSD
|
||||||
|
- 50-100 MB/s = 标准SSD
|
||||||
|
- 10-40 MB/s = HDD (机械硬盘)
|
||||||
|
- < 10 MB/s = 垃圾性能,超售/限制严重
|
||||||
|
|
||||||
|
2. **次要检查**: 1M总和(IOPS)
|
||||||
|
- 提供商设置的IO限制
|
||||||
|
- 资源超开超售情况
|
||||||
|
- 数值越高越好
|
||||||
|
- NVMe SSD通常达到4-6 GB/s
|
||||||
|
- 标准SSD通常达到1-2 GB/s
|
||||||
|
|
||||||
|
如果 NVMe SSD的1M(IOPS)值 < 1GB/s 表明存在严重的资源超开超售。
|
||||||
|
|
||||||
|
注意,这里测试的是真实的IO,仅限本项目,非本项目测试的IO不保证基准通用,因为他们测试的时候可能用的不是同样的参数,可能未设置IO直接读写,可能设置IO引擎不一致,可能设置测试时间不一致,都会导致基准有偏差。
|
||||||
|
|
||||||
|
### **流媒体解锁**
|
||||||
|
|
||||||
|
检索常见的流媒体平台解锁,当然也不全是流媒体,还有一些常见的别的平台的解锁也纳入了。一般来说,IP解锁地区都是一致的不会到处乱飘,如果发现多家平台解锁地区不一致,那么IP大概率是租赁的IPXO等平台的,各平台数据库识别缓慢,IP质量一般来说也好不到哪里去。
|
||||||
|
|
||||||
|
### **IP质量检测**
|
||||||
|
|
||||||
|
检测14个数据库的IP相关信息,一般来说看使用类型和公司类型还有安全信息的其他判别足矣,安全得分真的图一乐。多个平台比较对应检测项目都为对应值,证明当前IP确实如此,不要仅相信一个数据库源的信息。
|
||||||
|
|
||||||
|
### **邮件端口检测**
|
||||||
|
|
||||||
|
- **SMTP(25)**:用于邮件服务器之间传输邮件(发送邮件)。
|
||||||
|
- **SMTPS(465)**:用于加密的 SMTP 发送邮件(SSL/TLS 方式)。
|
||||||
|
- **SMTP(587)**:用于客户端向邮件服务器发送邮件,支持 STARTTLS 加密。
|
||||||
|
- **POP3(110)**:用于邮件客户端从服务器下载邮件,不加密。
|
||||||
|
- **POP3S(995)**:用于加密的 POP3,安全地下载邮件(SSL/TLS 方式)。
|
||||||
|
- **IMAP(143)**:用于邮件客户端在线管理邮件(查看、同步邮件),不加密。
|
||||||
|
- **IMAPS(993)**:用于加密的 IMAP,安全地管理邮件(SSL/TLS 方式)。
|
||||||
|
|
||||||
|
具体当前宿主机不做邮局或者不收电子邮件,那么该项目指标不用理会。
|
||||||
|
|
||||||
|
### **上游及回程线路检测**
|
||||||
|
|
||||||
|
#### 上游类型与运营商等级说明
|
||||||
|
|
||||||
|
- **直接上游(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** | 其他类型的直接或间接连接,如 IX(Internet Exchange)成员、私有对等互联等。 |
|
||||||
|
|
||||||
|
上游质量判断:直接接入的高等级上游(特别是 Tier 1 Global)越多,通常网络连通性越好。但实际网络质量也受到以下因素影响:
|
||||||
|
|
||||||
|
- 上下游之间的商业结算关系;
|
||||||
|
- 购买的带宽套餐和服务质量;
|
||||||
|
- 对等端口(Peering Ports)大小和负载;
|
||||||
|
- 网络拥塞、路由策略、延迟路径等。
|
||||||
|
|
||||||
|
无法完全从 BGP 路由中判断。
|
||||||
|
|
||||||
|
一般来说,**接入高质量上游越多,网络连通性越优**。但由于存在诸多不可见的商业和技术因素,**无法仅凭上游等级准确判断网络质量**,上游检测约等于图一乐,实际得看对应的路由情况和长时间Ping的情况。
|
||||||
|
|
||||||
|
然后是检测当前的宿主机的IP地址 到 四个主要POP点城市的三个主要运营商的接入点的IP地址 的线路,具体来说
|
||||||
|
|
||||||
|
电信163、联通4837、移动CMI 是常见的线路,移动CMI对两广地区的移动运营商特供延迟低,也能算优质,仅限两广移动。
|
||||||
|
|
||||||
|
电信CN2GIA > 电信CN2GT 移动CMIN2 联通9929 算优质的线路
|
||||||
|
|
||||||
|
用什么运营商连宿主机的IP就看哪个运营商的线路就行了,具体线路的路由情况,看在下一个检测项看到对应的ICMP检测路由信息。
|
||||||
|
|
||||||
|
### **三网回程路由检测**
|
||||||
|
|
||||||
|
默认检测广州为目的地,实际可使用命令行参数指定目的地,见对应的参数说明。
|
||||||
|
|
||||||
|
主要就是看是不是直连,是不是延迟低,是不是没有隐藏路由信息。如果路由全球跑,延迟起飞,那么线路自然不会好到哪里去。有时候路由信息完全藏起来了,只知道实际使用的延迟低,实际可能也是优质线路只是查不到信息,这就没办法直接识别了。
|
||||||
|
|
||||||
|
### **就近测速**
|
||||||
|
|
||||||
|
先测的官方推荐的测速点,然后测有代表性的国际测速点,最后测国内三大运营商ping值最低的测速点。
|
||||||
|
|
||||||
|
境内使用为主就看境内测速即可,境外使用看境外测速,官方测速点可以代表受测的宿主机本地带宽基准。
|
||||||
|
|
||||||
|
一般来说境外的服务器的带宽100Mbps起步,境内的服务器1Mbps带宽起步,具体看线路优劣,带宽特别大有时候未必用得上,够用就行了。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## English
|
||||||
|
|
||||||
|
### **Basic System Information**
|
||||||
|
|
||||||
|
CPU Model: Simply put, generally speaking, based on CPU release dates, newer AMD models are better than Intel, while for older models, Intel is better than AMD.
|
||||||
|
|
||||||
|
CPU Count: It will detect whether these are physical cores or logical cores, prioritizing display of physical cores, only showing logical cores if physical core information is unavailable. In actual server usage, programs are generally allocated by logical cores. Except for video transcoding and scientific computing, physical cores are usually enabled with hyperthreading to function as logical cores. When making comparisons, only cores of the corresponding type have meaningful comparison value.
|
||||||
|
|
||||||
|
CPU Cache: Displays the host machine's three-level CPU cache information.
|
||||||
|
|
||||||
|
AES-NI: This instruction set is used for encryption/decryption acceleration. With it, normal network requests will be faster and performance will be higher. Without it, network requests (including proxy usage) will be affected.
|
||||||
|
|
||||||
|
VM-x/AMD-V/Hyper-V: This indicates whether the current host machine supports nested virtualization. If the test environment is running inside Docker or doesn't have root privileges, then by default this will be undetectable and will show as not supporting nested virtualization. This metric is useful when you need to set up virtual machines (such as KVM, VirtualBox, VMware) on the host machine; for other purposes, this metric is not very useful.
|
||||||
|
|
||||||
|
Memory: Displays memory size in format "currently used size/total size", not including virtual memory.
|
||||||
|
|
||||||
|
Balloon Driver: Shows whether the host machine is using a balloon driver. If used, it proves the parent machine has shared memory usage, which should be examined alongside the memory read/write test below to check for overselling/strict limitations.
|
||||||
|
|
||||||
|
Kernel Same-page Merging: Shows whether the host machine is using KSM memory fusion. If used, it proves the parent machine has shared memory usage, which should be examined alongside the memory read/write test below to check for overselling/strict limitations.
|
||||||
|
|
||||||
|
Virtual Memory: Displays SWAP virtual memory.
|
||||||
|
|
||||||
|
Disk Space: Displays disk usage in format "currently used size/total size".
|
||||||
|
|
||||||
|
Boot Disk Path: Shows the path of the boot disk.
|
||||||
|
|
||||||
|
System: Displays system name and architecture.
|
||||||
|
|
||||||
|
Kernel: Displays system kernel version.
|
||||||
|
|
||||||
|
System Uptime: Shows how long the host machine has been online since boot until testing time.
|
||||||
|
|
||||||
|
Timezone: Displays the host machine's system timezone.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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 Location: Shows the geographic location of the corresponding protocol's IP in the database.
|
||||||
|
|
||||||
|
IPV4 Active IPs: Query the number of active neighbours/total number of neighbours in the current CIDR chunk based on the bgp.tools information.
|
||||||
|
|
||||||
|
### **CPU Testing**
|
||||||
|
|
||||||
|
Supports selecting `GeekBench` and `Sysbench` for testing through command line parameters:
|
||||||
|
|
||||||
|
| Comparison Item | sysbench | geekbench |
|
||||||
|
|------------------|----------|-----------|
|
||||||
|
| Application Range | Lightweight, can run on almost any server | Heavyweight, cannot run on small machines |
|
||||||
|
| Test Requirements | No network needed, no special hardware requirements | Requires network, IPv4 environment, at least 1GB memory |
|
||||||
|
| Open Source Status | Based on LUA, open source, can compile versions for various architectures (this project has been rebuilt in Go version built-in) | Official binary closed source code, does not support self-compilation |
|
||||||
|
| 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 |
|
||||||
|
| 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:
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
In practice, CPU performance just needs to be sufficient. Unless you're doing scientific computing or video transcoding, you generally don't need to pursue high-performance CPUs.
|
||||||
|
|
||||||
|
### **Memory Testing**
|
||||||
|
|
||||||
|
Generally speaking, you only need to determine whether the IO speed is below `10240MB/s`. If it's below this value, it proves that memory performance is poor, with an extremely high probability of overselling issues.
|
||||||
|
|
||||||
|
As for the reasons for oversubscription, it could be that virtual memory is enabled (using disk as memory), ZRAM might be enabled (sacrificing CPU performance), balloon drivers might be enabled, or KSM memory fusion might be enabled - there are various possible reasons.
|
||||||
|
|
||||||
|
### **Disk Testing**
|
||||||
|
|
||||||
|
The `dd` test may have larger errors but is faster to test with no disk size limitations. The `fio` test is more realistic but slower to test and has minimum requirements for disk and memory size.
|
||||||
|
|
||||||
|
At the same time, servers may have different file systems, and certain file systems' IO engines may test faster read/write speeds under the same hardware conditions, which is normal. The project uses `fio` for testing by default, with IO engine priority being `libaio > posixaio > psync`. The alternative `dd` test automatically replaces when `fio` testing is not available.
|
||||||
|
|
||||||
|
Using `fio` test results as an example, the baseline is as follows:
|
||||||
|
|
||||||
|
| OS Type | Primary Metrics | Secondary Metrics |
|
||||||
|
|---------|-------------------|---------------------|
|
||||||
|
| Windows/Mac | 4K read → 64K read → Write test | Graphical systems prioritize read performance |
|
||||||
|
| Linux (without GUI) | 4K read + 4K write + 1M read/write | Read/write values usually similar |
|
||||||
|
|
||||||
|
The following disk types refer to metric values indicating normal~full-power performance states, using `libaio` as the IO test engine, testing under `Linux`
|
||||||
|
|
||||||
|
| Drive Type | 4K(IOPS) Performance | 1M(IOPS) Performance |
|
||||||
|
|------------|--------------------------|----------------------|
|
||||||
|
| NVMe SSD | ≥ 200 MB/s | 5-10 GB/s |
|
||||||
|
| Standard SSD | 50-100 MB/s | 2-3 GB/s |
|
||||||
|
| HDD (Mechanical) | 10-40 MB/s | 500-600 MB/s |
|
||||||
|
| Poor Performance | < 10 MB/s | < 200 MB/s |
|
||||||
|
|
||||||
|
Quick assessment:
|
||||||
|
|
||||||
|
1. **Primary Check**: 4K read(IOPS) 4K write(IOPS)
|
||||||
|
- Almost identical with little difference
|
||||||
|
- ≥ 200 MB/s = NVMe SSD
|
||||||
|
- 50-100 MB/s = Standard SSD
|
||||||
|
- 10-40 MB/s = HDD (Mechanical)
|
||||||
|
- < 10 MB/s = Poor performance, severe overselling/restriction
|
||||||
|
|
||||||
|
2. **Secondary Check**: 1M total(IOPS)
|
||||||
|
- IO limit set by provider
|
||||||
|
- Resource overselling situation
|
||||||
|
- Higher value is better
|
||||||
|
- NVMe SSD typically reaches 4-6 GB/s
|
||||||
|
- Standard SSD typically reaches 1-2 GB/s
|
||||||
|
|
||||||
|
If NVMe SSD's 1M(IOPS) value < 1GB/s, it indicates severe resource overselling.
|
||||||
|
|
||||||
|
Note that this is testing real IO, limited to this project only. The baseline may not be universal for tests not from this project, because they might not use the same parameters when testing, might not set direct IO reading/writing, might use inconsistent IO engines, or might set inconsistent test times, all of which will cause baseline deviations.
|
||||||
|
|
||||||
|
### **Streaming Media Unlocking**
|
||||||
|
|
||||||
|
Checks common streaming media platform unlocking, though not all are streaming media - some other common platform unlocks are also included. Generally speaking, IP unlocking regions are consistent and don't randomly fluctuate. If you find that multiple platforms have inconsistent unlocking regions, then the IP is likely rented from platforms like IPXO, with slow recognition in various platform databases. Generally speaking, the IP quality won't be good either.
|
||||||
|
|
||||||
|
### **IP Quality Detection**
|
||||||
|
|
||||||
|
Checks IP-related information from 14 databases. Generally speaking, it's sufficient to look at usage type, company type, and other security information judgments. The security score is really just for amusement. When multiple platforms compare corresponding detection items to corresponding values, it proves that the current IP is indeed as such. Don't just trust information from a single database source.
|
||||||
|
|
||||||
|
### **Email Port Detection**
|
||||||
|
|
||||||
|
- **SMTP (25)**: Used for email transmission between mail servers (sending mail).
|
||||||
|
- **SMTPS (465)**: Used for encrypted SMTP mail sending (SSL/TLS method).
|
||||||
|
- **SMTP (587)**: Used for clients to send email to mail servers, supports STARTTLS encryption.
|
||||||
|
- **POP3 (110)**: Used for email clients to download mail from servers, unencrypted.
|
||||||
|
- **POP3S (995)**: Used for encrypted POP3, securely downloading mail (SSL/TLS method).
|
||||||
|
- **IMAP (143)**: Used for email clients to manage mail online (view, sync mail), unencrypted.
|
||||||
|
- **IMAPS (993)**: Used for encrypted IMAP, securely managing mail (SSL/TLS method).
|
||||||
|
|
||||||
|
Specifically, if the current host machine is not being used as a mail server or not receiving electronic mail, then this project metric can be disregarded.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 日本語
|
||||||
|
|
||||||
|
### **システム基本情報**
|
||||||
|
|
||||||
|
CPU型番: 簡単に言えば、CPUの発売時期によって、新しいモデルならAMDがIntelより優れ、古いモデルならIntelがAMDより優れています。
|
||||||
|
|
||||||
|
CPUコア数: 物理コアか論理コアかを検出し、優先的に物理コアを表示します。物理コアが検出できない場合のみ論理コアを表示します。サーバーの実際の使用では、プログラムは通常、論理コアに基づいて実行されます。ビデオエンコードや科学計算以外では、物理コアは通常ハイパースレッディングを有効にして論理コアとして使用されます。比較する際は、同じタイプのコア数を比較することが意味を持ちます。
|
||||||
|
|
||||||
|
CPUキャッシュ:ホストマシンのCPU L1/L2/L3キャッシュ情報を表示します。
|
||||||
|
|
||||||
|
AES-NI: 暗号化/復号化を高速化する命令セットです。これがあれば通常のネットワークリクエストがより速く、パフォーマンスが高くなります。ない場合はネットワークリクエスト(プロキシ用途を含む)に影響します。
|
||||||
|
|
||||||
|
VM-x/AMD-V/Hyper-V: 現在のテスト環境がネステッド仮想化をサポートしているかどうかを示す指標です。テスト環境がDockerコンテナ内にあるか、root権限がない場合、デフォルトでは検出できず、ネステッド仮想化をサポートしていないと表示されます。この指標は、ホストマシン上で仮想マシン(KVM、VirtualBox、VMwareなど)を設定する必要がある場合に役立ちますが、他の用途ではあまり重要ではありません。
|
||||||
|
|
||||||
|
メモリ: 使用中サイズ/総サイズ のメモリを表示します。仮想メモリは含まれません。
|
||||||
|
|
||||||
|
バルーンドライバ: ホストマシンがバルーンドライバを使用しているかどうかを表示します。使用している場合は、親マシンがメモリを共有していることを示し、以下のメモリ読み書きテストと合わせて、オーバーセリング/厳しい制限があるかどうかを確認する必要があります。
|
||||||
|
|
||||||
|
Kernel Same-page Merging: ホストマシンがKSMメモリマージを使用しているかどうかを表示します。使用している場合は、親マシンがメモリを共有していることを示し、以下のメモリ読み書きテストと合わせて、オーバーセリング/厳しい制限があるかどうかを確認する必要があります。
|
||||||
|
|
||||||
|
仮想メモリ: SWAP仮想メモリを表示します
|
||||||
|
|
||||||
|
ディスク容量: 使用中サイズ/総サイズ のディスク容量を表示します
|
||||||
|
|
||||||
|
ブートディスクパス:ブートディスクのパスを表示します
|
||||||
|
|
||||||
|
OS: システム名とアーキテクチャを表示します
|
||||||
|
|
||||||
|
カーネル: システムカーネルバージョンを表示します
|
||||||
|
|
||||||
|
システム稼働時間: ホストマシンが起動してからテスト時までの稼働時間を表示します
|
||||||
|
|
||||||
|
タイムゾーン: ホストマシンのシステムタイムゾーンを表示します
|
||||||
|
|
||||||
|
負荷: システム負荷を表示します
|
||||||
|
|
||||||
|
仮想化アーキテクチャ: ホストマシンがどの仮想化アーキテクチャから来ているかを表示します。一般的に ```Dedicated > KVM > Xen``` 仮想化が推奨されます。他の仮想化はパフォーマンス低下を引き起こし、使用時にパフォーマンス共有/損失が発生しますが、これも確実ではありません。専用サーバーのみが完全に独立したリソース占有を持ち、他の仮想化はほとんどリソース共有があります。これはホストマシンの販売者が良心的かどうかによって異なります。具体的なパフォーマンスの優劣は、後の専門テストを見る必要があります。
|
||||||
|
|
||||||
|
NAT種類: NAT種類を表示します。具体的には ```Full Cone > Restricted Cone > Port Restricted Cone > Symmetric``` が推奨されます。検出できない場合は ```Inconclusive``` と表示されます。一般的に特別な用途(特殊なプロキシとリアルタイム通信の要件に関連する)に使用しない限り、この指標を気にする必要はありません。
|
||||||
|
|
||||||
|
TCP加速方式:一般的に ```cubic/bbr``` 輻輳制御プロトコルです。一般的にプロキシサーバーとして使用する場合、bbrを使用するとネットワーク速度が改善されますが、通常の用途ではこの指標に注目する必要はありません。
|
||||||
|
|
||||||
|
IPV4/IPV6 ASN: ホストマシンのIPが属するASN組織IDと名前を表示します。同じIDCに複数のASNがある可能性があり、1つのASNの下に異なるIPセグメントのサーバーを販売する複数の業者がいる可能性があります。具体的な上流/下流関係は複雑です。bgp.toolを使用してさらに詳しく調べることができます。
|
||||||
|
|
||||||
|
IPV4/IPV6 ロケーション: データベース内の対応するプロトコルのIPの地理的位置を表示します。
|
||||||
|
|
||||||
|
IPV4 アクティブIP: bgp.tools情報に基づいて、現在のCIDRチャンクのアクティブなネイバー数/総ネイバー数を照会する。
|
||||||
|
|
||||||
|
### **CPUテスト**
|
||||||
|
|
||||||
|
コマンドラインパラメータを通じて```GeekBench```と```Sysbench```のテストを選択できます:
|
||||||
|
|
||||||
|
| 比較項目 | sysbench | geekbench |
|
||||||
|
|------------------|----------|-----------|
|
||||||
|
| 適用範囲 | 軽量、ほぼすべてのサーバーで実行可能 | 重量級、小型マシンでは実行不可 |
|
||||||
|
| テスト要件 | ネットワーク不要、特別なハードウェア要件なし | ネットワーク必要、IPV4環境、最低1Gメモリ |
|
||||||
|
| オープンソース状況 | LUAベース、オープンソース、各アーキテクチャ版をコンパイル可能(本プロジェクトではGoに再構築して内蔵) | 公式バイナリはクローズドソース、自己コンパイル不可 |
|
||||||
|
| テスト安定性 | コアテストコンポーネントは10年以上変更なし | 各メジャーバージョンでテスト項目更新、スコアはバージョン間で比較困難(各バージョンは当時最高のCPUを基準) |
|
||||||
|
| テスト内容 | 計算性能のみテスト、素数計算ベース | 多様な性能テストカバー、スコアは重み付け計算、一部テストは実際にはあまり使用されない |
|
||||||
|
| 適用シーン | 迅速なテストに適合、計算性能のみテスト | 総合的な全面テストに適合 |
|
||||||
|
|
||||||
|
デフォルトでは```Sysbench```を使用してテストを行います。基準は概ね以下の通りです:
|
||||||
|
|
||||||
|
CPUテストのシングルコア```Sysbench```スコアが5000以上なら第一ティア、4000〜5000点なら第二ティア、1000点ごとに大体一ランクと考えられます。
|
||||||
|
|
||||||
|
AMDの7950xシングルコアのフルパフォーマンススコアは約6500、AMDの5950xシングルコアのフルパフォーマンススコアは約5700、Intelの通常のCPU(E5など)は約1000〜800、500未満のシングルコアCPUはパフォーマンスが比較的低いと言えます。
|
||||||
|
|
||||||
|
時々、マルチコアスコアとシングルコアスコアが同じ場合があります。これは販売者がプログラムの並列CPU使用を制限していることを示しています。典型的な例はTencent Cloudです。
|
||||||
|
|
||||||
|
Sysbenchのベンチマークは[CPU Performance Ladder For Sysbench](https://sysbench.spiritlhl.net/)のラダーチャートで見ることができる。
|
||||||
|
|
||||||
|
```GeekBench```の基準は[公式ウェブサイト](https://browser.geekbench.com/processor-benchmarks/)の階層チャートを参照してください。具体的なスコアは各```GeekBench```バージョンで異なるため、テスト時の```GeekBench```バージョンに注意してください。
|
||||||
|
|
||||||
|
補足ですが、```GeekBench```がテストする多くの内容は、サーバー使用過程で実際には必要ないことが多いです。テストは参考程度にしてください。もちろん```Sysbench```は非常に包括的ではありませんが、基本的な計算性能に基づいてCPUのパフォーマンスを大まかに比較できます。
|
||||||
|
|
||||||
|
実際にはCPUパフォーマンスは十分であれば良く、科学計算やビデオエンコード以外では、特に高性能CPUを追求する必要はありません。
|
||||||
|
|
||||||
|
### **メモリテスト**
|
||||||
|
|
||||||
|
一般的に、IO速度が```10240MB/s```未満かどうかを判断するだけで十分です。この値を下回る場合、メモリパフォーマンスが良くなく、オーバーセリング/オーバーコミットの問題がある可能性が非常に高いです。
|
||||||
|
|
||||||
|
オーバーコミットの原因は、仮想メモリの使用(ディスクをメモリとして使用)、ZRAM(CPUパフォーマンスを犠牲)、バルーンドライバの使用、KSMメモリマージの使用など、様々な可能性があります。
|
||||||
|
|
||||||
|
### **ディスクテスト**
|
||||||
|
|
||||||
|
```dd```テストは誤差が大きい可能性がありますが、テスト速度が速くディスクサイズ制限がありません。```fio```テストはより現実的ですが、テスト速度が遅く、ディスクおよびメモリサイズの最低要件があります。
|
||||||
|
|
||||||
|
同時に、サーバーには異なるファイルシステムがある可能性があり、特定のファイルシステムのIOエンジンは同じハードウェア条件下でも読み書き速度が速くなる場合があります。これは正常です。プロジェクトはデフォルトで```fio```を使用してテストを行います。テストに使用されるIOエンジンの優先順位は```libaio > posixaio > psync```です。代替オプションの```dd```テストは```fio```テストが利用できない場合に自動的に置き換えられます。
|
||||||
|
|
||||||
|
```fio```テスト結果を例に基準は以下の通りです:
|
||||||
|
|
||||||
|
| OSタイプ | 主要指標 | 副次指標 |
|
||||||
|
|---------|-------------------|---------------------|
|
||||||
|
| Windows/Mac | 4K読み → 64K読み → 書き込みテスト | グラフィカルインターフェースシステムは読み取りパフォーマンスを優先 |
|
||||||
|
| Linux (GUIなし) | 4K読み + 4K書き + 1M読み書き| 読み/書き値は通常類似 |
|
||||||
|
|
||||||
|
以下のディスクタイプの指標値は、通常〜フルパフォーマンス状態を示し、```libaio```をIOテストエンジンとして使用し、```Linux```でテストを実施した場合を指します:
|
||||||
|
|
||||||
|
| ドライブタイプ | 4K(IOPS)パフォーマンス | 1M(IOPS)パフォーマンス |
|
||||||
|
|------------|--------------------------|----------------------|
|
||||||
|
| NVMe SSD | ≥ 200 MB/s | 5-10 GB/s |
|
||||||
|
| 標準SSD | 50-100 MB/s | 2-3 GB/s |
|
||||||
|
| HDD (機械式ハードディスク) | 10-40 MB/s | 500-600 MB/s |
|
||||||
|
| 性能不良 | < 10 MB/s | < 200 MB/s |
|
||||||
|
|
||||||
|
迅速な評価:
|
||||||
|
|
||||||
|
1. **主要チェック**: 4K読み(IOPS) 4K書き(IOPS)
|
||||||
|
- ほぼ同じで大きな差がない
|
||||||
|
- ≥ 200 MB/s = NVMe SSD
|
||||||
|
- 50-100 MB/s = 標準SSD
|
||||||
|
- 10-40 MB/s = HDD (機械式ハードディスク)
|
||||||
|
- < 10 MB/s = 性能不良、オーバーセリング/制限が深刻
|
||||||
|
|
||||||
|
2. **副次チェック**: 1M合計(IOPS)
|
||||||
|
- プロバイダが設定したIO制限
|
||||||
|
- リソースのオーバーコミット状況
|
||||||
|
- 値が高いほど良い
|
||||||
|
- NVMe SSDは通常4-6 GB/s達成
|
||||||
|
- 標準SSDは通常1-2 GB/s達成
|
||||||
|
|
||||||
|
NVMe SSDの1M(IOPS)値が< 1GB/sの場合、深刻なリソースオーバーコミットが存在することを示します。
|
||||||
|
|
||||||
|
注意:ここでテストされるのは実際のIOであり、本プロジェクトに限定されます。本プロジェクト以外のテストによるIOは基準の普遍性を保証できません。他のテストでは同じパラメータを使用していない可能性があり、IO直接読み書きを設定していない可能性、IOエンジンの設定が一致しない可能性、テスト時間の設定が一致しない可能性があり、これらはすべて基準にズレを生じさせる原因となります。
|
||||||
|
|
||||||
|
### **ストリーミングメディアロック解除**
|
||||||
|
|
||||||
|
一般的なストリーミングメディアプラットフォームのロック解除を検索します。もちろん、すべてがストリーミングメディアというわけではなく、他の一般的なプラットフォームのロック解除も含まれています。一般的に、IPのロック解除地域は一貫しており、あちこちに変動することはありません。複数のプラットフォームでロック解除地域が一致しない場合、そのIPはIPXOなどのプラットフォームからレンタルされている可能性が高く、各プラットフォームのデータベース識別が遅いため、IP品質も一般的に良くないと考えられます。
|
||||||
|
|
||||||
|
### **IP品質検出**
|
||||||
|
|
||||||
|
14のデータベースのIP関連情報を検出します。一般的に、使用タイプ、会社タイプ、およびその他のセキュリティ情報の判別を見るだけで十分です。セキュリティスコアは参考程度です。複数のプラットフォームで対応する検出項目が一致している場合、現在のIPが確かにそうであることを証明しています。単一のデータベースソースの情報だけを信頼しないでください。
|
||||||
|
|
||||||
|
### **メールポート検出**
|
||||||
|
|
||||||
|
- **SMTP(25)**:メールサーバー間でメールを転送するために使用されます(メール送信)。
|
||||||
|
- **SMTPS(465)**:暗号化されたSMTPメール送信(SSL/TLS方式)に使用されます。
|
||||||
|
- **SMTP(587)**:クライアントからメールサーバーへのメール送信に使用され、STARTTLS暗号化をサポートします。
|
||||||
|
- **POP3(110)**:メールクライアントがサーバーからメールをダウンロードするために使用され、暗号化されていません。
|
||||||
|
- **POP3S(995)**:暗号化されたPOP3用で、安全にメールをダウンロードします(SSL/TLS方式)。
|
||||||
|
- **IMAP(143)**:メールクライアントがオンラインでメールを管理するために使用されます(メールの閲覧、同期)、暗号化されていません。
|
||||||
|
- **IMAPS(993)**:暗号化されたIMAP用で、安全にメールを管理します(SSL/TLS方式)。
|
||||||
|
|
||||||
|
具体的に現在のホストマシンがメールサーバーとして使用されていない、または電子メールを受信しない場合、この項目の指標は気にする必要はありません。
|
||||||
|
|
||||||
|
---
|
@@ -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
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
||||||
}
|
}
|
||||||
|
@@ -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
|
switch testMethod {
|
||||||
if runtime.GOOS == "windows" {
|
case "fio":
|
||||||
if testMethod != "winsat" && testMethod != "" {
|
res = disk.FioTest(language, isMultiCheck, testPath)
|
||||||
res = "Detected host is Windows, using Winsat for testing.\n"
|
if res == "" && autoChange {
|
||||||
|
res += disk.DDTest(language, isMultiCheck, testPath)
|
||||||
|
realTestMethod = "dd"
|
||||||
|
} else {
|
||||||
|
realTestMethod = "fio"
|
||||||
}
|
}
|
||||||
res = disk.WinsatTest(language, isMultiCheck, testPath)
|
case "dd":
|
||||||
} else {
|
res = disk.DDTest(language, isMultiCheck, testPath)
|
||||||
switch testMethod {
|
if res == "" && autoChange {
|
||||||
case "fio":
|
res += disk.FioTest(language, isMultiCheck, testPath)
|
||||||
res = disk.FioTest(language, isMultiCheck, testPath)
|
realTestMethod = "fio"
|
||||||
if res == "" && autoChange {
|
} else {
|
||||||
res = "Fio test failed, switching to DD for testing.\n"
|
realTestMethod = "dd"
|
||||||
res += disk.DDTest(language, isMultiCheck, testPath)
|
}
|
||||||
}
|
default:
|
||||||
case "dd":
|
if runtime.GOOS == "windows" {
|
||||||
|
realTestMethod = "winsat"
|
||||||
|
res = disk.WinsatTest(language, isMultiCheck, testPath)
|
||||||
|
} else {
|
||||||
res = disk.DDTest(language, isMultiCheck, testPath)
|
res = disk.DDTest(language, isMultiCheck, testPath)
|
||||||
if res == "" && autoChange {
|
realTestMethod = "dd"
|
||||||
res = "DD test failed, switching to Fio for testing.\n"
|
|
||||||
res += disk.FioTest(language, isMultiCheck, testPath)
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
res = "Unsupported test method specified.\n"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//fmt.Println("--------------------------------------------------")
|
|
||||||
if !strings.Contains(res, "\n") && res != "" {
|
if !strings.Contains(res, "\n") && res != "" {
|
||||||
res += "\n"
|
res += "\n"
|
||||||
}
|
}
|
||||||
fmt.Printf(res)
|
return
|
||||||
//fmt.Println("--------------------------------------------------")
|
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
_, res := DiskTest("zh", "sysbench", "", false, false)
|
||||||
|
fmt.Print(res)
|
||||||
}
|
}
|
||||||
|
119
go.mod
119
go.mod
@@ -1,67 +1,68 @@
|
|||||||
module github.com/oneclickvirt/ecs
|
module github.com/oneclickvirt/ecs
|
||||||
|
|
||||||
go 1.22.4
|
go 1.24.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/imroc/req/v3 v3.43.7
|
github.com/imroc/req/v3 v3.54.0
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207
|
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722
|
github.com/oneclickvirt/backtrace v0.0.7-20250811023541
|
||||||
github.com/oneclickvirt/basics v0.0.7-20240729065559
|
github.com/oneclickvirt/basics v0.0.15-20250805084236
|
||||||
github.com/oneclickvirt/cputest v0.0.8-20240702070215
|
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.4-20240704095213
|
github.com/oneclickvirt/disktest v0.0.10-20250808140407
|
||||||
github.com/oneclickvirt/gostun v0.0.3-20240702054621
|
github.com/oneclickvirt/gostun v0.0.5-20250727155022
|
||||||
github.com/oneclickvirt/memorytest v0.0.2-20240702031042
|
github.com/oneclickvirt/memorytest v0.0.9-20250808065154
|
||||||
github.com/oneclickvirt/nt3 v0.0.3-20240702132013
|
github.com/oneclickvirt/nt3 v0.0.8-20250810151538
|
||||||
github.com/oneclickvirt/pingtest v0.0.4-20240703142340
|
github.com/oneclickvirt/pingtest v0.0.8-20250728015259
|
||||||
github.com/oneclickvirt/portchecker v0.0.1-20240624155429
|
github.com/oneclickvirt/portchecker v0.0.3-20250728015900
|
||||||
github.com/oneclickvirt/security v0.0.4-20240729032307
|
github.com/oneclickvirt/security v0.0.6-20250805090112
|
||||||
github.com/oneclickvirt/speedtest v0.0.7-20240704023701
|
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.0 // 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.3.9 // indirect
|
github.com/cloudflare/circl v1.6.1 // indirect
|
||||||
github.com/fatih/color v1.17.0 // indirect
|
github.com/ebitengine/purego v0.8.4 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fatih/color v1.18.0 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
github.com/fsnotify/fsnotify v1.9.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/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-20240625030939-27f56978b8b0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/gorilla/websocket v1.5.1 // 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/hashicorp/hcl v1.0.0 // 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.9 // 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
|
||||||
github.com/lionsoul2014/ip2region v2.11.2+incompatible // indirect
|
github.com/lionsoul2014/ip2region v2.11.2+incompatible // indirect
|
||||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||||
github.com/magiconair/properties v1.8.7 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||||
|
github.com/miekg/dns v1.1.61 // indirect
|
||||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.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.3.1 // indirect
|
github.com/nxtrace/NTrace-core v1.4.2 // indirect
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
|
github.com/oneclickvirt/dd v0.0.2-20250808062818 // indirect
|
||||||
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
|
github.com/oneclickvirt/fio v0.0.2-20250808045755 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
github.com/oneclickvirt/mbw v0.0.1-20250808061222 // indirect
|
||||||
|
github.com/oschwald/maxminddb-golang v1.13.1 // 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
|
||||||
github.com/pion/logging v0.2.2 // indirect
|
github.com/pion/logging v0.2.2 // indirect
|
||||||
github.com/pion/stun/v2 v2.0.0 // indirect
|
github.com/pion/stun/v2 v2.0.0 // indirect
|
||||||
@@ -69,45 +70,41 @@ require (
|
|||||||
github.com/pion/transport/v3 v3.0.1 // indirect
|
github.com/pion/transport/v3 v3.0.1 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||||
github.com/quic-go/qpack v0.4.0 // indirect
|
github.com/prometheus-community/pro-bing v0.4.1 // indirect
|
||||||
github.com/quic-go/quic-go v0.45.1 // indirect
|
github.com/quic-go/qpack v0.5.1 // indirect
|
||||||
github.com/refraction-networking/utls v1.6.6 // indirect
|
github.com/quic-go/quic-go v0.53.0 // 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.2.0 // indirect
|
github.com/rodaine/table v1.3.0 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
github.com/sagikazarmark/locafero v0.9.0 // indirect
|
||||||
github.com/sagikazarmark/slog-shim v0.1.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.11.0 // indirect
|
github.com/spf13/afero v1.14.0 // indirect
|
||||||
github.com/spf13/cast v1.6.0 // indirect
|
github.com/spf13/cast v1.9.2 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.7 // indirect
|
||||||
github.com/spf13/viper v1.18.2 // 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.17.1 // indirect
|
github.com/tidwall/gjson v1.18.0 // indirect
|
||||||
github.com/tidwall/match v1.1.1 // indirect
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
github.com/tidwall/pretty v1.2.1 // indirect
|
github.com/tidwall/pretty v1.2.1 // indirect
|
||||||
github.com/tklauser/go-sysconf v0.3.14 // indirect
|
github.com/tklauser/go-sysconf v0.3.14 // indirect
|
||||||
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.4.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.24.0 // indirect
|
golang.org/x/crypto v0.40.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
|
golang.org/x/mod v0.25.0 // indirect
|
||||||
golang.org/x/mod v0.18.0 // indirect
|
golang.org/x/net v0.42.0 // indirect
|
||||||
golang.org/x/net v0.26.0 // indirect
|
golang.org/x/sync v0.16.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sys v0.34.0 // indirect
|
||||||
golang.org/x/sys v0.21.0 // indirect
|
golang.org/x/term v0.33.0 // indirect
|
||||||
golang.org/x/term v0.21.0 // indirect
|
golang.org/x/text v0.27.0 // indirect
|
||||||
golang.org/x/text v0.16.0 // indirect
|
golang.org/x/tools v0.34.0 // indirect
|
||||||
golang.org/x/tools v0.22.0 // indirect
|
|
||||||
gopkg.in/ini.v1 v1.67.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
|
||||||
)
|
)
|
||||||
|
256
go.sum
256
go.sum
@@ -2,66 +2,65 @@ 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.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
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.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
|
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
|
||||||
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
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/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
|
github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw=
|
||||||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
|
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/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.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
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.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
|
||||||
github.com/go-logr/logr v1.4.1/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/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-20240625030939-27f56978b8b0 h1:e+8XbKB6IMn8A4OAyZccO4pYfB3s7bt6azNIPE7AnPg=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||||
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/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
|
||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
|
||||||
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.43.7 h1:dOcNb9n0X83N5/5/AOkiU+cLhzx8QFXjv5MhikazzQA=
|
github.com/icholy/digest v1.1.0 h1:HfGg9Irj7i+IX1o1QAmPfIBNu/Q5A5Tu3n/MED9k9H4=
|
||||||
github.com/imroc/req/v3 v3.43.7/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA=
|
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.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
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=
|
||||||
@@ -76,64 +75,63 @@ github.com/lionsoul2014/ip2region v2.11.2+incompatible h1:+VRsGcrHz8ewXI/2UzTptJ
|
|||||||
github.com/lionsoul2014/ip2region v2.11.2+incompatible/go.mod h1:+ZBN7PBoh5gG6/y0ZQ85vJDBe21WnfbRrQQwTfliJJI=
|
github.com/lionsoul2014/ip2region v2.11.2+incompatible/go.mod h1:+ZBN7PBoh5gG6/y0ZQ85vJDBe21WnfbRrQQwTfliJJI=
|
||||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
|
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
|
||||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
|
||||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
|
||||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
|
||||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
|
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||||
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
|
github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs=
|
||||||
|
github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ=
|
||||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
|
||||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
|
||||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
|
||||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
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.3.1 h1:f4z5UaZEuhUP/g6xElpZ2bo+guWITJVrMKrJTqd27oc=
|
github.com/nxtrace/NTrace-core v1.4.2 h1:dSRP18Bn3VGf5CZBzKt8gQWW9mDkq62Np9TCF9RAtp0=
|
||||||
github.com/nxtrace/NTrace-core v1.3.1/go.mod h1:0Px/Zc60qk6cssmP+yv4kstFxvX9sXqDduoVqBO+qf8=
|
github.com/nxtrace/NTrace-core v1.4.2/go.mod h1:wIDOlccuYzY3wBqU89pv2KGHT41i3JA0eRqJU/x9eX4=
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502 h1:hRIYJ2uEp2N3AH5bP5X6bwfdwWfZQO/2WoqpUJ8+WsY=
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRAKnnZYALmpBKvvuVaq34MEsuWwk6nc=
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207 h1:pe9RKF/8QxNaxwyzLH+6HC+lkJdBUjQd1HV9FVULoEA=
|
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204 h1:apFaEbHGKflYMZzK17nXzEai4GG873mTd+d9hCO/KdY=
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.13-20240726021207/go.mod h1:HP3CvAS+AJWxxY+BVbxIOlvaQ87YOSge89vAMG52b5o=
|
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE=
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722 h1:UJ/VWf+ZbhGarc9HcHMIyenpmX+b2LxkXu0hlLk3Gxs=
|
github.com/oneclickvirt/backtrace v0.0.7-20250811023541 h1:GzkzvUC6U9b6Dkz/Bl4JRPeQ7XBGoW7Qw1aWqzhF+MQ=
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8=
|
github.com/oneclickvirt/backtrace v0.0.7-20250811023541/go.mod h1:/+KUtOWz48TyiTTbhVTsp3D6b5WY+4pCgvFBYtUGtns=
|
||||||
github.com/oneclickvirt/basics v0.0.7-20240729065559 h1:BNMPuW+ZT9RqqIjEQJ+r+lRX6iESnhmOE6dVWEd5Jqg=
|
github.com/oneclickvirt/basics v0.0.15-20250805084236 h1:guYO6wGooSIOAIutuy/zfJ4sXj525nBITw8cjEPRaK8=
|
||||||
github.com/oneclickvirt/basics v0.0.7-20240729065559/go.mod h1:fUdVpU8gdjaZsTCyqnQBAbHc9BbbN8Fxr3sGPKooUpU=
|
github.com/oneclickvirt/basics v0.0.15-20250805084236/go.mod h1:2PV+1ge01zb0Sqzj2V2I7P0wAdFSLF1XgAiumchJJbg=
|
||||||
github.com/oneclickvirt/cputest v0.0.8-20240702070215 h1:CcFpyVPlQkJ6vjFP17BRuJhh/afiJhOhZ0BW+TtfVDg=
|
github.com/oneclickvirt/cputest v0.0.12-20250720122317 h1:toiwAK1hZE5b8klu2mOQ7J4sv5yV9lpPKwgPahfRYBQ=
|
||||||
github.com/oneclickvirt/cputest v0.0.8-20240702070215/go.mod h1:MmaHN9+XMntI3rLycwj8Ne31fG18IfNoa8N2utDK1CY=
|
github.com/oneclickvirt/cputest v0.0.12-20250720122317/go.mod h1:vjlH8tkPFft1tlLOpeNskXVvurxkHaJ3+dgFxQGLXY4=
|
||||||
|
github.com/oneclickvirt/dd v0.0.2-20250808062818 h1:0KHrKkdpL5oBE1OHsrRd2siRw4/2k6f9LBaP7T4JpOc=
|
||||||
|
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.4-20240704095213 h1:ATIc0VeFBnYvfKjJCtDZS6hTxTU9nTFvUmfzGkr6Clw=
|
github.com/oneclickvirt/disktest v0.0.10-20250808140407 h1:oUfi5zF3htUTB1ZJuClmK0o74ufP7icbu8LYCnxEOxE=
|
||||||
github.com/oneclickvirt/disktest v0.0.4-20240704095213/go.mod h1:wIZy8G6Mbcy8Op8tc0HmJNpbJQQ5A15fvnUqMJXIdO0=
|
github.com/oneclickvirt/disktest v0.0.10-20250808140407/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8=
|
||||||
github.com/oneclickvirt/gostun v0.0.3-20240702054621 h1:IE89eEYV9TJbF94SakQDAxTLIaqX+Tb6ZhJ/CCIP+90=
|
github.com/oneclickvirt/fio v0.0.2-20250808045755 h1:eWihCRWcalJjPIdrF8dMe68ZiPnMkSfHC8ENvElp/xE=
|
||||||
github.com/oneclickvirt/gostun v0.0.3-20240702054621/go.mod h1:f7DPEXAxbmwXSW33dbxtb0/KzqvOBWhTs2Or5xBerQA=
|
github.com/oneclickvirt/fio v0.0.2-20250808045755/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE=
|
||||||
github.com/oneclickvirt/memorytest v0.0.2-20240702031042 h1:j+LsjOh5glYiidqtSqjZJRw694LYW1PHLMh6AovluTQ=
|
github.com/oneclickvirt/gostun v0.0.5-20250727155022 h1:/e3gSUrOp1tg/1NTRx+P8B51OGcP26Q6//5EoSIjOvk=
|
||||||
github.com/oneclickvirt/memorytest v0.0.2-20240702031042/go.mod h1:+YNzy+NeVg61d0kNwSyVDqHyVtKzjuRe1NvMzsDLg0I=
|
github.com/oneclickvirt/gostun v0.0.5-20250727155022/go.mod h1:pfp7MFZJK9n/KTLAVqqFcCAns4xqMykmjI+1UeF/vdE=
|
||||||
github.com/oneclickvirt/nt3 v0.0.3-20240702132013 h1:zPI/zqqCraIVwRnYz07hMkBKDRJVkEBb6gZpZ4M9CjI=
|
github.com/oneclickvirt/mbw v0.0.1-20250808061222 h1:WGXOe6QvHiDRhPVMI0VcctjzW08kGvJf50yq5YeZCtw=
|
||||||
github.com/oneclickvirt/nt3 v0.0.3-20240702132013/go.mod h1:UojPmtangn17TiQaDccVrZbn6sZwJOtzBgg3idp68cA=
|
github.com/oneclickvirt/mbw v0.0.1-20250808061222/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
|
||||||
github.com/oneclickvirt/pingtest v0.0.4-20240703142340 h1:012W8Ly6ALISwIL5cYFM8O1ZLSc9l+Z2hHUCscMemms=
|
github.com/oneclickvirt/memorytest v0.0.9-20250808065154 h1:mjYOvpFz2mpDU9MNjj66oIDcc2r6+zoW8veP616/+4Q=
|
||||||
github.com/oneclickvirt/pingtest v0.0.4-20240703142340/go.mod h1:IU9RzZpS5tfP2kcFd2sw2fE80BgtiMUK8jp6qnN/0cY=
|
github.com/oneclickvirt/memorytest v0.0.9-20250808065154/go.mod h1:DBxiVZX7mWCe0Fy+qu57ENheLo00sLfjKzvxiICrUtU=
|
||||||
github.com/oneclickvirt/portchecker v0.0.1-20240624155429 h1:+wapaOcFrg1iWJDhBKThDzppyIMY7hWxK7F5RBkZg4o=
|
github.com/oneclickvirt/nt3 v0.0.8-20250810151538 h1:pXxtvTwTFWAh/+Hz89wDat42CFjqNdlFyASPRxSdE5g=
|
||||||
github.com/oneclickvirt/portchecker v0.0.1-20240624155429/go.mod h1:HQxSTrqM8/QFqHMTBZ7S8H9eEO5FkUXU1eb7ZX5Mk+k=
|
github.com/oneclickvirt/nt3 v0.0.8-20250810151538/go.mod h1:F1v+6xInBKnbUa8gV1M40R1HOzxg+obtduNhx3CTnmA=
|
||||||
github.com/oneclickvirt/security v0.0.4-20240729032307 h1:SUzrOdJdYpgAxKJq5xNUsx8ItKxOtxKMraeBSXnKKsk=
|
github.com/oneclickvirt/pingtest v0.0.8-20250728015259 h1:egoxZRZBOWN3JqBwqEsULDyRo2/dpGMeWcmV3U87zig=
|
||||||
github.com/oneclickvirt/security v0.0.4-20240729032307/go.mod h1:81GsT55EJEeMLh4YtdOMavZv7O9+qFy2ko+HaYRIYiM=
|
github.com/oneclickvirt/pingtest v0.0.8-20250728015259/go.mod h1:gxwsxxwitNQiGq2OI0ZogYoOLwc8DtuOdSRe6/EvRqs=
|
||||||
github.com/oneclickvirt/speedtest v0.0.7-20240704023701 h1:F8ChZXf3U1/bUk+dCFt0Gc01LSPLhbBhCeHjkEJ6K88=
|
github.com/oneclickvirt/portchecker v0.0.3-20250728015900 h1:AomzdppSOFB70AJESQhlp0IPbsHTTJGimAWDk2TzCWM=
|
||||||
github.com/oneclickvirt/speedtest v0.0.7-20240704023701/go.mod h1:zd5ZgIGslmtQLQehEfRjyumlvgDHTpCSMchKfKXoASI=
|
github.com/oneclickvirt/portchecker v0.0.3-20250728015900/go.mod h1:9sjMDPCd4Z40wkYB0S9gQPGH8YPtnNE1ZJthVIuHUzA=
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
|
github.com/oneclickvirt/security v0.0.6-20250805090112 h1:lUNtsnpZ3JNLS4xxjFGGECaxA46yNyxbYjdust9W0M4=
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
|
github.com/oneclickvirt/security v0.0.6-20250805090112/go.mod h1:JB6SJWm5pbrngCgSTYLd2m4Hj8mHO6mJua1WgHMZOcE=
|
||||||
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
|
github.com/oneclickvirt/speedtest v0.0.10-20250728015734 h1:HKO7/JQ74ueXA8Wo8NIvcK9DphbEG/YTfAAVz/akSiY=
|
||||||
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
|
github.com/oneclickvirt/speedtest v0.0.10-20250728015734/go.mod h1:0W8vnMbA3iucXLXFdGfe9Ia6RPS0izRO7jvu/SnH1P8=
|
||||||
github.com/oschwald/maxminddb-golang v1.12.0 h1:9FnTOD0YOhP7DGxGsq4glzpGy5+w7pq50AS6wALUMYs=
|
github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE=
|
||||||
github.com/oschwald/maxminddb-golang v1.12.0/go.mod h1:q0Nob5lTCqyQ8WT6FYgS1L7PXKVVbgiymefNwIjPzgY=
|
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
|
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||||
github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8=
|
github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8=
|
||||||
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
|
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
|
||||||
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
||||||
@@ -151,45 +149,41 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
|
|||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
|
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
|
||||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
|
||||||
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
|
github.com/prometheus-community/pro-bing v0.4.1 h1:aMaJwyifHZO0y+h8+icUz0xbToHbia0wdmzdVZ+Kl3w=
|
||||||
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
github.com/prometheus-community/pro-bing v0.4.1/go.mod h1:aLsw+zqCaDoa2RLVVSX3+UiCkBBXTMtZC3c7EkfWnAE=
|
||||||
github.com/quic-go/quic-go v0.45.1 h1:tPfeYCk+uZHjmDRwHHQmvHRYL2t44ROTujLeFVBmjCA=
|
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||||
github.com/quic-go/quic-go v0.45.1/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI=
|
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||||
github.com/refraction-networking/utls v1.6.6 h1:igFsYBUJPYM8Rno9xUuDoM5GQrVEqY4llzEXOkL43Ig=
|
github.com/quic-go/quic-go v0.53.0 h1:QHX46sISpG2S03dPeZBgVIZp8dGagIaiu2FiVYvpCZI=
|
||||||
github.com/refraction-networking/utls v1.6.6/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
github.com/quic-go/quic-go v0.53.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
|
||||||
|
github.com/refraction-networking/utls v1.7.3 h1:L0WRhHY7Oq1T0zkdzVZMR6zWZv+sXbHB9zcuvsAEqCo=
|
||||||
|
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=
|
||||||
github.com/rodaine/table v1.2.0 h1:38HEnwK4mKSHQJIkavVj+bst1TEY7j9zhLMWu4QJrMA=
|
github.com/rodaine/table v1.3.0 h1:4/3S3SVkHnVZX91EHFvAMV7K42AnJ0XuymRR2C5HlGE=
|
||||||
github.com/rodaine/table v1.2.0/go.mod h1:wejb/q/Yd4T/SVmBSRMr7GCq3KlcZp3gyNYdLSBhkaE=
|
github.com/rodaine/table v1.3.0/go.mod h1:47zRsHar4zw0jgxGxL9YtFfs7EGN6B/TaS+/Dmk4WxU=
|
||||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
|
github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k=
|
||||||
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
|
github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk=
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
|
||||||
github.com/schollz/progressbar/v3 v3.14.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9dEMrw0r74=
|
github.com/schollz/progressbar/v3 v3.14.4 h1:W9ZrDSJk7eqmQhd3uxFNNcTr0QL+xuGNI9dEMrw0r74=
|
||||||
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.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
|
||||||
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
|
||||||
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
|
||||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
|
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
|
||||||
github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
|
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=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
@@ -199,12 +193,13 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
|
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||||
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||||
github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U=
|
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
|
||||||
github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
@@ -216,13 +211,15 @@ github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYg
|
|||||||
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
|
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
|
||||||
github.com/tsosunchia/powclient v0.1.5 h1:hpixFWoPbWSEC0zc9osSltyjtr1+SnhCueZVLkEpyyU=
|
github.com/tsosunchia/powclient v0.1.5 h1:hpixFWoPbWSEC0zc9osSltyjtr1+SnhCueZVLkEpyyU=
|
||||||
github.com/tsosunchia/powclient v0.1.5/go.mod h1:yNlzyq+w9llYZV+0q7nrX83ULy4ghq2mCjpTLJFJ2pg=
|
github.com/tsosunchia/powclient v0.1.5/go.mod h1:yNlzyq+w9llYZV+0q7nrX83ULy4ghq2mCjpTLJFJ2pg=
|
||||||
|
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||||
|
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
||||||
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.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
|
||||||
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
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=
|
||||||
@@ -232,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.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
||||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
||||||
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY=
|
|
||||||
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI=
|
|
||||||
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.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
|
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
|
||||||
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
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=
|
||||||
@@ -250,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.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
||||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
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=
|
||||||
@@ -266,15 +261,14 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
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.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
||||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
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=
|
||||||
@@ -282,40 +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.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA=
|
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
|
||||||
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
|
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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
||||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
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.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
|
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||||
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
|
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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
|
||||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
|
||||||
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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
|
||||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
|
||||||
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=
|
||||||
|
630
goecs.sh
630
goecs.sh
@@ -1,21 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#From https://github.com/oneclickvirt/ecs
|
# From https://github.com/oneclickvirt/ecs
|
||||||
#2024.07.21
|
# 2025.06.29
|
||||||
|
|
||||||
# curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
# curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
|
# 或
|
||||||
|
# curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
|
||||||
|
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
GGGGGGGG OOOOOOO EEEEEEEE CCCCCCCCC SSSSSSSSSS
|
,ad8888ba, ,ad8888ba, 88888888888 ,ad8888ba, ad88888ba
|
||||||
GG GG OO OO EE CC SS
|
d8"' `"8b d8"' `"8b 88 d8"' `"8b d8" "8b
|
||||||
GG OO OO EE CC SS
|
d8' d8' `8b 88 d8' Y8a
|
||||||
GG OO OO EE CC SS
|
88 88 88 88aaaaa 88 `"Y8aaaaa,
|
||||||
GG OO OO EEEEEEEE CC SSSSSSSSSS
|
88 88888 88 88 88""""" 88 `"""""8b,
|
||||||
GG GGGGGG OO OO EE CC SS
|
Y8, 88 Y8, ,8P 88 Y8, `8b
|
||||||
GG GG OO OO EE CC SS
|
Y8a. .a88 Y8a. .a8P 88 Y8a. .a8P Y8a a8P
|
||||||
GG GG OO OO EE CC SS
|
`"Y88888P" `"Y8888Y"' 88888888888 `"Y8888Y"' "Y88888P"
|
||||||
GGGGGGGG OOOOOOO EEEEEEEE CCCCCCCCC SSSSSSSSSS
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cd /root >/dev/null 2>&1
|
cd /root >/dev/null 2>&1
|
||||||
if [ ! -d "/usr/bin/" ]; then
|
if [ ! -d "/usr/bin/" ]; then
|
||||||
mkdir -p "/usr/bin/"
|
mkdir -p "/usr/bin/"
|
||||||
@@ -24,6 +24,7 @@ _red() { echo -e "\033[31m\033[01m$@\033[0m"; }
|
|||||||
_green() { echo -e "\033[32m\033[01m$@\033[0m"; }
|
_green() { echo -e "\033[32m\033[01m$@\033[0m"; }
|
||||||
_yellow() { echo -e "\033[33m\033[01m$@\033[0m"; }
|
_yellow() { echo -e "\033[33m\033[01m$@\033[0m"; }
|
||||||
_blue() { echo -e "\033[36m\033[01m$@\033[0m"; }
|
_blue() { echo -e "\033[36m\033[01m$@\033[0m"; }
|
||||||
|
reading() { read -rp "$(_green "$1")" "$2"; }
|
||||||
|
|
||||||
check_cdn() {
|
check_cdn() {
|
||||||
local o_url=$1
|
local o_url=$1
|
||||||
@@ -40,116 +41,244 @@ check_cdn() {
|
|||||||
check_cdn_file() {
|
check_cdn_file() {
|
||||||
check_cdn "https://raw.githubusercontent.com/spiritLHLS/ecs/main/back/test"
|
check_cdn "https://raw.githubusercontent.com/spiritLHLS/ecs/main/back/test"
|
||||||
if [ -n "$cdn_success_url" ]; then
|
if [ -n "$cdn_success_url" ]; then
|
||||||
echo "CDN available, using CDN"
|
_green "CDN available, using CDN"
|
||||||
else
|
else
|
||||||
echo "No CDN available, no use CDN"
|
_yellow "No CDN available, no use CDN"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
download_file() {
|
||||||
|
local url="$1"
|
||||||
|
local output="$2"
|
||||||
|
if ! wget -O "$output" "$url"; then
|
||||||
|
_yellow "wget failed, trying curl..."
|
||||||
|
if ! curl -L -o "$output" "$url"; then
|
||||||
|
_red "Both wget and curl failed. Unable to download the file."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
check_china() {
|
||||||
|
_yellow "正在检测IP所在区域......"
|
||||||
|
if [[ -z "${CN}" ]]; then
|
||||||
|
# 首先尝试通过 ipapi.co 检测
|
||||||
|
if curl -m 6 -s https://ipapi.co/json | grep -q 'China'; then
|
||||||
|
_yellow "根据ipapi.co提供的信息,当前IP可能在中国"
|
||||||
|
if [ "$noninteractive" != "true" ]; then
|
||||||
|
reading "是否使用中国镜像完成安装? ([y]/n) " input
|
||||||
|
case $input in
|
||||||
|
[yY][eE][sS] | [yY] | "")
|
||||||
|
_green "已选择使用中国镜像"
|
||||||
|
CN=true
|
||||||
|
;;
|
||||||
|
[nN][oO] | [nN])
|
||||||
|
_yellow "已选择不使用中国镜像"
|
||||||
|
CN=false
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_green "已选择使用中国镜像"
|
||||||
|
CN=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
# 在非交互模式下默认不使用中国镜像
|
||||||
|
CN=false
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
CN=false
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_memory_size() {
|
||||||
|
if [ -f /proc/meminfo ]; then
|
||||||
|
local mem_kb=$(grep MemTotal /proc/meminfo | awk '{print $2}')
|
||||||
|
echo $((mem_kb / 1024)) # Convert to MB
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if command -v free >/dev/null 2>&1; then
|
||||||
|
local mem_kb=$(free -m | awk '/^Mem:/ {print $2}')
|
||||||
|
echo "$mem_kb" # Already in MB
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if command -v sysctl >/dev/null 2>&1; then
|
||||||
|
local mem_bytes=$(sysctl -n hw.memsize 2>/dev/null || sysctl -n hw.physmem 2>/dev/null)
|
||||||
|
if [ -n "$mem_bytes" ]; then
|
||||||
|
echo $((mem_bytes / 1024 / 1024)) # Convert to MB
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup_epel() {
|
||||||
|
_yellow "Cleaning up EPEL repositories..."
|
||||||
|
rm -f /etc/yum.repos.d/*epel*
|
||||||
|
yum clean all
|
||||||
|
}
|
||||||
|
|
||||||
goecs_check() {
|
goecs_check() {
|
||||||
os=$(uname -s)
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
arch=$(uname -m)
|
INSTALL_CMD="apt-get -y install"
|
||||||
ECS_VERSION=$(curl -m 6 -sSL "https://api.github.com/repos/oneclickvirt/ecs/releases/latest" | awk -F \" '/tag_name/{gsub(/^v/,"",$4); print $4}')
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
# 如果 https://api.github.com/ 请求失败,则使用 https://githubapi.spiritlhl.workers.dev/ ,此时可能宿主机无IPV4网络
|
INSTALL_CMD="yum -y install"
|
||||||
if [ -z "$ECS_VERSION" ]; then
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
ECS_VERSION=$(curl -m 6 -sSL "https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" | awk -F \" '/tag_name/{gsub(/^v/,"",$4); print $4}')
|
INSTALL_CMD="dnf -y install"
|
||||||
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
|
INSTALL_CMD="pacman -S --noconfirm"
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
INSTALL_CMD="apk add"
|
||||||
|
elif command -v zypper >/dev/null 2>&1; then
|
||||||
|
INSTALL_CMD="zypper install -y"
|
||||||
fi
|
fi
|
||||||
# 如果 https://githubapi.spiritlhl.workers.dev/ 请求失败,则使用 https://githubapi.spiritlhl.top/ ,此时可能宿主机在国内
|
if ! command -v unzip >/dev/null 2>&1; then
|
||||||
if [ -z "$ECS_VERSION" ]; then
|
_green "Installing unzip"
|
||||||
ECS_VERSION=$(curl -m 6 -sSL "https://githubapi.spiritlhl.top/repos/oneclickvirt/ecs/releases/latest" | awk -F \" '/tag_name/{gsub(/^v/,"",$4); print $4}')
|
${INSTALL_CMD} unzip
|
||||||
fi
|
fi
|
||||||
# 检测原始goecs命令是否存在,若存在则升级,不存在则安装
|
if ! command -v curl >/dev/null 2>&1; then
|
||||||
version_output=$(goecs -v command 2>/dev/null || ./goecs -v command 2>/dev/null)
|
_green "Installing curl"
|
||||||
if [ $? -eq 0 ]; then
|
${INSTALL_CMD} curl
|
||||||
|
fi
|
||||||
|
os=$(uname -s 2>/dev/null || echo "Unknown")
|
||||||
|
arch=$(uname -m 2>/dev/null || echo "Unknown")
|
||||||
|
check_china
|
||||||
|
ECS_VERSION="0.1.76"
|
||||||
|
for api in \
|
||||||
|
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
|
||||||
|
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
|
||||||
|
"https://githubapi.spiritlhl.top/repos/oneclickvirt/ecs/releases/latest"; do
|
||||||
|
ECS_VERSION=$(curl -m 6 -sSL "$api" | awk -F \" '/tag_name/{gsub(/^v/,"",$4); print $4}')
|
||||||
|
if [ -n "$ECS_VERSION" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
if [ -z "$ECS_VERSION" ]; then
|
||||||
|
_yellow "Unable to get version info, using default version 0.1.76"
|
||||||
|
ECS_VERSION="0.1.76"
|
||||||
|
fi
|
||||||
|
version_output=""
|
||||||
|
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do
|
||||||
|
if [ -x "$(command -v $cmd_path 2>/dev/null)" ]; then
|
||||||
|
version_output=$($cmd_path -v command 2>/dev/null)
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -n "$version_output" ]; then
|
||||||
extracted_version=${version_output//v/}
|
extracted_version=${version_output//v/}
|
||||||
if [ -n "$extracted_version" ]; then
|
if [ -n "$extracted_version" ]; then
|
||||||
ecs_version=$ECS_VERSION
|
ecs_version=$ECS_VERSION
|
||||||
if [[ "$(echo -e "$extracted_version\n$ecs_version" | sort -V | tail -n 1)" == "$extracted_version" ]]; then
|
if [[ "$(echo -e "$extracted_version\n$ecs_version" | sort -V | tail -n 1)" == "$extracted_version" ]]; then
|
||||||
echo "goecs version ($extracted_version) is latest, no need to upgrade."
|
_green "goecs version ($extracted_version) is up to date, no upgrade needed"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
echo "goecs version ($extracted_version) < $ecs_version, need to upgrade, 5 seconds later will start to upgrade"
|
_yellow "goecs version ($extracted_version) < $ecs_version, upgrade needed, starting in 5 seconds"
|
||||||
rm -rf /usr/bin/goecs
|
rm -rf /usr/bin/goecs /usr/local/bin/goecs ./goecs
|
||||||
rm -rf goecs
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Can not find goecs, need to download and install, 5 seconds later will start to install"
|
_green "goecs not found, installation needed, starting in 5 seconds"
|
||||||
fi
|
fi
|
||||||
sleep 5
|
sleep 5
|
||||||
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
if [[ "$CN" == true ]]; then
|
||||||
check_cdn_file
|
_yellow "Using China mirror for download..."
|
||||||
|
base_url="https://cnb.cool/oneclickvirt/ecs/-/git/raw/main"
|
||||||
|
else
|
||||||
|
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
||||||
|
check_cdn_file
|
||||||
|
if [ -n "$cdn_success_url" ]; then
|
||||||
|
base_url="${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}"
|
||||||
|
else
|
||||||
|
base_url="https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
local zip_file=""
|
||||||
case $os in
|
case $os in
|
||||||
Linux)
|
Linux|linux|LINUX)
|
||||||
case $arch in
|
|
||||||
"x86_64" | "x86" | "amd64" | "x64")
|
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_amd64.zip"
|
|
||||||
;;
|
|
||||||
"i386" | "i686")
|
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_386.zip"
|
|
||||||
;;
|
|
||||||
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
|
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_linux_arm64.zip"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported architecture: $arch"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
FreeBSD)
|
|
||||||
case $arch in
|
case $arch in
|
||||||
"x86_64" | "x86" | "amd64" | "x64")
|
x86_64|amd64|x64) zip_file="goecs_linux_amd64.zip" ;;
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_amd64.zip"
|
i386|i686) zip_file="goecs_linux_386.zip" ;;
|
||||||
;;
|
aarch64|arm64|armv8|armv8l) zip_file="goecs_linux_arm64.zip" ;;
|
||||||
"i386" | "i686")
|
arm|armv7l) zip_file="goecs_linux_arm.zip" ;;
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_386.zip"
|
mips) zip_file="goecs_linux_mips.zip" ;;
|
||||||
;;
|
mipsle) zip_file="goecs_linux_mipsle.zip" ;;
|
||||||
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
|
s390x) zip_file="goecs_linux_s390x.zip" ;;
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_freebsd_arm64.zip"
|
riscv64) zip_file="goecs_linux_riscv64.zip" ;;
|
||||||
;;
|
*) zip_file="goecs_linux_amd64.zip" ;;
|
||||||
*)
|
|
||||||
echo "Unsupported architecture: $arch"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
Darwin)
|
FreeBSD|freebsd)
|
||||||
case $arch in
|
case $arch in
|
||||||
"x86_64" | "x86" | "amd64" | "x64")
|
x86_64|amd64) zip_file="goecs_freebsd_amd64.zip" ;;
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_amd64.zip"
|
i386|i686) zip_file="goecs_freebsd_386.zip" ;;
|
||||||
|
arm64|aarch64) zip_file="goecs_freebsd_arm64.zip" ;;
|
||||||
|
*) zip_file="goecs_freebsd_amd64.zip" ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
"armv7l" | "armv8" | "armv8l" | "aarch64" | "arm64")
|
Darwin|darwin)
|
||||||
wget -O goecs.zip "${cdn_success_url}https://github.com/oneclickvirt/ecs/releases/download/v${ECS_VERSION}/goecs_arm64.zip"
|
case $arch in
|
||||||
|
x86_64|amd64) zip_file="goecs_darwin_amd64.zip" ;;
|
||||||
|
arm64|aarch64) zip_file="goecs_darwin_arm64.zip" ;;
|
||||||
|
*) zip_file="goecs_darwin_amd64.zip" ;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unsupported architecture: $arch"
|
_yellow "Unknown system $os, trying amd64 version"
|
||||||
exit 1
|
zip_file="goecs_linux_amd64.zip"
|
||||||
;;
|
;;
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported operating system: $os"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
unzip goecs.zip
|
download_url="${base_url}/${zip_file}"
|
||||||
rm -rf goecs.zip
|
_green "Downloading $download_url"
|
||||||
rm -rf README.md
|
local max_retries=3
|
||||||
rm -rf LICENSE
|
local retry_count=0
|
||||||
sleep 1
|
while [ $retry_count -lt $max_retries ]; do
|
||||||
|
if download_file "$download_url" "goecs.zip"; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
_yellow "Download failed, retrying (${retry_count}/${max_retries})..."
|
||||||
|
retry_count=$((retry_count + 1))
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
if [ $retry_count -eq $max_retries ]; then
|
||||||
|
_red "Download failed, please check your network connection or download manually"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! unzip -o goecs.zip >/dev/null 2>&1; then
|
||||||
|
_red "Extraction failed"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
rm -f goecs.zip README.md LICENSE README_EN.md
|
||||||
chmod 777 goecs
|
chmod 777 goecs
|
||||||
rm -rf /usr/bin/goecs
|
for install_path in "/usr/bin" "/usr/local/bin"; do
|
||||||
sleep 1
|
if [ -d "$install_path" ]; then
|
||||||
cp goecs /usr/bin/goecs
|
cp -f goecs "$install_path/"
|
||||||
rm -rf README_EN.md
|
break
|
||||||
rm -rf README.md
|
fi
|
||||||
echo "goecs version:"
|
done
|
||||||
|
if [ "$os" != "Darwin" ]; then
|
||||||
|
PARAM="net.ipv4.ping_group_range"
|
||||||
|
NEW_VALUE="0 2147483647"
|
||||||
|
if [ -f /etc/sysctl.conf ]; then
|
||||||
|
if grep -q "^$PARAM" /etc/sysctl.conf; then
|
||||||
|
sed -i "s/^$PARAM.*/$PARAM = $NEW_VALUE/" /etc/sysctl.conf
|
||||||
|
else
|
||||||
|
echo "$PARAM = $NEW_VALUE" >> /etc/sysctl.conf
|
||||||
|
fi
|
||||||
|
sysctl -p >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
setcap cap_net_raw=+ep goecs 2>/dev/null
|
||||||
|
setcap cap_net_raw=+ep /usr/bin/goecs 2>/dev/null
|
||||||
|
setcap cap_net_raw=+ep /usr/local/bin/goecs 2>/dev/null
|
||||||
|
_green "goecs installation complete, current version:"
|
||||||
goecs -v || ./goecs -v
|
goecs -v || ./goecs -v
|
||||||
}
|
}
|
||||||
|
|
||||||
InstallSysbench() {
|
InstallSysbench() {
|
||||||
if [ -f "/etc/centos-release" ]; then # CentOS
|
if [ -f "/etc/opencloudos-release" ]; then # OpenCloudOS
|
||||||
|
Var_OSRelease="opencloudos"
|
||||||
|
elif [ -f "/etc/centos-release" ]; then # CentOS
|
||||||
Var_OSRelease="centos"
|
Var_OSRelease="centos"
|
||||||
elif [ -f "/etc/fedora-release" ]; then # Fedora
|
elif [ -f "/etc/fedora-release" ]; then # Fedora
|
||||||
Var_OSRelease="fedora"
|
Var_OSRelease="fedora"
|
||||||
@@ -165,7 +294,6 @@ InstallSysbench() {
|
|||||||
Var_OSRelease="alpinelinux"
|
Var_OSRelease="alpinelinux"
|
||||||
elif [ -f "/etc/almalinux-release" ]; then # almalinux
|
elif [ -f "/etc/almalinux-release" ]; then # almalinux
|
||||||
Var_OSRelease="almalinux"
|
Var_OSRelease="almalinux"
|
||||||
# rockylinux
|
|
||||||
elif [ -f "/etc/arch-release" ]; then # archlinux
|
elif [ -f "/etc/arch-release" ]; then # archlinux
|
||||||
Var_OSRelease="arch"
|
Var_OSRelease="arch"
|
||||||
elif [ -f "/etc/freebsd-update.conf" ]; then # freebsd
|
elif [ -f "/etc/freebsd-update.conf" ]; then # freebsd
|
||||||
@@ -173,15 +301,70 @@ InstallSysbench() {
|
|||||||
else
|
else
|
||||||
Var_OSRelease="unknown" # 未知系统分支
|
Var_OSRelease="unknown" # 未知系统分支
|
||||||
fi
|
fi
|
||||||
case "$Var_OSRelease" in
|
local mem_size=$(get_memory_size)
|
||||||
ubuntu | debian | astra) ! apt-get install -y sysbench && apt-get --fix-broken install -y && apt-get install --no-install-recommends -y sysbench ;;
|
if [ -z "$mem_size" ] || [ "$mem_size" -eq 0 ]; then
|
||||||
centos | rhel | almalinux | redhat) (yum -y install epel-release && yum -y install sysbench) || (dnf install epel-release -y && dnf install sysbench -y) ;;
|
echo "Error: Unable to determine memory size or memory size is zero."
|
||||||
fedora) dnf -y install sysbench ;;
|
elif [ $mem_size -lt 1024 ]; then
|
||||||
arch) pacman -S --needed --noconfirm sysbench && pacman -S --needed --noconfirm libaio && ldconfig ;;
|
_red "Warning: Your system has less than 1GB RAM (${mem_size}MB)"
|
||||||
freebsd) pkg install -y sysbench ;;
|
if [ "$noninteractive" != "true" ]; then
|
||||||
alpinelinux) echo -e "${Msg_Warning}Sysbench Module not found, installing ..." && echo -e "${Msg_Warning}SysBench Current not support Alpine Linux, Skipping..." && Var_Skip_SysBench="1" ;;
|
reading "Do you want to continue with EPEL installation? (y/N): " confirm
|
||||||
*) echo "Error: Unknown OS release: $os_release" ;;
|
if [[ ! $confirm =~ ^[Yy]$ ]]; then
|
||||||
esac
|
_yellow "Skipping EPEL installation"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
case "$Var_OSRelease" in
|
||||||
|
ubuntu | debian | astra)
|
||||||
|
! apt-get install -y sysbench && apt-get --fix-broken install -y && apt-get install --no-install-recommends -y sysbench ;;
|
||||||
|
centos | rhel | almalinux | redhat | opencloudos)
|
||||||
|
(yum -y install epel-release && yum -y install sysbench) || (dnf install epel-release -y && dnf install sysbench -y) ;;
|
||||||
|
fedora)
|
||||||
|
dnf -y install sysbench ;;
|
||||||
|
arch)
|
||||||
|
pacman -S --needed --noconfirm sysbench && pacman -S --needed --noconfirm libaio && ldconfig ;;
|
||||||
|
freebsd)
|
||||||
|
pkg install -y sysbench ;;
|
||||||
|
alpinelinux)
|
||||||
|
if [ "$noninteractive" != "true" ]; then
|
||||||
|
reading "Do you want to continue with sysbench installation? (y/N): " confirm
|
||||||
|
if [[ ! $confirm =~ ^[Yy]$ ]]; then
|
||||||
|
_yellow "Skipping sysbench installation"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
ALPINE_VERSION=$(grep -o '^[0-9]\+\.[0-9]\+' /etc/alpine-release)
|
||||||
|
COMMUNITY_REPO="http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community"
|
||||||
|
if grep -q "^${COMMUNITY_REPO}" /etc/apk/repositories; then
|
||||||
|
echo "Community repository is already enabled."
|
||||||
|
else
|
||||||
|
echo "Enabling community repository..."
|
||||||
|
echo "${COMMUNITY_REPO}" >> /etc/apk/repositories
|
||||||
|
echo "Community repository has been added."
|
||||||
|
echo "Updating apk package index..."
|
||||||
|
apk update && echo "Package index updated successfully."
|
||||||
|
fi
|
||||||
|
if apk info sysbench >/dev/null 2>&1; then
|
||||||
|
echo -e "${Msg_Info}Sysbench already installed."
|
||||||
|
else
|
||||||
|
apk add --no-cache sysbench
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${Msg_Warning}Sysbench Module not found, installing ..." && echo -e "${Msg_Warning}SysBench Current not support Alpine Linux, Skipping..." && Var_Skip_SysBench="1"
|
||||||
|
else
|
||||||
|
echo -e "${Msg_Success}Sysbench installed successfully."
|
||||||
|
fi
|
||||||
|
fi ;;
|
||||||
|
*)
|
||||||
|
_red "Sysbench Install Error: Unknown OS release: $Var_OSRelease" ;;
|
||||||
|
esac
|
||||||
|
if [[ $SYSTEM =~ ^(CentOS|RHEL|AlmaLinux)$ ]]; then
|
||||||
|
_yellow "Installing EPEL repository..."
|
||||||
|
if ! yum -y install epel-release; then
|
||||||
|
_red "EPEL installation failed!"
|
||||||
|
cleanup_epel
|
||||||
|
_yellow "Attempting to continue without EPEL..."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
Check_SysBench() {
|
Check_SysBench() {
|
||||||
@@ -210,6 +393,9 @@ Check_Sysbench_InstantBuild() {
|
|||||||
if [ "$os_sysbench" = "astra" ]; then
|
if [ "$os_sysbench" = "astra" ]; then
|
||||||
os_sysbench="debian"
|
os_sysbench="debian"
|
||||||
fi
|
fi
|
||||||
|
if [ "$os_sysbench" = "opencloudos" ]; then
|
||||||
|
os_sysbench="centos"
|
||||||
|
fi
|
||||||
echo -e "${Msg_Info}Release Detected: ${os_sysbench}"
|
echo -e "${Msg_Info}Release Detected: ${os_sysbench}"
|
||||||
echo -e "${Msg_Info}Preparing compile enviorment ..."
|
echo -e "${Msg_Info}Preparing compile enviorment ..."
|
||||||
prepare_compile_env "${os_sysbench}"
|
prepare_compile_env "${os_sysbench}"
|
||||||
@@ -244,15 +430,14 @@ prepare_compile_env() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
env_check() {
|
env_check() {
|
||||||
REGEX=("debian|astra" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "fedora" "arch" "freebsd" "alpine" "openbsd")
|
REGEX=("debian|astra" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "fedora" "arch" "freebsd" "alpine" "openbsd" "opencloudos")
|
||||||
RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Fedora" "Arch" "FreeBSD" "Alpine" "OpenBSD")
|
RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Fedora" "Arch" "FreeBSD" "Alpine" "OpenBSD" "OpenCloudOS")
|
||||||
PACKAGE_UPDATE=("apt-get update" "apt-get update" "yum -y update" "yum -y update" "yum -y update" "pacman -Sy" "pkg update" "apk update" "pkg_add -u")
|
PACKAGE_UPDATE=("apt-get update" "apt-get update" "yum -y update" "yum -y update" "yum -y update" "pacman -Sy" "pkg update" "apk update" "pkg_add -qu" "yum -y update")
|
||||||
PACKAGE_INSTALL=("apt-get -y install" "apt-get -y install" "yum -y install" "yum -y install" "yum -y install" "pacman -Sy --noconfirm --needed" "pkg install -y" "apk add")
|
PACKAGE_INSTALL=("apt-get -y install" "apt-get -y install" "yum -y install" "yum -y install" "yum -y install" "pacman -Sy --noconfirm --needed" "pkg install -y" "apk add --no-cache" "pkg_add -I" "yum -y install")
|
||||||
PACKAGE_REMOVE=("apt-get -y remove" "apt-get -y remove" "yum -y remove" "yum -y remove" "yum -y remove" "pacman -Rsc --noconfirm" "pkg delete" "apk del")
|
PACKAGE_REMOVE=("apt-get -y remove" "apt-get -y remove" "yum -y remove" "yum -y remove" "yum -y remove" "pacman -Rsc --noconfirm" "pkg delete" "apk del" "pkg_delete -I" "yum -y remove")
|
||||||
PACKAGE_UNINSTALL=("apt-get -y autoremove" "apt-get -y autoremove" "yum -y autoremove" "yum -y autoremove" "yum -y autoremove" "" "pkg autoremove" "apk autoremove")
|
PACKAGE_UNINSTALL=("apt-get -y autoremove" "apt-get -y autoremove" "yum -y autoremove" "yum -y autoremove" "yum -y autoremove" "pacman -Rns --noconfirm" "pkg autoremove" "apk autoremove" "pkg_delete -a" "yum -y autoremove")
|
||||||
# 检查系统信息
|
if [ -f /etc/opencloudos-release ]; then
|
||||||
if [ -f /etc/alpine-release ]; then
|
SYS="opencloudos"
|
||||||
SYS="alpine"
|
|
||||||
elif [ -s /etc/os-release ]; then
|
elif [ -s /etc/os-release ]; then
|
||||||
SYS="$(grep -i pretty_name /etc/os-release | cut -d \" -f2)"
|
SYS="$(grep -i pretty_name /etc/os-release | cut -d \" -f2)"
|
||||||
elif [ -x "$(type -p hostnamectl)" ]; then
|
elif [ -x "$(type -p hostnamectl)" ]; then
|
||||||
@@ -268,73 +453,95 @@ env_check() {
|
|||||||
else
|
else
|
||||||
SYS="$(uname -s)"
|
SYS="$(uname -s)"
|
||||||
fi
|
fi
|
||||||
[[ -n $SYS ]] || exit 1
|
SYSTEM=""
|
||||||
# 匹配操作系统
|
|
||||||
for ((int = 0; int < ${#REGEX[@]}; int++)); do
|
for ((int = 0; int < ${#REGEX[@]}; int++)); do
|
||||||
if [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]]; then
|
if [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]]; then
|
||||||
SYSTEM="${RELEASE[int]}"
|
SYSTEM="${RELEASE[int]}"
|
||||||
[[ -n $SYSTEM ]] && break
|
UPDATE_CMD=${PACKAGE_UPDATE[int]}
|
||||||
|
INSTALL_CMD=${PACKAGE_INSTALL[int]}
|
||||||
|
REMOVE_CMD=${PACKAGE_REMOVE[int]}
|
||||||
|
UNINSTALL_CMD=${PACKAGE_UNINSTALL[int]}
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# 检查是否成功匹配
|
if [ -z "$SYSTEM" ]; then
|
||||||
[[ -n $SYSTEM ]] || exit 1
|
_yellow "Unable to recognize system, trying common package managers..."
|
||||||
# 根据 SYSTEM 设置相应的包管理命令
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
UPDATE_CMD=${PACKAGE_UPDATE[int]}
|
SYSTEM="Unknown-Debian"
|
||||||
INSTALL_CMD=${PACKAGE_INSTALL[int]}
|
UPDATE_CMD="apt-get update"
|
||||||
REMOVE_CMD=${PACKAGE_REMOVE[int]}
|
INSTALL_CMD="apt-get -y install"
|
||||||
UNINSTALL_CMD=${PACKAGE_UNINSTALL[int]}
|
REMOVE_CMD="apt-get -y remove"
|
||||||
echo "System: $SYSTEM"
|
UNINSTALL_CMD="apt-get -y autoremove"
|
||||||
echo "Update command: $UPDATE_CMD"
|
elif command -v yum >/dev/null 2>&1; then
|
||||||
echo "Install command: $INSTALL_CMD"
|
SYSTEM="Unknown-RHEL"
|
||||||
echo "Remove command: $REMOVE_CMD"
|
UPDATE_CMD="yum -y update"
|
||||||
echo "Uninstall command: $UNINSTALL_CMD"
|
INSTALL_CMD="yum -y install"
|
||||||
|
REMOVE_CMD="yum -y remove"
|
||||||
|
UNINSTALL_CMD="yum -y autoremove"
|
||||||
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
|
SYSTEM="Unknown-Fedora"
|
||||||
|
UPDATE_CMD="dnf -y update"
|
||||||
|
INSTALL_CMD="dnf -y install"
|
||||||
|
REMOVE_CMD="dnf -y remove"
|
||||||
|
UNINSTALL_CMD="dnf -y autoremove"
|
||||||
|
elif command -v pacman >/dev/null 2>&1; then
|
||||||
|
SYSTEM="Unknown-Arch"
|
||||||
|
UPDATE_CMD="pacman -Sy"
|
||||||
|
INSTALL_CMD="pacman -S --noconfirm"
|
||||||
|
REMOVE_CMD="pacman -R --noconfirm"
|
||||||
|
UNINSTALL_CMD="pacman -Rns --noconfirm"
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
SYSTEM="Unknown-Alpine"
|
||||||
|
UPDATE_CMD="apk update"
|
||||||
|
INSTALL_CMD="apk add"
|
||||||
|
REMOVE_CMD="apk del"
|
||||||
|
UNINSTALL_CMD="apk del"
|
||||||
|
elif command -v zypper >/dev/null 2>&1; then
|
||||||
|
SYSTEM="Unknown-SLES"
|
||||||
|
UPDATE_CMD="zypper refresh"
|
||||||
|
INSTALL_CMD="zypper install -y"
|
||||||
|
REMOVE_CMD="zypper remove -y"
|
||||||
|
UNINSTALL_CMD="zypper remove -y"
|
||||||
|
else
|
||||||
|
_red "Unable to recognize package manager, exiting installation"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
_green "System information: $SYSTEM"
|
||||||
|
_green "Update command: $UPDATE_CMD"
|
||||||
|
_green "Install command: $INSTALL_CMD"
|
||||||
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
cdn_urls=("https://cdn0.spiritlhl.top/" "http://cdn3.spiritlhl.net/" "http://cdn1.spiritlhl.net/" "http://cdn2.spiritlhl.net/")
|
||||||
check_cdn_file
|
check_cdn_file
|
||||||
_green "Update system manager."
|
_yellow "Warning: System update will be performed"
|
||||||
${PACKAGE_UPDATE[int]} 2>/dev/null
|
_yellow "This operation may:"
|
||||||
if ! command -v sudo >/dev/null 2>&1; then
|
_yellow "1. Take considerable time"
|
||||||
_green "Installing sudo"
|
_yellow "2. Cause temporary network interruptions"
|
||||||
${PACKAGE_INSTALL[int]} sudo
|
_yellow "3. Impact system stability"
|
||||||
fi
|
_yellow "4. Affect subsequent system startups"
|
||||||
if ! command -v wget >/dev/null 2>&1; then
|
if [ "$noninteractive" != "true" ]; then
|
||||||
_green "Installing wget"
|
reading "Continue with system update? (y/N): " update_confirm
|
||||||
${PACKAGE_INSTALL[int]} wget
|
if [[ ! $update_confirm =~ ^[Yy]$ ]]; then
|
||||||
fi
|
_yellow "Skipping system update"
|
||||||
if ! command -v tar >/dev/null 2>&1; then
|
_yellow "Note: Some packages may fail to install"
|
||||||
_green "Installing tar"
|
else
|
||||||
${PACKAGE_INSTALL[int]} tar
|
_green "Updating system package manager..."
|
||||||
fi
|
if ! ${UPDATE_CMD} 2>/dev/null; then
|
||||||
if ! command -v unzip >/dev/null 2>&1; then
|
_red "System update failed!"
|
||||||
_green "Installing unzip"
|
|
||||||
${PACKAGE_INSTALL[int]} unzip
|
|
||||||
fi
|
|
||||||
if ! command -v systemd-detect-virt >/dev/null 2>&1; then
|
|
||||||
_green "Installing systemd-detect-virt"
|
|
||||||
${PACKAGE_INSTALL[int]} systemd-detect-virt
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
if ! command -v dmidecode >/dev/null 2>&1; then
|
|
||||||
_green "Installing dmidecode"
|
|
||||||
${PACKAGE_INSTALL[int]} dmidecode
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! command -v dd >/dev/null 2>&1; then
|
for cmd in sudo wget tar unzip iproute2 systemd-detect-virt dd fio; do
|
||||||
_green "Installing dd"
|
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||||
${PACKAGE_INSTALL[int]} dd
|
_green "Installing $cmd"
|
||||||
fi
|
${INSTALL_CMD} "$cmd"
|
||||||
if ! command -v fio >/dev/null 2>&1; then
|
fi
|
||||||
_green "Installing fio"
|
done
|
||||||
${PACKAGE_INSTALL[int]} fio
|
if ! command -v sysbench >/dev/null 2>&1; then
|
||||||
fi
|
|
||||||
if ! command -v sysbench >/dev/null 2>&1 && [ "${REGEX[int]}" != "freebsd" ]; then
|
|
||||||
_green "Installing sysbench"
|
_green "Installing sysbench"
|
||||||
${PACKAGE_INSTALL[int]} sysbench
|
${INSTALL_CMD} sysbench
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Unable to download sysbench through the system's package manager, speak to try compiling and installing it..."
|
echo "Unable to download sysbench through package manager, attempting compilation..."
|
||||||
if ! wget -O /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip"; then
|
wget -O /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip" || curl -Lk -o /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip"
|
||||||
echo "wget failed, trying with curl"
|
|
||||||
curl -Lk -o /tmp/sysbench.zip "${cdn_success_url}https://github.com/akopytov/sysbench/archive/1.0.20.zip"
|
|
||||||
fi
|
|
||||||
if [ ! -f /tmp/sysbench.zip ]; then
|
if [ ! -f /tmp/sysbench.zip ]; then
|
||||||
wget -q -O /tmp/sysbench.zip "https://hub.fgit.cf/akopytov/sysbench/archive/1.0.20.zip"
|
wget -q -O /tmp/sysbench.zip "https://hub.fgit.cf/akopytov/sysbench/archive/1.0.20.zip"
|
||||||
fi
|
fi
|
||||||
@@ -347,66 +554,63 @@ env_check() {
|
|||||||
_green "Installing geekbench"
|
_green "Installing geekbench"
|
||||||
curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/cputest/main/dgb.sh" -o dgb.sh && chmod +x dgb.sh
|
curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/cputest/main/dgb.sh" -o dgb.sh && chmod +x dgb.sh
|
||||||
bash dgb.sh -v gb5
|
bash dgb.sh -v gb5
|
||||||
_blue "If you not want to use geekbench5, you can use"
|
|
||||||
echo "bash dgb.sh -v gb6"
|
|
||||||
echo "bash dgb.sh -v gb4"
|
|
||||||
_blue "to change version, or use"
|
|
||||||
echo "rm -rf /usr/bin/geekbench*"
|
|
||||||
_blue "to uninstall geekbench"
|
|
||||||
rm -rf dgb.sh
|
rm -rf dgb.sh
|
||||||
fi
|
fi
|
||||||
if ! command -v speedtest >/dev/null 2>&1; then
|
if ! command -v speedtest >/dev/null 2>&1; then
|
||||||
_green "Installing geekbench"
|
_green "Installing speedtest"
|
||||||
curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/speedtest/main/dspt.sh" -o dspt.sh && chmod +x dspt.sh
|
curl -L "${cdn_success_url}https://raw.githubusercontent.com/oneclickvirt/speedtest/main/dspt.sh" -o dspt.sh && chmod +x dspt.sh
|
||||||
bash dspt.sh
|
bash dspt.sh
|
||||||
rm -rf dspt.sh
|
rm -rf dspt.sh
|
||||||
rm -rf speedtest.tar.gz
|
rm -rf speedtest.tar.gz
|
||||||
_blue "if you want to use golang origin speedtest, you can use"
|
|
||||||
echo "rm -rf /usr/bin/speedtest"
|
|
||||||
echo "rm -rf /usr/bin/speedtest-go"
|
|
||||||
_blue "to uninstall speedtest and speedtest-go"
|
|
||||||
fi
|
fi
|
||||||
if ! command -v ping >/dev/null 2>&1; then
|
if ! command -v ping >/dev/null 2>&1; then
|
||||||
_green "Installing ping"
|
_green "Installing ping"
|
||||||
${PACKAGE_INSTALL[int]} iputils-ping >/dev/null 2>&1
|
${INSTALL_CMD} iputils-ping >/dev/null 2>&1
|
||||||
${PACKAGE_INSTALL[int]} ping >/dev/null 2>&1
|
${INSTALL_CMD} ping >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
echo "Detected MacOS. Installing sysbench and fio..."
|
echo "Detected MacOS, installing sysbench iproute2mac..."
|
||||||
brew install --force sysbench fio dd
|
brew install --force sysbench iproute2mac
|
||||||
# 有问题,需要修复,root环境不能brew,brew安装完毕后可能路径不在环境变量中
|
|
||||||
else
|
else
|
||||||
if ! grep -q "^net.ipv4.ping_group_range = 0 2147483647$" /etc/sysctl.conf; then
|
if ! grep -q "^net.ipv4.ping_group_range = 0 2147483647$" /etc/sysctl.conf; then
|
||||||
echo "net.ipv4.ping_group_range = 0 2147483647" >> /etc/sysctl.conf
|
echo "net.ipv4.ping_group_range = 0 2147483647" >> /etc/sysctl.conf
|
||||||
sysctl -p
|
sysctl -p
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
_green "The environment is ready."
|
_green "Environment preparation complete."
|
||||||
_green "The next command is: ./goecs.sh install"
|
_green "Next command is: ./goecs.sh install"
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstall_goecs() {
|
uninstall_goecs() {
|
||||||
rm -rf /root/goecs
|
rm -rf /root/goecs
|
||||||
rm -rf /usr/bin/goecs
|
rm -rf /usr/bin/goecs
|
||||||
_green "The command (goecs) has been uninstalled."
|
_green "The command (goecs) has been uninstalled."
|
||||||
}
|
}
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
cat <<"EOF"
|
cat <<"EOF"
|
||||||
可用命令:
|
可用命令:
|
||||||
|
|
||||||
./goecs.sh env 检查并安装的包:
|
./goecs.sh env 检查并安装依赖包
|
||||||
sudo (几乎所有类 Unix 系统都有。)
|
警告: 此命令会执行系统更新(可选择),可能:
|
||||||
tar (几乎所有类 Unix 系统都有。)
|
1. 耗时较长
|
||||||
unzip (几乎所有类 Unix 系统都有。)
|
2. 导致网络短暂中断
|
||||||
dd (几乎所有类 Unix 系统都有。)
|
3. 影响系统稳定性
|
||||||
fio (几乎所有类 Unix 系统可以通过系统的包管理器安装。)
|
4. 影响后续系统启动
|
||||||
sysbench (几乎所有类 Unix 系统可以通过系统的包管理器安装。)
|
对于内存小于1GB的系统,还可能导致:
|
||||||
geekbench (geekbench5) (仅支持 IPV4 环境,且内存大于 1GB 并需要持续联网,仅支持 amd64 和 arm64 架构。)
|
1. 系统卡死
|
||||||
speedtest (使用官方提供的二进制文件以获得更准确的测试结果。)
|
2. SSH连接中断
|
||||||
ping (使用官方提供的二进制文件以获得更准确的测试结果。)
|
3. 关键服务失败
|
||||||
systemd-detect-virt 或 dmidecode (几乎所有类 Unix 系统都有,安装以获得更准确的测试结果。)
|
推荐:
|
||||||
事实上,sysbench/geekbench 是上述依赖项中唯一必须安装的,没有它们无法测试 CPU 分数。
|
环境依赖安装过程中挂起执行
|
||||||
|
|
||||||
|
可选组件:
|
||||||
|
sysbench/geekbench (CPU性能测试)
|
||||||
|
sudo, tar, unzip, dd, fio
|
||||||
|
speedtest (网络测试)
|
||||||
|
ping (网络连通性测试)
|
||||||
|
systemd-detect-virt/dmidecode (系统信息检测)
|
||||||
|
|
||||||
./goecs.sh install 安装 goecs 命令
|
./goecs.sh install 安装 goecs 命令
|
||||||
./goecs.sh upgrade 升级 goecs 命令
|
./goecs.sh upgrade 升级 goecs 命令
|
||||||
./goecs.sh uninstall 卸载 goecs 命令
|
./goecs.sh uninstall 卸载 goecs 命令
|
||||||
@@ -414,18 +618,26 @@ show_help() {
|
|||||||
|
|
||||||
Available commands:
|
Available commands:
|
||||||
|
|
||||||
./goecs.sh env Check and Install package:
|
./goecs.sh env Check and Install dependencies
|
||||||
sudo (Almost all unix-like systems have it.)
|
Warning: This command performs system update(optional), which may:
|
||||||
tar (Almost all unix-like systems have it.)
|
1. Take considerable time
|
||||||
unzip (Almost all unix-like systems have it.)
|
2. Cause temporary network interruptions
|
||||||
dd (Almost all unix-like systems have it.)
|
3. Impact system stability
|
||||||
fio (Almost all unix-like systems can be installed through the system's package manager.)
|
4. Affect subsequent system startups
|
||||||
sysbench (Almost all unix-like systems can be installed through the system's package manager.)
|
For systems with less than 1GB RAM, additional risks:
|
||||||
geekbench (geekbench5)(Only support IPV4 environment, and memory greater than 1GB network detection, only support amd64 and arm64 architecture.)
|
1. System freeze
|
||||||
speedtest (Use the officially provided binaries for more accurate test results.)
|
2. SSH connection loss
|
||||||
ping (Use the officially provided binaries for more accurate test results.)
|
3. Critical service failures
|
||||||
systemd-detect-virt OR dmidecode (Almost all unix-like systems have it, for more accurate test results.)
|
Recommended:
|
||||||
In fact, sysbench/geekbench is the only one of the above dependencies that must be installed, without which the CPU score cannot be tested.
|
Hanging execution during environment dependency installation
|
||||||
|
|
||||||
|
Optional components:
|
||||||
|
sysbench/geekbench (CPU testing)
|
||||||
|
sudo, tar, unzip, dd, fio
|
||||||
|
speedtest (Network testing)
|
||||||
|
ping (Network connectivity)
|
||||||
|
systemd-detect-virt/dmidecode (System info detection)
|
||||||
|
|
||||||
./goecs.sh install Install goecs command
|
./goecs.sh install Install goecs command
|
||||||
./goecs.sh upgrade Upgrade goecs command
|
./goecs.sh upgrade Upgrade goecs command
|
||||||
./goecs.sh uninstall Uninstall goecs command
|
./goecs.sh uninstall Uninstall goecs command
|
||||||
|
@@ -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(res)
|
return
|
||||||
}
|
}
|
||||||
|
@@ -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
44
nexttrace/nexttrace.go
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
nexttrace/nexttrace_test.go
Normal file
13
nexttrace/nexttrace_test.go
Normal 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)
|
||||||
|
}
|
@@ -6,5 +6,5 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test(t *testing.T) {
|
func Test(t *testing.T) {
|
||||||
fmt.Printf(MediaTest("zh"))
|
fmt.Printf("%s", MediaTest("zh"))
|
||||||
}
|
}
|
||||||
|
20
update.bat
20
update.bat
@@ -1,20 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
set repo_path=C:\Users\spiritlhl\Documents\GoWorks\ecs
|
|
||||||
|
|
||||||
git add -A
|
|
||||||
git commit -am"update"
|
|
||||||
|
|
||||||
:push
|
|
||||||
cd %repo_path%
|
|
||||||
git push -f origin master
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Push failed. Retrying in 3 seconds...
|
|
||||||
timeout /nobreak /t 3 >nul
|
|
||||||
goto push
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Push successful.
|
|
||||||
|
|
||||||
endlocal
|
|
66
upstreams/upstreams.go
Normal file
66
upstreams/upstreams.go
Normal 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("同一目标地址多个线路时,检测可能已越过汇聚层,除第一个线路外,后续信息可能无效"))
|
||||||
|
}
|
8
upstreams/uptreams_test.go
Normal file
8
upstreams/uptreams_test.go
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package upstreams
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestUpstreamsCheck(t *testing.T) {
|
||||||
|
IPV4 = "148.100.85.25"
|
||||||
|
UpstreamsCheck()
|
||||||
|
}
|
476
utils/utils.go
476
utils/utils.go
@@ -1,23 +1,46 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/imroc/req/v3"
|
|
||||||
"github.com/oneclickvirt/UnlockTests/uts"
|
|
||||||
"github.com/oneclickvirt/basics/system"
|
|
||||||
. "github.com/oneclickvirt/defaultset"
|
|
||||||
"github.com/oneclickvirt/security/network"
|
|
||||||
"io"
|
"io"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
|
"github.com/imroc/req/v3"
|
||||||
|
"github.com/oneclickvirt/UnlockTests/uts"
|
||||||
|
bnetwork "github.com/oneclickvirt/basics/network"
|
||||||
|
"github.com/oneclickvirt/basics/system"
|
||||||
|
butils "github.com/oneclickvirt/basics/utils"
|
||||||
|
. "github.com/oneclickvirt/defaultset"
|
||||||
|
"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) {
|
||||||
// 计算字符串的字符数
|
// 计算字符串的字符数
|
||||||
@@ -58,59 +81,24 @@ func CheckChina(enableLogger bool) bool {
|
|||||||
SetRetryBackoffInterval(1*time.Second, 3*time.Second).
|
SetRetryBackoffInterval(1*time.Second, 3*time.Second).
|
||||||
SetRetryFixedInterval(2 * time.Second)
|
SetRetryFixedInterval(2 * time.Second)
|
||||||
ipapiURL := "https://ipapi.co/json"
|
ipapiURL := "https://ipapi.co/json"
|
||||||
cipccURL := "http://cip.cc"
|
|
||||||
ipapiResp, err := client.R().Get(ipapiURL)
|
ipapiResp, err := client.R().Get(ipapiURL)
|
||||||
if err != nil {
|
|
||||||
if enableLogger {
|
|
||||||
Logger.Info("无法获取IP信息:" + err.Error())
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
defer ipapiResp.Body.Close()
|
|
||||||
var ipapiBody string
|
|
||||||
ipapiBody, err = ipapiResp.ToString()
|
|
||||||
if err != nil {
|
|
||||||
if enableLogger {
|
|
||||||
Logger.Info("无法读取IP信息响应:" + err.Error())
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
isInChina := strings.Contains(ipapiBody, "China")
|
|
||||||
if isInChina {
|
|
||||||
fmt.Println("根据ipapi.co提供的信息,当前IP可能在中国")
|
|
||||||
var input string
|
|
||||||
fmt.Print("是否选用中国专项测试(无流媒体测试,有三网Ping值测试)? ([y]/n) ")
|
|
||||||
fmt.Scanln(&input)
|
|
||||||
switch strings.ToLower(input) {
|
|
||||||
case "yes", "y":
|
|
||||||
fmt.Println("使用中国专项测试")
|
|
||||||
selectChina = true
|
|
||||||
case "no", "n":
|
|
||||||
fmt.Println("不使用中国专项测试")
|
|
||||||
default:
|
|
||||||
fmt.Println("使用中国专项测试")
|
|
||||||
selectChina = true
|
|
||||||
}
|
|
||||||
return selectChina
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cipccResp, err := client.R().Get(cipccURL)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if enableLogger {
|
if enableLogger {
|
||||||
Logger.Info("无法获取IP信息:" + err.Error())
|
Logger.Info("无法获取IP信息:" + err.Error())
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
defer cipccResp.Body.Close()
|
defer ipapiResp.Body.Close()
|
||||||
cipccBody, err := cipccResp.ToString()
|
ipapiBody, err := ipapiResp.ToString()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if enableLogger {
|
if enableLogger {
|
||||||
Logger.Info("无法读取IP信息响应:" + err.Error())
|
Logger.Info("无法读取IP信息响应:" + err.Error())
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
isInChina := strings.Contains(cipccBody, "中国")
|
isInChina := strings.Contains(ipapiBody, "China")
|
||||||
if isInChina {
|
if isInChina {
|
||||||
fmt.Println("根据cip.cc提供的信息,当前IP可能在中国")
|
fmt.Println("根据 ipapi.co 提供的信息,当前IP可能在中国")
|
||||||
var input string
|
var input string
|
||||||
fmt.Print("是否选用中国专项测试(无流媒体测试,有三网Ping值测试)? ([y]/n) ")
|
fmt.Print("是否选用中国专项测试(无流媒体测试,有三网Ping值测试)? ([y]/n) ")
|
||||||
fmt.Scanln(&input)
|
fmt.Scanln(&input)
|
||||||
@@ -121,45 +109,66 @@ func CheckChina(enableLogger bool) bool {
|
|||||||
case "no", "n":
|
case "no", "n":
|
||||||
fmt.Println("不使用中国专项测试")
|
fmt.Println("不使用中国专项测试")
|
||||||
default:
|
default:
|
||||||
fmt.Println("不使用中国专项测试")
|
fmt.Println("使用中国专项测试")
|
||||||
selectChina = true
|
selectChina = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return selectChina
|
return selectChina
|
||||||
}
|
}
|
||||||
|
|
||||||
// SecurityCheck 执行安全检查
|
// OnlyBasicsIpInfo 仅检查和输出IP信息
|
||||||
func SecurityCheck(language, nt3CheckType string, securtyCheckStatus bool) (string, string, string) {
|
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 执行安全检查
|
||||||
|
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(2)
|
|
||||||
go func() {
|
go func() {
|
||||||
defer wgt.Done()
|
defer wgt.Done()
|
||||||
ipInfo, securityInfo, err = network.NetworkCheck("both", securtyCheckStatus, 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)
|
||||||
go func() {
|
go func() {
|
||||||
defer wgt.Done()
|
defer wgt.Done()
|
||||||
systemInfo = system.CheckSystemInfo(language)
|
systemInfo = system.CheckSystemInfo(language)
|
||||||
}()
|
}()
|
||||||
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 == "" {
|
||||||
@@ -172,7 +181,7 @@ func SecurityCheck(language, nt3CheckType string, securtyCheckStatus bool) (stri
|
|||||||
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 捕获函数输出和错误输出,实时输出,并返回字符串
|
||||||
@@ -238,95 +247,358 @@ func PrintAndCapture(f func(), tempOutput, output string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadText 上传文本内容到指定URL
|
// UploadText 上传文本内容到指定URL
|
||||||
func UploadText(absPath string) (string, error) {
|
func UploadText(absPath string) (string, string, error) {
|
||||||
primaryURL := "http://hpaste.spiritlhl.net/api/upload"
|
primaryURL := "http://hpaste.spiritlhl.net/api/UL/upload"
|
||||||
backupURL := "https://paste.spiritlhl.net/api/upload"
|
backupURL := "https://paste.spiritlhl.net/api/UL/upload"
|
||||||
token := network.SecurityUploadToken
|
token := network.SecurityUploadToken
|
||||||
client := req.DefaultClient()
|
client := req.C().SetTimeout(6 * time.Second)
|
||||||
client.SetTimeout(6 * time.Second)
|
|
||||||
client.R().
|
client.R().
|
||||||
SetRetryCount(2).
|
SetRetryCount(2).
|
||||||
SetRetryBackoffInterval(1*time.Second, 5*time.Second).
|
SetRetryBackoffInterval(1*time.Second, 5*time.Second).
|
||||||
SetRetryFixedInterval(2 * time.Second)
|
SetRetryFixedInterval(2 * time.Second)
|
||||||
|
// 打开文件
|
||||||
file, err := os.Open(absPath)
|
file, err := os.Open(absPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", "", fmt.Errorf("failed to open file: %w", err)
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
upload := func(url string) (string, error) {
|
// 获取文件信息并检查大小
|
||||||
|
fileInfo, err := file.Stat()
|
||||||
|
if err != nil {
|
||||||
|
return "", "", fmt.Errorf("failed to get file info: %w", err)
|
||||||
|
}
|
||||||
|
if fileInfo.Size() > 25*1024 { // 25KB
|
||||||
|
return "", "", fmt.Errorf("file size exceeds 25KB limit")
|
||||||
|
}
|
||||||
|
// 上传逻辑
|
||||||
|
upload := func(url string) (string, string, error) {
|
||||||
|
file, err := os.Open(absPath)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", fmt.Errorf("failed to re-open file for %s: %w", url, err)
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
content, err := io.ReadAll(file)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", fmt.Errorf("failed to read file content for %s: %w", url, err)
|
||||||
|
}
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
SetHeader("Authorization", token).
|
SetHeader("Authorization", token).
|
||||||
SetHeader("Format", "RANDOM").
|
SetFileBytes("file", filepath.Base(absPath), content).
|
||||||
SetHeader("Max-Views", "0").
|
|
||||||
SetHeader("UploadText", "true").
|
|
||||||
SetHeader("Content-Type", "multipart/form-data").
|
|
||||||
SetHeader("No-JSON", "true").
|
|
||||||
SetFileReader("file", "goecs.txt", file).
|
|
||||||
Post(url)
|
Post(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", "", fmt.Errorf("failed to make request to %s: %w", url, err)
|
||||||
}
|
}
|
||||||
if resp.StatusCode >= 200 && resp.StatusCode <= 299 {
|
if resp.StatusCode >= 200 && resp.StatusCode <= 299 && resp.String() != "" {
|
||||||
return strings.ReplaceAll(resp.String(), "https://paste.spiritlhl.net/", "http://hpaste.spiritlhl.net/"), nil
|
fileID := strings.TrimSpace(resp.String())
|
||||||
} else {
|
if strings.Contains(fileID, "show") {
|
||||||
return "", fmt.Errorf("upload failed with status code: %d", resp.StatusCode)
|
fileID = fileID[strings.LastIndex(fileID, "/")+1:]
|
||||||
|
}
|
||||||
|
httpURL := fmt.Sprintf("http://hpaste.spiritlhl.net/#/show/%s", fileID)
|
||||||
|
httpsURL := fmt.Sprintf("https://paste.spiritlhl.net/#/show/%s", fileID)
|
||||||
|
return httpURL, httpsURL, nil
|
||||||
}
|
}
|
||||||
|
return "", "", fmt.Errorf("upload failed for %s with status code: %d", url, resp.StatusCode)
|
||||||
}
|
}
|
||||||
result, err := upload(primaryURL)
|
// 尝试上传到主URL
|
||||||
|
httpURL, httpsURL, err := upload(primaryURL)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return result, nil
|
return httpURL, httpsURL, nil
|
||||||
}
|
}
|
||||||
result, err = upload(backupURL)
|
// 尝试上传到备份URL
|
||||||
|
httpURL, httpsURL, err = upload(backupURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", "", fmt.Errorf("failed to upload to both primary and backup URLs: %w", err)
|
||||||
}
|
}
|
||||||
return result, nil
|
return httpURL, httpsURL, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProcessAndUpload 创建结果文件并上传文件
|
// ProcessAndUpload 创建结果文件并上传文件
|
||||||
func ProcessAndUpload(output string, filePath string, enableUplaod bool) {
|
func ProcessAndUpload(output string, filePath string, enableUplaod bool) (string, string) {
|
||||||
|
// 使用 defer 来处理 panic
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
fmt.Printf("处理上传时发生错误: %v\n", r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
// 检查文件是否存在
|
// 检查文件是否存在
|
||||||
if _, err := os.Stat(filePath); err == nil {
|
if _, err := os.Stat(filePath); err == nil {
|
||||||
// 文件存在,删除文件
|
// 文件存在,删除文件
|
||||||
err = os.Remove(filePath)
|
err = os.Remove(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Cannot delete file:", err)
|
fmt.Println("无法删除文件:", err)
|
||||||
return
|
return "", ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 创建文件
|
// 创建文件
|
||||||
file, err := os.Create(filePath)
|
file, err := os.Create(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Cannot create file:", err)
|
fmt.Println("无法创建文件:", err)
|
||||||
return
|
return "", ""
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
// 匹配 ANSI 转义序列
|
// 匹配 ANSI 转义序列
|
||||||
ansiRegex := regexp.MustCompile("\x1B\\[[0-9;]+[a-zA-Z]")
|
ansiRegex := regexp.MustCompile("\x1B\\[[0-9;]+[a-zA-Z]")
|
||||||
// 移除 ANSI 转义序列
|
// 移除 ANSI 转义序列
|
||||||
cleanedOutput := ansiRegex.ReplaceAllString(output, "")
|
cleanedOutput := ansiRegex.ReplaceAllString(output, "")
|
||||||
// 写入文件
|
// 使用 bufio.Writer 提高写入效率
|
||||||
_, err = file.WriteString(cleanedOutput)
|
writer := bufio.NewWriter(file)
|
||||||
|
_, err = writer.WriteString(cleanedOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Cannot write to file:", err)
|
fmt.Println("无法写入文件:", err)
|
||||||
return
|
return "", ""
|
||||||
} else {
|
|
||||||
fmt.Println("Write test result in ", filePath)
|
|
||||||
}
|
}
|
||||||
|
// 确保写入缓冲区的数据都刷新到文件中
|
||||||
|
err = writer.Flush()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("无法刷新文件缓冲:", err)
|
||||||
|
return "", ""
|
||||||
|
}
|
||||||
|
fmt.Printf("测试结果已写入 %s\n", filePath)
|
||||||
if enableUplaod {
|
if enableUplaod {
|
||||||
// 获取文件的绝对路径
|
// 获取文件的绝对路径
|
||||||
absPath, err2 := filepath.Abs(filePath)
|
absPath, err := filepath.Abs(filePath)
|
||||||
if err2 != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to get absolute file path:", err2)
|
fmt.Println("无法获取文件绝对路径:", err)
|
||||||
return
|
return "", ""
|
||||||
}
|
}
|
||||||
// 上传文件并生成短链接
|
// 上传文件并生成短链接
|
||||||
shorturl, err3 := UploadText(absPath)
|
http_url, https_url, err := UploadText(absPath)
|
||||||
if err3 != nil {
|
if err != nil {
|
||||||
fmt.Println("Upload failed, cannot generate short URL.")
|
fmt.Println("上传失败,无法生成链接")
|
||||||
fmt.Println(err3.Error())
|
fmt.Println(err.Error())
|
||||||
return
|
return "", ""
|
||||||
}
|
}
|
||||||
fmt.Println("Upload successful, short URL:", shorturl)
|
return http_url, https_url
|
||||||
|
}
|
||||||
|
return "", ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var StackType string
|
||||||
|
|
||||||
|
type NetCheckResult struct {
|
||||||
|
HasIPv4 bool
|
||||||
|
HasIPv6 bool
|
||||||
|
Connected bool
|
||||||
|
StackType string // "IPv4", "IPv6", "DualStack", "None"
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeResolver(proto, dnsAddr string) *net.Resolver {
|
||||||
|
return &net.Resolver{
|
||||||
|
PreferGo: true,
|
||||||
|
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||||
|
d := net.Dialer{
|
||||||
|
Timeout: 5 * time.Second,
|
||||||
|
}
|
||||||
|
return d.DialContext(ctx, proto, dnsAddr)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 前置联网能力检测
|
||||||
|
func CheckPublicAccess(timeout time.Duration) NetCheckResult {
|
||||||
|
if timeout < 2*time.Second {
|
||||||
|
timeout = 2 * time.Second
|
||||||
|
}
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
resultChan := make(chan string, 8)
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
checks := []struct {
|
||||||
|
Tag string
|
||||||
|
Addr string
|
||||||
|
Kind string // udp4, udp6, http4, http6
|
||||||
|
}{
|
||||||
|
// UDP DNS
|
||||||
|
{"IPv4", "223.5.5.5:53", "udp4"}, // 阿里 DNS
|
||||||
|
{"IPv4", "8.8.8.8:53", "udp4"}, // Google DNS
|
||||||
|
{"IPv6", "[2400:3200::1]:53", "udp6"}, // 阿里 IPv6 DNS
|
||||||
|
{"IPv6", "[2001:4860:4860::8888]:53", "udp6"}, // Google IPv6 DNS
|
||||||
|
// HTTP HEAD
|
||||||
|
{"IPv4", "https://www.baidu.com", "http4"}, // 百度
|
||||||
|
{"IPv4", "https://1.1.1.1", "http4"}, // Cloudflare
|
||||||
|
{"IPv6", "https://[2400:3200::1]", "http6"}, // 阿里 IPv6
|
||||||
|
{"IPv6", "https://[2606:4700::1111]", "http6"}, // Cloudflare IPv6
|
||||||
|
}
|
||||||
|
for _, check := range checks {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(tag, addr, kind string) {
|
||||||
|
defer wg.Done()
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
switch kind {
|
||||||
|
case "udp4", "udp6":
|
||||||
|
dialer := &net.Dialer{
|
||||||
|
Timeout: timeout / 4,
|
||||||
|
}
|
||||||
|
conn, err := dialer.DialContext(ctx, kind, addr)
|
||||||
|
if err == nil && conn != nil {
|
||||||
|
conn.Close()
|
||||||
|
select {
|
||||||
|
case resultChan <- tag:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "http4", "http6":
|
||||||
|
var resolver *net.Resolver
|
||||||
|
if kind == "http4" {
|
||||||
|
resolver = makeResolver("udp4", "223.5.5.5:53")
|
||||||
|
} else {
|
||||||
|
resolver = makeResolver("udp6", "[2400:3200::1]:53")
|
||||||
|
}
|
||||||
|
dialer := &net.Dialer{
|
||||||
|
Timeout: timeout / 4,
|
||||||
|
Resolver: resolver,
|
||||||
|
}
|
||||||
|
transport := &http.Transport{
|
||||||
|
DialContext: dialer.DialContext,
|
||||||
|
MaxIdleConns: 1,
|
||||||
|
MaxIdleConnsPerHost: 1,
|
||||||
|
IdleConnTimeout: time.Second,
|
||||||
|
TLSHandshakeTimeout: timeout / 4,
|
||||||
|
ResponseHeaderTimeout: timeout / 4,
|
||||||
|
DisableKeepAlives: true,
|
||||||
|
}
|
||||||
|
client := &http.Client{
|
||||||
|
Timeout: timeout / 4,
|
||||||
|
Transport: transport,
|
||||||
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||||
|
return http.ErrUseLastResponse
|
||||||
|
},
|
||||||
|
}
|
||||||
|
req, err := http.NewRequestWithContext(ctx, "HEAD", addr, nil)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err == nil && resp != nil {
|
||||||
|
if resp.Body != nil {
|
||||||
|
resp.Body.Close()
|
||||||
|
}
|
||||||
|
if resp.StatusCode < 500 {
|
||||||
|
select {
|
||||||
|
case resultChan <- tag:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(check.Tag, check.Addr, check.Kind)
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
wg.Wait()
|
||||||
|
close(resultChan)
|
||||||
|
}()
|
||||||
|
hasV4 := false
|
||||||
|
hasV6 := false
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case res, ok := <-resultChan:
|
||||||
|
if !ok {
|
||||||
|
goto result
|
||||||
|
}
|
||||||
|
if res == "IPv4" {
|
||||||
|
hasV4 = true
|
||||||
|
}
|
||||||
|
if res == "IPv6" {
|
||||||
|
hasV6 = true
|
||||||
|
}
|
||||||
|
case <-ctx.Done():
|
||||||
|
goto result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result:
|
||||||
|
stack := "None"
|
||||||
|
if hasV4 && hasV6 {
|
||||||
|
stack = "DualStack"
|
||||||
|
} else if hasV4 {
|
||||||
|
stack = "IPv4"
|
||||||
|
} else if hasV6 {
|
||||||
|
stack = "IPv6"
|
||||||
|
}
|
||||||
|
StackType = stack
|
||||||
|
butils.CheckPublicAccess(3 * time.Second) // 设置basics检测,避免部分测试未启用
|
||||||
|
return NetCheckResult{
|
||||||
|
HasIPv4: hasV4,
|
||||||
|
HasIPv6: hasV6,
|
||||||
|
Connected: hasV4 || hasV6,
|
||||||
|
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
|
||||||
|
}
|
||||||
|
31
utils/utils_test.go
Normal file
31
utils/utils_test.go
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package utils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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
|
||||||
|
result := CheckPublicAccess(timeout)
|
||||||
|
if result.Connected {
|
||||||
|
fmt.Printf("✅ 本机有公网连接,类型: %s\n", result.StackType)
|
||||||
|
} else {
|
||||||
|
fmt.Println("❌ 本机未检测到公网连接")
|
||||||
|
}
|
||||||
|
_, _, basicInfo, securityInfo, nt3CheckType := BasicsAndSecurityCheck("zh", "ipv4", false)
|
||||||
|
fmt.Println(basicInfo)
|
||||||
|
fmt.Println(securityInfo)
|
||||||
|
fmt.Println(nt3CheckType)
|
||||||
|
}
|
Reference in New Issue
Block a user