mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-11 15:23:43 +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:
@@ -105,6 +105,7 @@
|
||||
#include "PermissionGrantsLoader.h"
|
||||
#include "JWTUtils.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "BuildInfo.h"
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
|
||||
@@ -376,6 +377,7 @@ int main(int argc, char** argv) {
|
||||
Game::config->LogSettings();
|
||||
|
||||
LOG("Starting Dashboard Server");
|
||||
LOG("Version: %s", std::string(BuildInfo::buildString).c_str());
|
||||
|
||||
// Load settings
|
||||
if (Game::config->GetValue("max_clients") != "")
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="card mb-4" style="max-width: 720px;">
|
||||
<div class="card-body">
|
||||
<h5>DarkflameServer <span class="text-body-secondary">{{ version }}</span></h5>
|
||||
<p class="small text-body-secondary">{{ buildKind }} build{% if commit %} of commit <code>{{ commit }}</code>{% if dirty %} with uncommitted changes{% endif %}{% endif %}</p>
|
||||
<p>A server emulator for LEGO® Universe. This dashboard is part of the server and replaces the separate NexusDashboard.</p>
|
||||
<ul class="mb-0">
|
||||
<li><a href="https://github.com/DarkflameUniverse/DarkflameServer" target="_blank" rel="noopener">DarkflameServer on GitHub</a></li>
|
||||
|
||||
Reference in New Issue
Block a user