mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-28 20:22:09 +08:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
eea78a7c30 | ||
![]() |
2f5feace7b | ||
![]() |
615ffca90f | ||
![]() |
685fe735f6 | ||
![]() |
5545990854 | ||
![]() |
91d1aa4461 | ||
![]() |
94f9576383 | ||
![]() |
ef91a61d22 |
2
.github/workflows/ci.yaml_back
vendored
2
.github/workflows/ci.yaml_back
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
- name: set up
|
- name: set up
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.22.4
|
go-version: 1.23.4
|
||||||
id: go
|
id: go
|
||||||
- name: check out
|
- name: check out
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 1.22.10
|
go-version: 1.23.4
|
||||||
|
|
||||||
- name: Configure Git for Private Modules
|
- name: Configure Git for Private Modules
|
||||||
run: |
|
run: |
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
# ECS
|
# ECS
|
||||||
|
|
||||||
[](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [](https://www.spiritlhl.net/)
|
[](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml)
|
||||||
|
|
||||||
|
[](https://www.spiritlhl.net/)
|
||||||
|
|
||||||
|
[<img src="https://api.gitsponsors.com/api/badge/img?id=819808844" height="20">](https://api.gitsponsors.com/api/badge/link?p=3sgKiCtfJJbBT6XMAb1xeTadeXZcXeRXLsRG9HW+cFAZcmACmclN+HNM72KLMvwZdHrl7sjG6in68CwoQ7CNh4hoIz2s4ksTxcCIWoH9M3OsR/kHv31sS+0ZqR3O04BD3SqFX8B7ayuM9JCC4zKblg==)
|
||||||
|
|
||||||
融合怪测评项目 - GO 重构版本
|
融合怪测评项目 - GO 重构版本
|
||||||
|
|
||||||
@@ -83,6 +87,8 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
|
|||||||
|
|
||||||
#### **一键命令**
|
#### **一键命令**
|
||||||
|
|
||||||
|
将默认安装依赖,默认更新包管理器,默认非互动模式,下面的非一键命令版本可控制是否安装依赖/是否更新包管理器/默认互动模式
|
||||||
|
|
||||||
- **国际用户无加速:**
|
- **国际用户无加速:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
2
go.mod
2
go.mod
@@ -5,7 +5,7 @@ go 1.23.4
|
|||||||
require (
|
require (
|
||||||
github.com/imroc/req/v3 v3.49.0
|
github.com/imroc/req/v3 v3.49.0
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.23-20250118055400
|
github.com/oneclickvirt/UnlockTests v0.0.25-20250131042210
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722
|
github.com/oneclickvirt/backtrace v0.0.4-20240702140722
|
||||||
github.com/oneclickvirt/basics v0.0.8-20241108124433
|
github.com/oneclickvirt/basics v0.0.8-20241108124433
|
||||||
github.com/oneclickvirt/cputest v0.0.9-20250103063414
|
github.com/oneclickvirt/cputest v0.0.9-20250103063414
|
||||||
|
4
go.sum
4
go.sum
@@ -103,8 +103,8 @@ github.com/nxtrace/NTrace-core v1.3.7 h1:ZnTbPrPqpyeraCvUyNbQTNyl4Gz3NRQDh06WdII
|
|||||||
github.com/nxtrace/NTrace-core v1.3.7/go.mod h1:aW2owz9I+W5i+gJEDmnWli75mB+fuO4UTwdOPMcQHpE=
|
github.com/nxtrace/NTrace-core v1.3.7/go.mod h1:aW2owz9I+W5i+gJEDmnWli75mB+fuO4UTwdOPMcQHpE=
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502 h1:hRIYJ2uEp2N3AH5bP5X6bwfdwWfZQO/2WoqpUJ8+WsY=
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502 h1:hRIYJ2uEp2N3AH5bP5X6bwfdwWfZQO/2WoqpUJ8+WsY=
|
||||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
|
github.com/oneclickvirt/CommonMediaTests v0.0.4-20240704024502/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.23-20250118055400 h1:vDqJOsM6ooL6TYkGZFbkOIaX4JnIkCGPPZI39T48MdA=
|
github.com/oneclickvirt/UnlockTests v0.0.24-20250127123509 h1:QTm/2r+0tKOibglvj/W9RhEqp0sciU916wIZ/xOX6qQ=
|
||||||
github.com/oneclickvirt/UnlockTests v0.0.23-20250118055400/go.mod h1:yXWIZB6iLS88pEd9m4QJi1GENn+7I91zA72y5ONz2Oc=
|
github.com/oneclickvirt/UnlockTests v0.0.24-20250127123509/go.mod h1:yXWIZB6iLS88pEd9m4QJi1GENn+7I91zA72y5ONz2Oc=
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722 h1:UJ/VWf+ZbhGarc9HcHMIyenpmX+b2LxkXu0hlLk3Gxs=
|
github.com/oneclickvirt/backtrace v0.0.4-20240702140722 h1:UJ/VWf+ZbhGarc9HcHMIyenpmX+b2LxkXu0hlLk3Gxs=
|
||||||
github.com/oneclickvirt/backtrace v0.0.4-20240702140722/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8=
|
github.com/oneclickvirt/backtrace v0.0.4-20240702140722/go.mod h1:zvsC7xY/WZqs5KL2JB967OVnuqjNbxu9bW6wXRLo5h8=
|
||||||
github.com/oneclickvirt/basics v0.0.8-20241108124433 h1:eKZcoNoa9uLWmfisk+qN/QOvSGT4ajCmZdZfIAcHG+o=
|
github.com/oneclickvirt/basics v0.0.8-20241108124433 h1:eKZcoNoa9uLWmfisk+qN/QOvSGT4ajCmZdZfIAcHG+o=
|
||||||
|
2
goecs.go
2
goecs.go
@@ -39,7 +39,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ecsVersion = "v0.1.6"
|
ecsVersion = "v0.1.10"
|
||||||
menuMode bool
|
menuMode bool
|
||||||
onlyChinaTest bool
|
onlyChinaTest bool
|
||||||
input, choice string
|
input, choice string
|
||||||
|
4
goecs.sh
4
goecs.sh
@@ -168,8 +168,8 @@ goecs_check() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
if [ -z "$ECS_VERSION" ]; then
|
if [ -z "$ECS_VERSION" ]; then
|
||||||
_yellow "Unable to get version info, using default version 0.1.6"
|
_yellow "Unable to get version info, using default version 0.1.8"
|
||||||
ECS_VERSION="0.1.6"
|
ECS_VERSION="0.1.8"
|
||||||
fi
|
fi
|
||||||
# Check if original goecs command exists
|
# Check if original goecs command exists
|
||||||
version_output=""
|
version_output=""
|
||||||
|
@@ -153,6 +153,7 @@ func BasicsAndSecurityCheck(language, nt3CheckType string, securtyCheckStatus bo
|
|||||||
basicInfo := systemInfo + ipInfo
|
basicInfo := systemInfo + ipInfo
|
||||||
if errv6 == nil && ipv6Info != "" {
|
if errv6 == nil && ipv6Info != "" {
|
||||||
basicInfo += ipv6Info
|
basicInfo += ipv6Info
|
||||||
|
basicInfo += "\n"
|
||||||
}
|
}
|
||||||
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") {
|
if strings.Contains(ipInfo, "IPV4") && strings.Contains(ipInfo, "IPV6") {
|
||||||
uts.IPV4 = true
|
uts.IPV4 = true
|
||||||
@@ -254,11 +255,21 @@ func UploadText(absPath string) (string, string, error) {
|
|||||||
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 "", "", fmt.Errorf("failed to open file: %w", err)
|
return "", "", fmt.Errorf("failed to open file: %w", err)
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
// 获取文件信息并检查大小
|
||||||
|
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) {
|
upload := func(url string) (string, string, error) {
|
||||||
file, err := os.Open(absPath)
|
file, err := os.Open(absPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -287,10 +298,12 @@ func UploadText(absPath string) (string, string, error) {
|
|||||||
}
|
}
|
||||||
return "", "", fmt.Errorf("upload failed for %s with status code: %d", url, resp.StatusCode)
|
return "", "", fmt.Errorf("upload failed for %s with status code: %d", url, resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
// 尝试上传到主URL
|
||||||
httpURL, httpsURL, err := upload(primaryURL)
|
httpURL, httpsURL, err := upload(primaryURL)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return httpURL, httpsURL, nil
|
return httpURL, httpsURL, nil
|
||||||
}
|
}
|
||||||
|
// 尝试上传到备份URL
|
||||||
httpURL, httpsURL, err = upload(backupURL)
|
httpURL, httpsURL, err = upload(backupURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", fmt.Errorf("failed to upload to both primary and backup URLs: %w", err)
|
return "", "", fmt.Errorf("failed to upload to both primary and backup URLs: %w", err)
|
||||||
|
Reference in New Issue
Block a user