changed formatting
| @@ -419,6 +419,7 @@ async function getHasIP() { | ||
| 419 | 419 | if (iface === undefined) { |
| 420 | 420 | continue; |
| 421 | 421 | } |
| 422 | + | |
| 422 | 423 | for (const info of iface) { |
| 423 | 424 | if (info.family === 'IPv6') { |
| 424 | 425 | hasIPv6 = true; |
| @@ -437,7 +438,12 @@ async function getHasIP() { | ||
| 437 | 438 | } |
| 438 | 439 | if (hasIPv6 && hasIPv4 && hasIPv6Local && hasIPv4Local) break; |
| 439 | 440 | } |
| 440 | - return [hasIPv6, hasIPv4, hasIPv6Local, hasIPv4Local]; | |
| 441 | + return [ | |
| 442 | + hasIPv6, | |
| 443 | + hasIPv4, | |
| 444 | + hasIPv6Local, | |
| 445 | + hasIPv4Local, | |
| 446 | + ]; | |
| 441 | 447 | } |
| 442 | 448 | |
| 443 | 449 | app.use(cookieSession({ |
| @@ -808,11 +814,15 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) { | ||
| 808 | 814 | let logListen = 'SillyTavern is listening on'; |
| 809 | 815 | |
| 810 | 816 | if (useIPv6 && !v6Failed) { |
| 811 | 817 | logListen += color.green(' IPv6: ' + tavernUrlV6.host); |
| 818 | + ' IPv6: ' + tavernUrlV6.host | |
| 819 | + ); | |
| 812 | 820 | } |
| 813 | 821 | |
| 814 | 822 | if (useIPv4 && !v4Failed) { |
| 815 | 823 | logListen += color.green(' IPv4: ' + tavernUrl.host); |
| 824 | + ' IPv4: ' + tavernUrl.host | |
| 825 | + ); | |
| 816 | 826 | } |
| 817 | 827 | |
| 818 | 828 | const goToLog = 'Go to: ' + color.blue(autorunUrl) + ' to open SillyTavern'; |
| @@ -824,16 +834,22 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) { | ||
| 824 | 834 | console.log('\n' + getSeparator(plainGoToLog.length) + '\n'); |
| 825 | 835 | |
| 826 | 836 | if (listen) { |
| 827 | - console.log('[::] or 0.0.0.0 means SillyTavern is listening on all network interfaces (Wi-Fi, LAN, localhost). If you want to limit it only to internal localhost ([::1] or 127.0.0.1), change the setting in config.yaml to "listen: false". Check "access.log" file in the SillyTavern directory if you want to inspect incoming connections.\n'); | |
| 837 | + console.log( | |
| 838 | + '[::] or 0.0.0.0 means SillyTavern is listening on all network interfaces (Wi-Fi, LAN, localhost). If you want to limit it only to internal localhost ([::1] or 127.0.0.1), change the setting in config.yaml to "listen: false". Check "access.log" file in the SillyTavern directory if you want to inspect incoming connections.\n' | |
| 839 | + ); | |
| 828 | 840 | } |
| 829 | 841 | |
| 830 | 842 | if (basicAuthMode) { |
| 831 | 843 | if (perUserBasicAuth && !enableAccounts) { |
| 832 | - console.error(color.red('Per-user basic authentication is enabled, but user accounts are disabled. This configuration may be insecure.')); | |
| 844 | + console.error(color.red( | |
| 845 | + 'Per-user basic authentication is enabled, but user accounts are disabled. This configuration may be insecure.' | |
| 846 | + )); | |
| 833 | 847 | } else if (!perUserBasicAuth) { |
| 834 | 848 | const basicAuthUser = getConfigValue('basicAuthUser', {}); |
| 835 | 849 | if (!basicAuthUser?.username || !basicAuthUser?.password) { |
| 836 | - console.warn(color.yellow('Basic Authentication is enabled, but username or password is not set or empty!')); | |
| 850 | + console.warn(color.yellow( | |
| 851 | + 'Basic Authentication is enabled, but username or password is not set or empty!' | |
| 852 | + )); | |
| 837 | 853 | } |
| 838 | 854 | } |
| 839 | 855 | } |
| @@ -1010,6 +1026,7 @@ async function startServer() { | ||
| 1010 | 1026 | if (enableIPv6 === 'auto' || enableIPv4 === 'auto') { |
| 1011 | 1027 | [hasIPv6Any, hasIPv4Any, hasIPv6Local, hasIPv4Local] = await getHasIP(); |
| 1012 | 1028 | |
| 1029 | + | |
| 1013 | 1030 | hasIPv6 = listen ? hasIPv6Any : hasIPv6Local; |
| 1014 | 1031 | if (enableIPv6 === 'auto') { |
| 1015 | 1032 | useIPv6 = hasIPv6; |
| @@ -1059,6 +1076,7 @@ async function startServer() { | ||
| 1059 | 1076 | const [v6Failed, v4Failed] = await startHTTPorHTTPS(useIPv6, useIPv4); |
| 1060 | 1077 | |
| 1061 | 1078 | handleServerListenFail(v6Failed, v4Failed, useIPv6, useIPv4); |
| 1079 | + | |
| 1062 | 1080 | postSetupTasks(v6Failed, v4Failed, useIPv6, useIPv4); |
| 1063 | 1081 | } |
| 1064 | 1082 | |