Skip to content

Commit cd249df

Browse files
committed
fix(ui): Ignore showing APIKEY for security
1 parent 092b30a commit cd249df

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

internal/handler/initialization.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ func (h *InitializationHandler) CheckStatus(c *gin.Context) {
179179
})
180180
return
181181
}
182+
// ignore api key in response for security
183+
for _, model := range models {
184+
model.Parameters.APIKey = ""
185+
}
182186

183187
logger.Info(ctx, "System is already initialized")
184188
c.JSON(http.StatusOK, gin.H{

scripts/build_images.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,14 @@ check_platform() {
7878
log_info "检测系统平台信息..."
7979
if [ "$(uname -m)" = "x86_64" ]; then
8080
export PLATFORM="linux/amd64"
81+
export TARGETARCH="amd64"
8182
elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then
8283
export PLATFORM="linux/arm64"
84+
export TARGETARCH="arm64"
8385
else
8486
log_warning "未识别的平台类型:$(uname -m),将使用默认平台 linux/amd64"
8587
export PLATFORM="linux/amd64"
88+
export TARGETARCH="amd64"
8689
fi
8790
log_info "当前平台:$PLATFORM"
8891
}
@@ -120,6 +123,7 @@ build_docreader_image() {
120123
docker build \
121124
--platform $PLATFORM \
122125
--build-arg PLATFORM=$PLATFORM \
126+
--build-arg TARGETARCH=$TARGETARCH \
123127
-f docker/Dockerfile.docreader \
124128
-t wechatopenai/weknora-docreader:latest \
125129
.

0 commit comments

Comments
 (0)