From 7c76a4e42c49e9f8fd8005185e8175648ba9f6f9 Mon Sep 17 00:00:00 2001 From: yyg-max <175597134+yyg-max@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:21:48 +0800 Subject: [PATCH] fix(security): upgrade Go and Node.js to patched versions and align build configurations --- .github/workflows/build_frontend.yml | 2 +- .github/workflows/build_image.yml | 2 +- .github/workflows/codeql.yml | 5 +++++ .github/workflows/copilot-setup-steps.yml | 4 ++-- .github/workflows/eslint.yml | 2 +- README.md | 8 ++++---- frontend/Dockerfile | 2 +- frontend/README.md | 2 +- frontend/package.json | 3 +++ go.mod | 2 +- mise.toml | 4 ++-- 11 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_frontend.yml b/.github/workflows/build_frontend.yml index eac227bb..716184e2 100644 --- a/.github/workflows/build_frontend.yml +++ b/.github/workflows/build_frontend.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24.22.1" cache: 'pnpm' cache-dependency-path: frontend/pnpm-lock.yaml diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index 1d1bdb17..69ae8091 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.26" + go-version-file: "go.mod" check-latest: true # download Go modules diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 16edd5ec..8660cd52 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,6 +29,11 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Go + if: matrix.language == 'go' + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 69b36659..576a8963 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24.22.1" cache: "pnpm" cache-dependency-path: frontend/pnpm-lock.yaml @@ -39,7 +39,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.24" + go-version-file: "go.mod" - name: Install dependencies run: | diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 9f959cbe..c265e276 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24.22.1" cache: 'pnpm' cache-dependency-path: frontend/pnpm-lock.yaml diff --git a/README.md b/README.md index f16658b6..03a5fcfa 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 🚀 Linux Do 社区 CDK (Content Distribution Kit) 快速分享平台 [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Go Version](https://img.shields.io/badge/Go-1.24-blue.svg)](https://golang.org/) +[![Go Version](https://img.shields.io/badge/Go-1.26.10-blue.svg)](https://golang.org/) [![Next.js](https://img.shields.io/badge/Next.js-15-black.svg)](https://nextjs.org/) [![React](https://img.shields.io/badge/React-19-blue.svg)](https://reactjs.org/) @@ -50,7 +50,7 @@ LINUX DO CDK 是一个为 Linux Do 社区打造的内容分发工具平台,旨 ## 🛠️ 技术栈 ### 后端 -- **[Go 1.24](https://go.dev/doc)** - 主要开发语言 +- **[Go 1.26.10](https://go.dev/doc)** - 主要开发语言 - **[Gin](https://github.com/gin-gonic/gin)** - Web 框架 - **[GORM](https://github.com/go-gorm/gorm)** - ORM 框架 - **[Redis](https://github.com/redis/redis)** - 缓存和会话存储 @@ -68,8 +68,8 @@ LINUX DO CDK 是一个为 Linux Do 社区打造的内容分发工具平台,旨 ## 📋 环境要求 -- **Go** >= 1.24 -- **Node.js** >= 18.0 +- **Go** 1.26.10 +- **Node.js** 24.22.1 - **MySQL** >= 8.0 - **Redis** >= 6.0 - **pnpm** >= 8.0 (推荐) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 5db7b68b..7f2ba7f6 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # ---- base stage ---- -FROM node:22-alpine AS base +FROM node:24.22.1-alpine AS base ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" diff --git a/frontend/README.md b/frontend/README.md index 47c190e1..ecd50623 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -43,7 +43,7 @@ ### 环境要求 -- **Node.js** >= 18.0 +- **Node.js** 24.22.1 - **pnpm** >= 8.0 (推荐) 或 **npm** >= 9.0 ### 安装与启动 diff --git a/frontend/package.json b/frontend/package.json index 3001bbab..19ba3ead 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,6 +3,9 @@ "version": "1.2.3", "buildDate": "2026-04-22 16:00:00", "private": true, + "engines": { + "node": ">=24.22.1 <25" + }, "scripts": { "dev": "next dev --turbopack", "build": "next build", diff --git a/go.mod b/go.mod index 0c7be3e5..88326b46 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/linux-do/cdk -go 1.26.9 +go 1.26.10 require ( github.com/ClickHouse/clickhouse-go/v2 v2.23.2 diff --git a/mise.toml b/mise.toml index 20a7612a..a0a8f621 100644 --- a/mise.toml +++ b/mise.toml @@ -1,3 +1,3 @@ [tools] -go = "1.26.9" -node = "24" +go = "1.26.10" +node = "24.22.1"