feat(dashboard): show build git SHA in header + profile page

The version label now renders 'v0.5.86 (<shortsha>)' when the flake build
injects NEXT_PUBLIC_GIT_SHA (git commit identity of the deployed artifact),
so any running dashboard traces to its exact source commit. Falls back to
semver-only when the env var is absent (local dev). Also fixes the profile
page repo link back to asepharyana/9router (MIBP merge target), replacing
the mhiqrambg fork label left over from the merge.
This commit is contained in:
asepharyana
2026-09-23 14:45:08 +07:00
parent 3f0d904d1d
commit e0eef05b6b
4 changed files with 11 additions and 4 deletions
+3
View File
@@ -60,6 +60,9 @@
bun install 2>&1
echo "=== bun run build (next build --webpack) ==="
# Inline the git SHA into the client bundle so the dashboard header
# shows "v0.5.86 (<shortsha>)" — traceable build identity in the UI.
export NEXT_PUBLIC_GIT_SHA="${rev}"
bun run build 2>&1
echo "=== Build complete ==="
@@ -1685,15 +1685,15 @@ export default function ProfilePage() {
{/* App Info */}
<div className="text-center text-xs sm:text-sm text-text-muted py-4">
<p>{APP_CONFIG.name} v{APP_CONFIG.version}</p>
<p>{APP_CONFIG.name} v{APP_CONFIG.version}{APP_CONFIG.gitSha ? ` (${APP_CONFIG.gitSha})` : ""}</p>
<p className="mt-1">{isRemoteHost ? "Remote Mode" : "Local Mode - All data stored on your machine"}</p>
<a
href="https://github.com/mhiqrambg/9router-mibp-version"
href="https://github.com/asepharyana/9router"
target="_blank"
rel="noreferrer"
className="inline-block mt-1 text-[11px] hover:text-primary transition-colors"
>
MIBP Edition
asepharyana/9router · MIBP merge
</a>
</div>
</div>
+1 -1
View File
@@ -128,7 +128,7 @@ export default function Sidebar({ onClose }) {
<h1 className="text-lg font-semibold tracking-tight text-text-main">
{APP_CONFIG.name}
</h1>
<span className="text-xs text-text-muted">v{APP_CONFIG.version}</span>
<span className="text-xs text-text-muted">v{APP_CONFIG.version}{APP_CONFIG.gitSha ? ` (${APP_CONFIG.gitSha})` : ""}</span>
</div>
</Link>
{updateInfo && (
+4
View File
@@ -5,6 +5,10 @@ export const APP_CONFIG = {
name: "9Router Proxy",
description: "AI Infrastructure Management",
version: pkg.version,
// Build identity = git short SHA, injected at build time by the Nix flake
// (NEXT_PUBLIC_GIT_SHA). Falls back to "dirty"/undefined in dev where the
// env var is absent, so the dashboard shows just the semver.
gitSha: process.env.NEXT_PUBLIC_GIT_SHA || null,
};
// GitHub configuration