| 248 | 248 | app.use(responseTime()); |
| 249 | 249 | |
| 250 | 250 | |
| 251 | +/** @type {number} */ |
| 251 | 252 | const server_port = cliArguments.port ?? process.env.SILLY_TAVERN_PORT ?? getConfigValue('port', DEFAULT_PORT); |
| 253 | +/** @type {boolean} */ |
| 252 | 254 | const autorun = (cliArguments.autorun ?? getConfigValue('autorun', DEFAULT_AUTORUN)) && !cliArguments.ssl; |
| 255 | +/** @type {boolean} */ |
| 253 | 256 | const listen = cliArguments.listen ?? getConfigValue('listen', DEFAULT_LISTEN); |
| 257 | +/** @type {boolean} */ |
| 254 | 258 | const enableCorsProxy = cliArguments.corsProxy ?? getConfigValue('enableCorsProxy', DEFAULT_CORS_PROXY); |
| 255 | 259 | const enableWhitelist = cliArguments.whitelist ?? getConfigValue('whitelistMode', DEFAULT_WHITELIST); |
| 260 | +/** @type {string} */ |
| 256 | 261 | const dataRoot = cliArguments.dataRoot ?? getConfigValue('dataRoot', './data'); |
| 262 | +/** @type {boolean} */ |
| 257 | 263 | const disableCsrf = cliArguments.disableCsrf ?? getConfigValue('disableCsrfProtection', DEFAULT_CSRF_DISABLED); |
| 258 | 264 | const basicAuthMode = cliArguments.basicAuthMode ?? getConfigValue('basicAuthMode', DEFAULT_BASIC_AUTH); |
| 259 | 265 | const perUserBasicAuth = getConfigValue('perUserBasicAuth', DEFAULT_PER_USER_BASIC_AUTH); |
| 266 | +/** @type {boolean} */ |
| 260 | 267 | const enableAccounts = getConfigValue('enableUserAccounts', DEFAULT_ACCOUNTS); |
| 261 | 268 | |
| 262 | 269 | const uploadsPath = path.join(dataRoot, UPLOADS_DIRECTORY); |
| 263 | 270 | |
| 264 | 271 | |
| 272 | +/** @type {boolean|'auto'} */ |
| 265 | 273 | let enableIPv6 = stringToBool(cliArguments.enableIPv6) ?? getConfigValue('protocol.ipv6', DEFAULT_ENABLE_IPV6); |
| 274 | +/** @type {boolean|'auto'} */ |
| 266 | 275 | let enableIPv4 = stringToBool(cliArguments.enableIPv4) ?? getConfigValue('protocol.ipv4', DEFAULT_ENABLE_IPV4); |
| 267 | 276 | |
| 277 | +/** @type {string} */ |
| 268 | 278 | const autorunHostname = cliArguments.autorunHostname ?? getConfigValue('autorunHostname', DEFAULT_AUTORUN_HOSTNAME); |
| 279 | +/** @type {number} */ |
| 269 | 280 | const autorunPortOverride = cliArguments.autorunPortOverride ?? getConfigValue('autorunPortOverride', DEFAULT_AUTORUN_PORT); |
| 270 | 281 | |
| 282 | +/** @type {boolean} */ |
| 271 | 283 | const dnsPreferIPv6 = cliArguments.dnsPreferIPv6 ?? getConfigValue('dnsPreferIPv6', DEFAULT_PREFER_IPV6); |
| 272 | 284 | |
| 285 | +/** @type {boolean} */ |
| 273 | 286 | const avoidLocalhost = cliArguments.avoidLocalhost ?? getConfigValue('avoidLocalhost', DEFAULT_AVOID_LOCALHOST); |
| 274 | 287 | |
| 275 | 288 | const proxyEnabled = cliArguments.requestProxyEnabled ?? getConfigValue('requestProxy.enabled', DEFAULT_PROXY_ENABLED); |