mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Add version to index page
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import server from "./server";
|
||||
import logger from "./logger";
|
||||
import { appendMimeTypeToClientFor, DEFAULT, Navidrome } from "./navidrome";
|
||||
@@ -56,6 +58,10 @@ const featureFlagAwareMusicService: MusicService = {
|
||||
}),
|
||||
};
|
||||
|
||||
export const GIT_INFO = path.join(__dirname, "..", ".gitinfo");
|
||||
|
||||
const version = fs.existsSync(GIT_INFO) ? fs.readFileSync(GIT_INFO).toString().trim() : "v??"
|
||||
|
||||
const app = server(
|
||||
sonosSystem,
|
||||
bonob,
|
||||
@@ -67,7 +73,8 @@ const app = server(
|
||||
clock: SystemClock,
|
||||
iconColors: config.icons,
|
||||
applyContextPath: true,
|
||||
logRequests: true
|
||||
logRequests: true,
|
||||
version
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ export type ServerOpts = {
|
||||
};
|
||||
applyContextPath: boolean;
|
||||
logRequests: boolean;
|
||||
version: string
|
||||
};
|
||||
|
||||
const DEFAULT_SERVER_OPTS: ServerOpts = {
|
||||
@@ -88,6 +89,7 @@ const DEFAULT_SERVER_OPTS: ServerOpts = {
|
||||
iconColors: { foregroundColor: undefined, backgroundColor: undefined },
|
||||
applyContextPath: true,
|
||||
logRequests: false,
|
||||
version: "v?"
|
||||
};
|
||||
|
||||
function server(
|
||||
@@ -146,6 +148,7 @@ function server(
|
||||
removeRegistrationRoute: bonobUrl
|
||||
.append({ pathname: REMOVE_REGISTRATION_ROUTE })
|
||||
.pathname(),
|
||||
version: opts.version
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user