mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix[railpack]: environment variable validation for empty strings
Allow empty string values to be processed as valid environment variables by checking for existence rather than non-empty length.
This commit is contained in:
@@ -86,7 +86,7 @@ export const buildRailpack = async (
|
|||||||
const env: { [key: string]: string } = {};
|
const env: { [key: string]: string } = {};
|
||||||
for (const pair of envVariables) {
|
for (const pair of envVariables) {
|
||||||
const [key, value] = parseEnvironmentKeyValuePair(pair);
|
const [key, value] = parseEnvironmentKeyValuePair(pair);
|
||||||
if (key && value.length > 0) {
|
if (key && value) {
|
||||||
buildArgs.push("--secret", `id=${key},env=${key}`);
|
buildArgs.push("--secret", `id=${key},env=${key}`);
|
||||||
env[key] = value;
|
env[key] = value;
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ export const getRailpackCommand = (
|
|||||||
const exportEnvs = [];
|
const exportEnvs = [];
|
||||||
for (const pair of envVariables) {
|
for (const pair of envVariables) {
|
||||||
const [key, value] = parseEnvironmentKeyValuePair(pair);
|
const [key, value] = parseEnvironmentKeyValuePair(pair);
|
||||||
if (key && value.length > 0) {
|
if (key && value) {
|
||||||
buildArgs.push("--secret", `id=${key},env=${key}`);
|
buildArgs.push("--secret", `id=${key},env=${key}`);
|
||||||
exportEnvs.push(`export ${key}='${value}'`);
|
exportEnvs.push(`export ${key}='${value}'`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user