7 Commits

Author SHA1 Message Date
admin c7c10c7c17 fix: correct install handler initialization
Docker Build / Build and Push Docker Image (push) Successful in 2m10s
Release / Build and Release (push) Successful in 1m0s
2026-06-22 21:40:09 +00:00
admin ee54689fe9 fix: remove duplicate /install route registration
Docker Build / Build and Push Docker Image (push) Failing after 10s
Release / Build and Release (push) Failing after 9s
2026-06-22 21:28:15 +00:00
admin f1b01ec18f fix: enable CGO for SQLite3 in Docker build
Docker Build / Build and Push Docker Image (push) Successful in 2m12s
Release / Build and Release (push) Successful in 1m0s
2026-06-22 21:18:41 +00:00
admin d271a786d2 fix: use Go 1.24 with GOTOOLCHAIN=auto for Docker build
Docker Build / Build and Push Docker Image (push) Failing after 1m33s
Release / Build and Release (push) Successful in 1m0s
2026-06-22 21:02:28 +00:00
admin 005d0aa683 fix: update Dockerfile to Go 1.25
Docker Build / Build and Push Docker Image (push) Failing after 1m17s
Release / Build and Release (push) Successful in 1m0s
2026-06-22 20:57:36 +00:00
admin 57624f5953 feat: add Dockerfile for CI build
Docker Build / Build and Push Docker Image (push) Failing after 24s
Release / Build and Release (push) Successful in 1m2s
2026-06-22 20:50:09 +00:00
admin 7b0356422d fix(ci): remove optional secrets, require all deploy secrets to be set
Docker Build / Build and Push Docker Image (push) Failing after 12s
Release / Build and Release (push) Successful in 1m4s
2026-06-22 20:34:16 +00:00
3 changed files with 50 additions and 20 deletions
+5 -5
View File
@@ -128,9 +128,9 @@ jobs:
- name: Deploy via SSH
if: success()
run: |
if [ -z "${{ secrets.DEPLOY_SSH_HOST }}" ]; then
echo "DEPLOY_SSH_HOST not set, skip deploy"
exit 0
if command -v apk &> /dev/null; then
apk add --no-cache sshpass openssh-client
elif command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y sshpass openssh-client
fi
apk add --no-cache sshpass openssh-client 2>/dev/null || (apt-get update && apt-get install -y sshpass openssh-client) 2>/dev/null || true
sshpass -p "${{ secrets.DEPLOY_SSH_PASS }}" ssh -o StrictHostKeyChecking=no -p ${{ secrets.DEPLOY_SSH_PORT || 22 }} ${{ secrets.DEPLOY_SSH_USER }}@${{ secrets.DEPLOY_SSH_HOST }} "cd ${{ secrets.DEPLOY_DIR || '/opt/nuyue' }} && docker compose pull && docker compose up -d"
sshpass -p "${{ secrets.DEPLOY_SSH_PASS }}" ssh -o StrictHostKeyChecking=no -p "${{ secrets.DEPLOY_SSH_PORT }}" "${{ secrets.DEPLOY_SSH_USER }}"@"${{ secrets.DEPLOY_SSH_HOST }}" "cd ${{ secrets.DEPLOY_DIR }} && docker compose pull && docker compose up -d"
+43
View File
@@ -0,0 +1,43 @@
# Build stage
FROM golang:1.24-alpine AS builder
ENV GOTOOLCHAIN=auto
# Install build dependencies for SQLite3
RUN apk add --no-cache git gcc musl-dev
WORKDIR /app
# Copy go mod files
COPY server/go.mod server/go.sum ./
RUN go mod download
# Copy source code
COPY server/ ./
COPY agent/ ../agent/
# Build server with CGO enabled for SQLite3
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w -linkmode external -extldflags '-static'" -o /nuyue-server ./cmd/server
# Build agent (no CGO needed)
RUN cd ../agent && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-agent ./cmd/agent
# Runtime stage
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
# Copy binaries
COPY --from=builder /nuyue-server /app/
COPY --from=builder /nuyue-agent /app/
# Copy frontend (built by CI)
COPY server/embed/dist /app/embed/dist
# Expose ports
EXPOSE 8080 9090
# Run server
CMD ["/app/nuyue-server"]
+2 -15
View File
@@ -201,9 +201,8 @@ func setupRouter(app *Application) *gin.Engine {
})
})
// API v1
// 安装向导路由(未安装时)
if !app.Config.IsInstalled() {
// 安装向导(未安装时可用)
installRepo := install.NewRepository(app.DB)
installSvc := install.NewService(installRepo, "./config.yaml")
installHandler := install.NewHandler(installSvc)
@@ -215,17 +214,5 @@ func setupRouter(app *Application) *gin.Engine {
// TODO: 添加其他模块路由
}
// 安装页面
r.GET("/install", func(c *gin.Context) {
if app.Config.IsInstalled() {
c.Redirect(http.StatusFound, "/login")
return
}
// TODO: 返回前端安装页面
c.JSON(http.StatusOK, gin.H{
"message": "安装向导页面(前端待实现)",
})
})
return r
}
}