mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-20 19:52:48 +00:00
feat: log the build identifier at startup and show it on the dashboard About page
Every server logs BuildInfo's build string as its version; the About page also shows the build kind and commit, and log bundles name the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "GameLabels.h"
|
||||
#include "BehaviorXml.h"
|
||||
#include "ClientAssets.h"
|
||||
#include "BuildInfo.h"
|
||||
#include <chrono>
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
@@ -484,7 +485,8 @@ void RegisterDashboardRoutes() {
|
||||
SimplePage("/settings", Perm("settings"), "settings.jinja2", "settings", "Server settings");
|
||||
SimplePage("/client_assets", Perm("client_files"), "client_assets.jinja2", "client_assets", "Browse the game client's files");
|
||||
Route(eHTTPMethod::GET, "/about", 0, "About this server", [](HTTPReply& reply, const HTTPContext& context) {
|
||||
RenderPage(reply, context, "about.jinja2", "about", { {"version", PROJECT_VERSION} });
|
||||
RenderPage(reply, context, "about.jinja2", "about", { {"version", std::string(BuildInfo::buildString)},
|
||||
{"commit", std::string(BuildInfo::commit)}, {"dirty", BuildInfo::dirty}, {"buildKind", std::string(BuildInfo::BuildKindName())} });
|
||||
});
|
||||
|
||||
// Logs
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "DashboardRoutes.h"
|
||||
#include "LogBundle.h"
|
||||
#include "Workers.h"
|
||||
#include "BuildInfo.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
@@ -414,7 +415,7 @@ void RegisterServerRoutes() {
|
||||
const std::string downloadName = std::string("logs_") + stamp + ".zip";
|
||||
const auto out = folder / ("bundle_" + std::to_string(context.accountId) + "_" + std::to_string(now) + "_" + std::to_string(++counter) + ".zip");
|
||||
|
||||
std::string header = "DarkflameServer log bundle\nServer version: " PROJECT_VERSION "\nMade: " + std::string(made) + " (server time) by " +
|
||||
std::string header = "DarkflameServer log bundle\nServer version: " + std::string(BuildInfo::buildString) + "\nMade: " + std::string(made) + " (server time) by " +
|
||||
context.authenticatedUser + "\nFilters: " + filter->ToJson().dump() + "\nSize limit: " + LogBundle::SizeText(maxBytes) + " before compression\n";
|
||||
Audit(context, "download_logs", "Downloaded a log bundle: " + std::to_string(files.size()) + " file(s), " + LogBundle::SizeText(total) +
|
||||
" of logs; filters " + filter->ToJson().dump());
|
||||
|
||||
Reference in New Issue
Block a user