Compare commits

...
4 Commits
Author SHA1 Message Date
Akizon77 f0cc0fba38 fix: pin 1.5.1 frontend release source 2026-09-24 23:21:05 +08:00
Akizon77 1d972c42dc fix: pin 1.5.1-rc1 frontend version 2026-09-24 17:25:06 +08:00
Akizon f089b08b3a 裁剪1下 2026-09-24 17:21:44 +08:00
Akizon 6e70263c50 重定向旧版本的主题接口? 2026-09-24 17:21:37 +08:00
8 changed files with 31 additions and 8 deletions

No files matched your search

+5 -1
View File
@@ -98,7 +98,11 @@ jobs:
fi
VERSION="${{ github.sha }}"
VERSION_HASH="${{ github.sha }}"
go build -trimpath -ldflags="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}" -o $BINARY_NAME
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
if [ "${{ matrix.goos }}" = "linux" ]; then
LDFLAGS="$LDFLAGS -extldflags=-Wl,--strip-all"
fi
go build -trimpath -ldflags="$LDFLAGS" -o "$BINARY_NAME"
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
GOARCH: amd64
run: |
VERSION_SHA="${{ github.sha }}"
go build -ldflags "-X github.com/komari-monitor/komari/utils.CurrentVersion=dev -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_SHA}" -o komari .
go build -ldflags "-s -w -extldflags=-Wl,--strip-all -X github.com/komari-monitor/komari/utils.CurrentVersion=dev -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_SHA}" -o komari .
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
+1 -1
View File
@@ -50,7 +50,7 @@ jobs:
run: |
VERSION="${{ github.ref_name }}"
VERSION_HASH="${{ github.sha }}"
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
LDFLAGS="-s -w -extldflags=-Wl,--strip-all -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
echo "Building for linux/amd64..."
GOARCH=amd64 CC="zig cc -target x86_64-linux-musl" go build -trimpath -ldflags="$LDFLAGS" -o komari-linux-amd64
+5 -1
View File
@@ -102,7 +102,11 @@ jobs:
run: |
BINARY_NAME=komari-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.binary_extension }}
VERSION_HASH="$(git rev-parse HEAD)"
go build -trimpath -ldflags="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${RELEASE_TAG} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}" -o "$BINARY_NAME"
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${RELEASE_TAG} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
if [ "${{ matrix.goos }}" = "linux" ]; then
LDFLAGS="$LDFLAGS -extldflags=-Wl,--strip-all"
fi
go build -trimpath -ldflags="$LDFLAGS" -o "$BINARY_NAME"
- name: Upload binary to release
env:
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
VERSION: ${{ github.event.inputs.version }}
run: |
VERSION_HASH="${{ github.sha }}"
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
LDFLAGS="-s -w -extldflags=-Wl,--strip-all -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
echo "Building for linux/amd64..."
GOARCH=amd64 CC="zig cc -target x86_64-linux-musl" go build -trimpath -ldflags="$LDFLAGS" -o komari-linux-amd64
+8 -2
View File
@@ -24,7 +24,9 @@ jobs:
TAG: ${{ github.event.release.tag_name }}
run: |
frontend_ref=""
if [[ "$TAG" =~ ^(.+)-fix[0-9]+$ ]]; then
if [[ "$TAG" == "1.5.1" || "$TAG" == "1.5.1-rc1" ]]; then
frontend_ref="1.5.0-fix1"
elif [[ "$TAG" =~ ^(.+)-fix[0-9]+$ ]]; then
frontend_ref="${BASH_REMATCH[1]}"
fi
echo "frontend_ref=$frontend_ref" >> "$GITHUB_OUTPUT"
@@ -121,7 +123,11 @@ jobs:
fi
VERSION="${{ github.event.release.tag_name }}"
VERSION_HASH="${{ github.sha }}" # Use commit SHA for hash
go build -trimpath -ldflags="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}" -o $BINARY_NAME
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
if [ "${{ matrix.goos }}" = "linux" ]; then
LDFLAGS="$LDFLAGS -extldflags=-Wl,--strip-all"
fi
go build -trimpath -ldflags="$LDFLAGS" -o "$BINARY_NAME"
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
+5 -1
View File
@@ -150,7 +150,11 @@ jobs:
fi
VERSION="${{ needs.prepare.outputs.version }}"
VERSION_HASH="${{ github.sha }}" # Use commit SHA for hash
go build -trimpath -ldflags="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}" -o $BINARY_NAME
LDFLAGS="-s -w -X github.com/komari-monitor/komari/utils.CurrentVersion=${VERSION} -X github.com/komari-monitor/komari/utils.VersionHash=${VERSION_HASH}"
if [ "${{ matrix.goos }}" = "linux" ]; then
LDFLAGS="$LDFLAGS -extldflags=-Wl,--strip-all"
fi
go build -trimpath -ldflags="$LDFLAGS" -o "$BINARY_NAME"
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
+5
View File
@@ -1,6 +1,8 @@
package router
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/komari-monitor/komari/web/api"
"github.com/komari-monitor/komari/web/api/admin"
@@ -20,6 +22,9 @@ func Register(r *gin.Engine) {
r.Any("/ping", func(c *gin.Context) {
c.String(200, "pong")
})
r.GET("/admin", func(c *gin.Context) {
c.Redirect(http.StatusFound, "/admin/dashboard")
})
registerPublicRoutes(r)
registerAgentRoutes(r)