refactor: update project name reference in compose template processing

Change references from `compose.project.name` to `compose.appName` when processing compose templates to ensure correct project naming
This commit is contained in:
Mauricio Siu
2025-03-11 00:27:59 -06:00
parent f159dc11eb
commit 08e4b8fe33
2 changed files with 7 additions and 9 deletions

View File

@@ -607,7 +607,7 @@ export const composeRouter = createTRPCRouter({
const processedTemplate = processTemplate(config, { const processedTemplate = processTemplate(config, {
serverIp: serverIp, serverIp: serverIp,
projectName: compose.project.name, projectName: compose.appName,
}); });
return { return {
@@ -676,7 +676,7 @@ export const composeRouter = createTRPCRouter({
const processedTemplate = processTemplate(config, { const processedTemplate = processTemplate(config, {
serverIp: serverIp, serverIp: serverIp,
projectName: compose.project.name, projectName: compose.appName,
}); });
// Update compose file // Update compose file

View File

@@ -53,14 +53,12 @@ export const generatePassword = (quantity = 16): string => {
}; };
/** /**
* Generate a random base64 string of specified length * Generate a random base64 string from N random bytes
* @param bytes Number of random bytes to generate before base64 encoding (default: 32)
* @returns base64 encoded string of the random bytes
*/ */
export function generateBase64(length: number): string { export function generateBase64(bytes = 32): string {
// To get N characters in base64, we need to generate N * 3/4 bytes return randomBytes(bytes).toString("base64");
const bytesNeeded = Math.ceil((length * 3) / 4);
return Buffer.from(randomBytes(bytesNeeded))
.toString("base64")
.substring(0, length);
} }
export function generateJwt(length = 256): string { export function generateJwt(length = 256): string {