mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix setting protocols with env
This commit is contained in:
@@ -285,10 +285,10 @@ const enableAccounts = getConfigValue('enableUserAccounts', DEFAULT_ACCOUNTS, 'b
|
|||||||
const uploadsPath = path.join(globalThis.DATA_ROOT, UPLOADS_DIRECTORY);
|
const uploadsPath = path.join(globalThis.DATA_ROOT, UPLOADS_DIRECTORY);
|
||||||
|
|
||||||
|
|
||||||
/** @type {boolean | "auto"} */
|
/** @type {boolean | string} */
|
||||||
let enableIPv6 = stringToBool(cliArguments.enableIPv6) ?? getConfigValue('protocol.ipv6', DEFAULT_ENABLE_IPV6);
|
let enableIPv6 = stringToBool(cliArguments.enableIPv6) ?? stringToBool(getConfigValue('protocol.ipv6', DEFAULT_ENABLE_IPV6)) ?? DEFAULT_ENABLE_IPV6;
|
||||||
/** @type {boolean | "auto"} */
|
/** @type {boolean | string} */
|
||||||
let enableIPv4 = stringToBool(cliArguments.enableIPv4) ?? getConfigValue('protocol.ipv4', DEFAULT_ENABLE_IPV4);
|
let enableIPv4 = stringToBool(cliArguments.enableIPv4) ?? stringToBool(getConfigValue('protocol.ipv4', DEFAULT_ENABLE_IPV4)) ?? DEFAULT_ENABLE_IPV4;
|
||||||
|
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
const autorunHostname = cliArguments.autorunHostname ?? getConfigValue('autorunHostname', DEFAULT_AUTORUN_HOSTNAME);
|
const autorunHostname = cliArguments.autorunHostname ?? getConfigValue('autorunHostname', DEFAULT_AUTORUN_HOSTNAME);
|
||||||
|
@@ -787,8 +787,8 @@ export function toBoolean(value) {
|
|||||||
* @returns {boolean|string|null} boolean else original input string or null if input is
|
* @returns {boolean|string|null} boolean else original input string or null if input is
|
||||||
*/
|
*/
|
||||||
export function stringToBool(str) {
|
export function stringToBool(str) {
|
||||||
if (str === 'true') return true;
|
if (String(str).trim().toLowerCase() === 'true') return true;
|
||||||
if (str === 'false') return false;
|
if (String(str).trim().toLowerCase() === 'false') return false;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user