changed formatting

faaa4ba6bc812235b4ecd2736c59c80272dae890

BPplays <andymalbp@gmail.com>

1 files changed, +24 -6Ignore whitespace
server.js+24 -6
@@ -419,6 +419,7 @@ async function getHasIP() {
419419 if (iface === undefined) {
420420 continue;
421421 }
422+
422423 for (const info of iface) {
423424 if (info.family === 'IPv6') {
424425 hasIPv6 = true;
@@ -437,7 +438,12 @@ async function getHasIP() {
437438 }
438439 if (hasIPv6 && hasIPv4 && hasIPv6Local && hasIPv4Local) break;
439440 }
440- return [hasIPv6, hasIPv4, hasIPv6Local, hasIPv4Local];
441+ return [
442+ hasIPv6,
443+ hasIPv4,
444+ hasIPv6Local,
445+ hasIPv4Local,
446+ ];
441447}
442448
443449app.use(cookieSession({
@@ -808,11 +814,15 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) {
808814 let logListen = 'SillyTavern is listening on';
809815
810816 if (useIPv6 && !v6Failed) {
811817 logListen += color.green(' IPv6: ' + tavernUrlV6.host);
818+ ' IPv6: ' + tavernUrlV6.host
819+ );
812820 }
813821
814822 if (useIPv4 && !v4Failed) {
815823 logListen += color.green(' IPv4: ' + tavernUrl.host);
824+ ' IPv4: ' + tavernUrl.host
825+ );
816826 }
817827
818828 const goToLog = 'Go to: ' + color.blue(autorunUrl) + ' to open SillyTavern';
@@ -824,16 +834,22 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) {
824834 console.log('\n' + getSeparator(plainGoToLog.length) + '\n');
825835
826836 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+ );
828840 }
829841
830842 if (basicAuthMode) {
831843 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+ ));
833847 } else if (!perUserBasicAuth) {
834848 const basicAuthUser = getConfigValue('basicAuthUser', {});
835849 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+ ));
837853 }
838854 }
839855 }
@@ -1010,6 +1026,7 @@ async function startServer() {
10101026 if (enableIPv6 === 'auto' || enableIPv4 === 'auto') {
10111027 [hasIPv6Any, hasIPv4Any, hasIPv6Local, hasIPv4Local] = await getHasIP();
10121028
1029+
10131030 hasIPv6 = listen ? hasIPv6Any : hasIPv6Local;
10141031 if (enableIPv6 === 'auto') {
10151032 useIPv6 = hasIPv6;
@@ -1059,6 +1076,7 @@ async function startServer() {
10591076 const [v6Failed, v4Failed] = await startHTTPorHTTPS(useIPv6, useIPv4);
10601077
10611078 handleServerListenFail(v6Failed, v4Failed, useIPv6, useIPv4);
1079+
10621080 postSetupTasks(v6Failed, v4Failed, useIPv6, useIPv4);
10631081}
10641082