From 4271402e0d0e1840791158de288a3e7617227ec4 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 24 Mar 2024 11:17:55 +0000 Subject: [PATCH] recognise numbers and boolean values --- packages/backend/src/config.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 8d4c5464a6..f6ce9b3cdf 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -390,6 +390,8 @@ function applyEnvOverrides(config: Source) { } } + const alwaysStrings = { 'chmodSocket': 1 }; + function _assign(path: (string | number)[], lastStep: string | number, value: string) { let thisConfig = config; for (const step of path) { @@ -399,6 +401,14 @@ function applyEnvOverrides(config: Source) { thisConfig = thisConfig[step]; } + if (!alwaysStrings[lastStep]) { + if (value.match(/^[0-9]+$/)) { + value = parseInt(value); + } else if (value.match(/^(true|false)$/i)) { + value = !!value.match(/^true$/i); + } + } + thisConfig[lastStep] = value; }