From 805c2a045e54cf2df374e7711dc09843490aea52 Mon Sep 17 00:00:00 2001 From: RockYang Date: Mon, 24 Mar 2025 17:13:16 +0800 Subject: [PATCH] merge release v4.1.7 --- api/core/app_server.go | 34 ++++++++++++++++++++++++++++------ api/main.go | 2 +- deploy/conf/config.toml | 2 +- deploy/docker-compose.yaml | 4 ++-- web/.env.development | 2 +- web/.env.production | 2 +- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/api/core/app_server.go b/api/core/app_server.go index 3993f21c..3796944c 100644 --- a/api/core/app_server.go +++ b/api/core/app_server.go @@ -15,12 +15,6 @@ import ( "geekai/store/model" "geekai/utils" "geekai/utils/resp" - "github.com/gin-gonic/gin" - "github.com/go-redis/redis/v8" - "github.com/golang-jwt/jwt/v5" - "github.com/nfnt/resize" - "golang.org/x/image/webp" - "gorm.io/gorm" "image" "image/jpeg" "io" @@ -29,6 +23,15 @@ import ( "runtime/debug" "strings" "time" + + "github.com/gin-gonic/gin" + "github.com/go-redis/redis/v8" + "github.com/golang-jwt/jwt/v5" + "github.com/imroc/req/v3" + "github.com/nfnt/resize" + "github.com/shirou/gopsutil/host" + "golang.org/x/image/webp" + "gorm.io/gorm" ) type AppServer struct { @@ -71,6 +74,25 @@ func (s *AppServer) Run(db *gorm.DB) error { return fmt.Errorf("failed to decode system config: %v", err) } logger.Infof("http://%s", s.Config.Listen) + + // 统计安装信息 + go func() { + info, err := host.Info() + if err == nil { + apiURL := fmt.Sprintf("%s/%s", s.Config.ApiConfig.ApiURL, "api/installs/push") + timestamp := time.Now().Unix() + product := "geekai-plus" + signStr := fmt.Sprintf("%s#%s#%d", product, info.HostID, timestamp) + sign := utils.Sha256(signStr) + resp, err := req.C().R().SetBody(map[string]interface{}{"product": product, "device_id": info.HostID, "timestamp": timestamp, "sign": sign}).Post(apiURL) + if err != nil { + logger.Errorf("register install info failed: %v", err) + } else { + logger.Debugf("register install info success: %v", resp.String()) + } + } + }() + return s.Engine.Run(s.Config.Listen) } diff --git a/api/main.go b/api/main.go index 843f17ca..18b4a5a2 100644 --- a/api/main.go +++ b/api/main.go @@ -173,7 +173,7 @@ func main() { // License 服务 fx.Provide(service.NewLicenseService), fx.Invoke(func(licenseService *service.LicenseService) { - licenseService.SyncLicense() + // licenseService.SyncLicense() }), // MidJourney service pool diff --git a/deploy/conf/config.toml b/deploy/conf/config.toml index b5226592..21592f26 100644 --- a/deploy/conf/config.toml +++ b/deploy/conf/config.toml @@ -20,7 +20,7 @@ TikaHost = "http://tika:9998" DB = 0 [ApiConfig] - ApiURL = "http://sapi.geekai.me" + ApiURL = "https://sapi.geekai.me" AppId = "" Token = "" diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml index af00f91b..bdd6faa9 100644 --- a/deploy/docker-compose.yaml +++ b/deploy/docker-compose.yaml @@ -68,7 +68,7 @@ services: # 后端 API 程序 geekai-api: - image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:v4.1.6-amd64 + image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:v4.1.7-amd64 container_name: geekai-api restart: always depends_on: @@ -92,7 +92,7 @@ services: # 前端应用 geekai-web: - image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:v4.1.6-amd64 + image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:v4.1.7-amd64 container_name: geekai-web restart: always depends_on: diff --git a/web/.env.development b/web/.env.development index d563a103..c243a5b3 100644 --- a/web/.env.development +++ b/web/.env.development @@ -6,6 +6,6 @@ VUE_APP_ADMIN_USER=admin VUE_APP_ADMIN_PASS=admin123 VUE_APP_KEY_PREFIX=GeekAI_DEV_ VUE_APP_TITLE="Geek-AI 创作系统" -VUE_APP_VERSION=v4.1.6 +VUE_APP_VERSION=v4.1.7 VUE_APP_DOCS_URL=https://docs.geekai.me VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai diff --git a/web/.env.production b/web/.env.production index 32177b68..a83167bc 100644 --- a/web/.env.production +++ b/web/.env.production @@ -2,6 +2,6 @@ VUE_APP_API_HOST= VUE_APP_WS_HOST= VUE_APP_KEY_PREFIX=GeekAI_ VUE_APP_TITLE="Geek-AI 创作系统" -VUE_APP_VERSION=v4.1.6 +VUE_APP_VERSION=v4.1.7 VUE_APP_DOCS_URL=https://docs.geekai.me VUE_APP_GIT_URL=https://github.com/yangjian102621/geekai