From cd249df8c897acfc8914dbe5355bf8d826237bb8 Mon Sep 17 00:00:00 2001 From: wizardchen Date: Mon, 15 Sep 2025 14:42:31 +0800 Subject: [PATCH] fix(ui): Ignore showing APIKEY for security --- internal/handler/initialization.go | 4 ++++ scripts/build_images.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/internal/handler/initialization.go b/internal/handler/initialization.go index c3062dfad..3a2a21fa0 100644 --- a/internal/handler/initialization.go +++ b/internal/handler/initialization.go @@ -179,6 +179,10 @@ func (h *InitializationHandler) CheckStatus(c *gin.Context) { }) return } + // ignore api key in response for security + for _, model := range models { + model.Parameters.APIKey = "" + } logger.Info(ctx, "System is already initialized") c.JSON(http.StatusOK, gin.H{ diff --git a/scripts/build_images.sh b/scripts/build_images.sh index 3862dc73a..40869ec19 100755 --- a/scripts/build_images.sh +++ b/scripts/build_images.sh @@ -78,11 +78,14 @@ check_platform() { log_info "检测系统平台信息..." if [ "$(uname -m)" = "x86_64" ]; then export PLATFORM="linux/amd64" + export TARGETARCH="amd64" elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then export PLATFORM="linux/arm64" + export TARGETARCH="arm64" else log_warning "未识别的平台类型:$(uname -m),将使用默认平台 linux/amd64" export PLATFORM="linux/amd64" + export TARGETARCH="amd64" fi log_info "当前平台:$PLATFORM" } @@ -120,6 +123,7 @@ build_docreader_image() { docker build \ --platform $PLATFORM \ --build-arg PLATFORM=$PLATFORM \ + --build-arg TARGETARCH=$TARGETARCH \ -f docker/Dockerfile.docreader \ -t wechatopenai/weknora-docreader:latest \ .