Refactor logAddress check

c98d241f3c93e6b94d4fc66e99739bffebf55738

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

1 files changed, +10 -13Ignore whitespace
server.js+10 -13
@@ -857,19 +857,16 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) {
857857 console.log('\n' + getSeparator(plainGoToLog.length) + '\n');
858858
859859 if (listen) {
860860 ifconst (logAddress = ipRegex.v6({ exact: true }).test(listenAddressIPv6)) {
861- console.log(
861+ ? listenAddressIPv6
862- `SillyTavern is listening on the address ${listenAddressIPv6}. 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`,
862+ : ipRegex.v4({ exact: true }).test(listenAddressIPv4)
863- );
863+ ? listenAddressIPv4
864- } else if (ipRegex.v4({ exact: true }).test(listenAddressIPv4)) {
864+ : null;
865865 console.log(
866- `SillyTavern is listening on the address ${listenAddressIPv4}. 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`,
866+ logAddress
867- );
867+ ? `SillyTavern is listening on the address ${logAddress}. 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`
868- } else {
868+ : '[::] 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',
869- console.log(
869+ );
870- '[::] 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',
871- );
872- }
873870 }
874871
875872 if (basicAuthMode) {