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5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$/m; |
| 717 | 717 | const tavernUrlV6 = new URL( |
| 718 | 718 | (cliArguments.ssl ? 'https://' : 'http://') + |
| 719 | 719 | (listen ? (ipv6_regex.test(listenAddress) ? `[${listenAddress}]` : '[::]') : '[::1]') + |
| 720 | 720 | (':' + server_port), |
| 721 | 721 | ); |
| 722 | 722 | |
| @@ -789,8 +789,12 @@ const preSetupTasks = async function () { | ||
| 789 | 789 | */ |
| 790 | 790 | async function getAutorunHostname(useIPv6, useIPv4) { |
| 791 | 791 | if (autorunHostname === 'auto') { |
| 792 | - if (listen && (ipv4_regex.test(listenAddress) || ipv6_regex.test(listenAddress))) { | |
| 792 | + if (listen) { | |
| 793 | - return listenAddress; | |
| 793 | + if (ipv4_regex.test(listenAddress)) { | |
| 794 | + return listenAddress; | |
| 795 | + } else if (ipv6_regex.test(listenAddress)) { | |
| 796 | + return `[${listenAddress}]`; | |
| 797 | + } | |
| 794 | 798 | } |
| 795 | 799 | |
| 796 | 800 | let localhostResolve = await canResolve('localhost', useIPv6, useIPv4); |
| @@ -855,10 +859,14 @@ const postSetupTasks = async function (v6Failed, v4Failed, useIPv6, useIPv4) { | ||
| 855 | 859 | console.log('\n' + getSeparator(plainGoToLog.length) + '\n'); |
| 856 | 860 | |
| 857 | 861 | if (listen) { |
| 858 | 862 | if (ipv4_regex.test(listenAddress) || ipv6_regex.test(listenAddress)) { |
| 859 | 863 | console.log( |
| 860 | 864 | `SillyTavern is listening on the address ${listenAddress}. 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`, |
| 861 | 865 | ); |
| 866 | + } else if (ipv6_regex.test(listenAddress)) { | |
| 867 | + console.log( | |
| 868 | + `SillyTavern is listening on the address [${listenAddress}]. 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 | + ); | |
| 862 | 870 | } else { |
| 863 | 871 | console.log( |
| 864 | 872 | '[::] 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', |