feat: show live build version in web UI
Build & Push Docker Image / build (push) Successful in 2m36s

- /api/version returns version, commitSha, buildDate, trashRetentionDays
- CI passes COMMIT_SHA (full), BUILD_DATE and VERSION (git tag) as
  docker build args; Dockerfile bakes them as env
- sidebar footer shows version/sha linked to the Gitea commit
- admin System tab shows version, commit link, build date, trash retention
This commit is contained in:
opencode
2026-08-02 02:13:27 +02:00
parent 2f20b1e5c2
commit 803802a5b6
11 changed files with 247 additions and 3 deletions
+10
View File
@@ -8,4 +8,14 @@ router.get("/healthz", (_req, res) => {
res.json(data);
});
router.get("/version", (_req, res) => {
const retention = Number(process.env["TRASH_RETENTION_DAYS"] ?? "0");
res.json({
version: process.env["VERSION"] || "dev",
commitSha: process.env["COMMIT_SHA"] || null,
buildDate: process.env["BUILD_DATE"] || null,
trashRetentionDays: Number.isFinite(retention) ? retention : 0,
});
});
export default router;