mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix(template-helpers): hash not working without parameter
This commit is contained in:
parent
11b9cee73d
commit
2b5af1897f
@ -97,6 +97,10 @@ export function processValue(
|
||||
const length = Number.parseInt(varName.split(":")[1], 10) || 8;
|
||||
return generateHash(length);
|
||||
}
|
||||
if (varName === "hash") {
|
||||
return generateHash();
|
||||
}
|
||||
|
||||
if (varName === "uuid") {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
@ -183,6 +187,8 @@ export function processVariables(
|
||||
const match = value.match(/\${password:(\d+)}/);
|
||||
const length = match?.[1] ? Number.parseInt(match[1], 10) : 16;
|
||||
variables[key] = generatePassword(length);
|
||||
} else if (value === "${hash}") {
|
||||
variables[key] = generateHash();
|
||||
} else if (value.startsWith("${hash:")) {
|
||||
const match = value.match(/\${hash:(\d+)}/);
|
||||
const length = match?.[1] ? Number.parseInt(match[1], 10) : 8;
|
||||
|
Loading…
Reference in New Issue
Block a user