Compare commits

..

8 Commits

Author SHA1 Message Date
spiritsoul
eea78a7c30 v0.1.10 - 更新流媒体检测 2025-01-31 12:29:06 +08:00
spiritsoul
2f5feace7b v0.1.9 - 避免错误文件的使用 2025-01-27 21:09:04 +08:00
spiritlhl
615ffca90f Update README.md 2025-01-21 09:34:46 +08:00
spiritlhl
685fe735f6 Update README.md 2025-01-20 10:45:17 +08:00
spiritlhl
5545990854 升级Action中默认的Golang版本 1.22 --> 1.23 2025-01-18 19:16:29 +08:00
spiritlhl
91d1aa4461 v0.1.8 - 在存在IPV6信息时修复排版缺少一个换行符 2025-01-18 19:11:13 +08:00
spiritlhl
94f9576383 Update README.md 2025-01-18 15:31:58 +08:00
spiritlhl
ef91a61d22 v0.1.7 2025-01-18 15:08:14 +08:00
8 changed files with 28 additions and 9 deletions

View File

@@ -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

View File

@@ -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: |

View File

@@ -1,6 +1,10 @@
# ECS # ECS
[![release](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fecs&count_bg=%2357DEFF&title_bg=%23000000&icon=cliqz.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://www.spiritlhl.net/) [![release](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml/badge.svg)](https://github.com/oneclickvirt/ecs/actions/workflows/main.yaml)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2Fecs&count_bg=%2357DEFF&title_bg=%23000000&icon=cliqz.svg&icon_color=%23E7E7E7&title=hits&edge_flat=false)](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
View File

@@ -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
View File

@@ -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=

View File

@@ -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

View File

@@ -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=""

View File

@@ -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)