From 880c199ce4bbb4fe34116ed39225fc576a3464ae Mon Sep 17 00:00:00 2001 From: sun <3371392206@qq.com> Date: Mon, 11 May 2026 17:58:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Reapply=20"ci:=20=E6=B7=BB=E5=8A=A0Gitea?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=94=A8=E4=BA=8EGo=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=83=A8=E7=BD=B2=E5=88=B0=E5=AE=9D=E5=A1=94"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 25e09cd54fd9052a83dbc14e385fbe2c20e65f69. --- .gitea/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..a8840dd --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Go CI/CD Deploy to Baota + +on: + push: + branches: [ main, master ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: 拉取代码 + uses: actions/checkout@v4 + + - name: 安装 Go 环境 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + + - name: 编译 Go 项目 + run: | + # 静态编译,无依赖,适合 Linux 部署 + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app main.go + + - name: 部署到宝塔项目目录并重启服务 + run: | + # 1. 停止旧进程 + pkill -f Volcano-Engine-TTS-UI || true + + # 2. 复制新程序到项目目录 + cp ./app /www/wwwroot/Volcano-Engine-TTS-UI/ + + # 3. 赋予执行权限 + chmod +x /www/wwwroot/Volcano-Engine-TTS-UI/app + + # 4. 启动新进程(后台运行) + nohup /www/wwwroot/Volcano-Engine-TTS-UI/app > /www/wwwroot/Volcano-Engine-TTS-UI/app.log 2>&1 & From cd70157aea140fbc42ed15f8417cf037fa19b4f3 Mon Sep 17 00:00:00 2001 From: sun <3371392206@qq.com> Date: Tue, 19 May 2026 18:41:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=20Gitea=20CI/CD=20=E9=83=A8=E7=BD=B2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除了原本用于部署到宝塔的工作流文件,清理冗余的CI配置 --- .gitea/workflows/deploy.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml deleted file mode 100644 index a8840dd..0000000 --- a/.gitea/workflows/deploy.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Go CI/CD Deploy to Baota - -on: - push: - branches: [ main, master ] - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: 拉取代码 - uses: actions/checkout@v4 - - - name: 安装 Go 环境 - uses: actions/setup-go@v5 - with: - go-version: 1.22 - - - name: 编译 Go 项目 - run: | - # 静态编译,无依赖,适合 Linux 部署 - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app main.go - - - name: 部署到宝塔项目目录并重启服务 - run: | - # 1. 停止旧进程 - pkill -f Volcano-Engine-TTS-UI || true - - # 2. 复制新程序到项目目录 - cp ./app /www/wwwroot/Volcano-Engine-TTS-UI/ - - # 3. 赋予执行权限 - chmod +x /www/wwwroot/Volcano-Engine-TTS-UI/app - - # 4. 启动新进程(后台运行) - nohup /www/wwwroot/Volcano-Engine-TTS-UI/app > /www/wwwroot/Volcano-Engine-TTS-UI/app.log 2>&1 & From d1e7f9a4dd09b1c636c466c24b90fefafc43037b Mon Sep 17 00:00:00 2001 From: "3371392206@qq.com" <3371392206@qq.com> Date: Sun, 23 Aug 2026 13:15:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=20ratelimit=5Fm?= =?UTF-8?q?iddleware.go.tmp=20=E4=B8=B4=E6=97=B6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与 ratelimit_middleware.go 内容完全重复(SHA256 一致,1116 字节), 且无任何代码引用 .tmp 路径,属于误提交的开发期残留文件。 --- middleware/ratelimit_middleware.go.tmp | 32 -------------------------- 1 file changed, 32 deletions(-) delete mode 100644 middleware/ratelimit_middleware.go.tmp diff --git a/middleware/ratelimit_middleware.go.tmp b/middleware/ratelimit_middleware.go.tmp deleted file mode 100644 index bbbb9f0..0000000 --- a/middleware/ratelimit_middleware.go.tmp +++ /dev/null @@ -1,32 +0,0 @@ -package middleware - -import ( - "log" - "net/http" -) - -func RateLimit(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - clientIP := GetClientIP(r) - if !GlobalRateLimiter.Allow(clientIP) { - log.Printf("警告: 已超过IP速率限制,拒绝请求 - 客户端IP: %s", clientIP) - SendJSONError(w, http.StatusTooManyRequests, "Rate limit exceeded. Please try again later.", "rate_limit_error", "rate_limit_exceeded") - return - } - next.ServeHTTP(w, r) - }) -} - -func ConcurrencyLimit(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - select { - case ConcurrencySem <- struct{}{}: - defer func() { <-ConcurrencySem }() - next.ServeHTTP(w, r) - default: - log.Printf("警告: 已达到最大并发请求数限制,拒绝请求 - 客户端IP: %s", GetClientIP(r)) - SendJSONError(w, http.StatusServiceUnavailable, "Server is busy, maximum concurrent requests reached. Please try again later.", "concurrency_limit_error", "max_concurrent_requests") - return - } - }) -}