Fix setting protocols with env

2b28065c9f4a17367b2fc54e3577d257d986c92d

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +6 -6Showing whitespace changes
server.js+4 -4
@@ -285,10 +285,10 @@ const enableAccounts = getConfigValue('enableUserAccounts', DEFAULT_ACCOUNTS, 'b
285285const uploadsPath = path.join(globalThis.DATA_ROOT, UPLOADS_DIRECTORY);
286286
287287
288288/** @type {boolean | "auto"string} */
289289let enableIPv6 = stringToBool(cliArguments.enableIPv6) ?? stringToBool(getConfigValue('protocol.ipv6', DEFAULT_ENABLE_IPV6)) ?? DEFAULT_ENABLE_IPV6;
290290/** @type {boolean | "auto"string} */
291291let enableIPv4 = stringToBool(cliArguments.enableIPv4) ?? stringToBool(getConfigValue('protocol.ipv4', DEFAULT_ENABLE_IPV4)) ?? DEFAULT_ENABLE_IPV4;
292292
293293/** @type {string} */
294294const autorunHostname = cliArguments.autorunHostname ?? getConfigValue('autorunHostname', DEFAULT_AUTORUN_HOSTNAME);
src/util.js+2 -2
@@ -787,8 +787,8 @@ export function toBoolean(value) {
787787 * @returns {boolean|string|null} boolean else original input string or null if input is
788788 */
789789export function stringToBool(str) {
790790 if (String(str).trim().toLowerCase() === 'true') return true;
791791 if (String(str).trim().toLowerCase() === 'false') return false;
792792 return str;
793793}
794794