From e0eef05b6be03f4c6a4d5bd4d2644f8249060f3d Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 23 Sep 2026 14:45:08 +0700 Subject: [PATCH] feat(dashboard): show build git SHA in header + profile page The version label now renders 'v0.5.86 ()' 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. --- flake.nix | 3 +++ src/app/(dashboard)/dashboard/profile/page.js | 6 +++--- src/shared/components/Sidebar.js | 2 +- src/shared/constants/config.js | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index caf8a4ce..57d760cb 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ()" — traceable build identity in the UI. + export NEXT_PUBLIC_GIT_SHA="${rev}" bun run build 2>&1 echo "=== Build complete ===" diff --git a/src/app/(dashboard)/dashboard/profile/page.js b/src/app/(dashboard)/dashboard/profile/page.js index 3628eb4c..ce1cd567 100644 --- a/src/app/(dashboard)/dashboard/profile/page.js +++ b/src/app/(dashboard)/dashboard/profile/page.js @@ -1685,15 +1685,15 @@ export default function ProfilePage() { {/* App Info */}
-

{APP_CONFIG.name} v{APP_CONFIG.version}

+

{APP_CONFIG.name} v{APP_CONFIG.version}{APP_CONFIG.gitSha ? ` (${APP_CONFIG.gitSha})` : ""}

{isRemoteHost ? "Remote Mode" : "Local Mode - All data stored on your machine"}

- MIBP Edition + asepharyana/9router · MIBP merge
diff --git a/src/shared/components/Sidebar.js b/src/shared/components/Sidebar.js index 1b7bbe96..8a935235 100644 --- a/src/shared/components/Sidebar.js +++ b/src/shared/components/Sidebar.js @@ -128,7 +128,7 @@ export default function Sidebar({ onClose }) {

{APP_CONFIG.name}

- v{APP_CONFIG.version} + v{APP_CONFIG.version}{APP_CONFIG.gitSha ? ` (${APP_CONFIG.gitSha})` : ""} {updateInfo && ( diff --git a/src/shared/constants/config.js b/src/shared/constants/config.js index 0650d086..48ab77dd 100644 --- a/src/shared/constants/config.js +++ b/src/shared/constants/config.js @@ -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