From b8e41e970dff1414de1d367da0aee48c8517ac3a Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:54:39 -0600 Subject: [PATCH] refactor: add password key --- apps/dokploy/templates/budibase/index.ts | 33 +++++++----------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/apps/dokploy/templates/budibase/index.ts b/apps/dokploy/templates/budibase/index.ts index 9312b4f94..50bdfdba7 100644 --- a/apps/dokploy/templates/budibase/index.ts +++ b/apps/dokploy/templates/budibase/index.ts @@ -2,36 +2,21 @@ import { type DomainSchema, type Schema, type Template, + generatePassword, generateRandomDomain, } from "../utils"; export function generate(schema: Schema): Template { const mainDomain = generateRandomDomain(schema); - const apiKey = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const encryptionKey = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const jwtSecret = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const couchDbPassword = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const redisPassword = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const minioAccessKey = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const minioSecretKey = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); - const watchtowerPassword = Array.from({ length: 32 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(""); + const apiKey = generatePassword(32); + const encryptionKey = generatePassword(32); + const jwtSecret = generatePassword(32); + const couchDbPassword = generatePassword(32); + const redisPassword = generatePassword(32); + const minioAccessKey = generatePassword(32); + const minioSecretKey = generatePassword(32); + const watchtowerPassword = generatePassword(32); const domains: DomainSchema[] = [ {