Friendlier startup console messages

This commit is contained in:
Cohee
2023-06-12 17:38:41 +03:00
parent 65ee58d383
commit aaf3f00bef

View File

@@ -654,11 +654,11 @@ function getVersion() {
pkgVersion = pkgJson.version; pkgVersion = pkgJson.version;
if (!process.pkg && commandExistsSync('git')) { if (!process.pkg && commandExistsSync('git')) {
gitRevision = require('child_process') gitRevision = require('child_process')
.execSync('git rev-parse --short HEAD', { cwd: process.cwd() }) .execSync('git rev-parse --short HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] })
.toString().trim(); .toString().trim();
gitBranch = require('child_process') gitBranch = require('child_process')
.execSync('git rev-parse --abbrev-ref HEAD', { cwd: process.cwd() }) .execSync('git rev-parse --abbrev-ref HEAD', { cwd: process.cwd(), stdio: ['ignore', 'pipe', 'ignore'] })
.toString().trim(); .toString().trim();
} }
} }
@@ -3148,6 +3148,10 @@ const autorunUrl = new URL(
); );
const setupTasks = async function () { const setupTasks = async function () {
const version = getVersion();
console.log(`SillyTavern ${version.pkgVersion}` + (version.gitBranch ? ` '${version.gitBranch}' (${version.gitRevision})` : ''));
migrateSecrets(); migrateSecrets();
ensurePublicDirectoriesExist(); ensurePublicDirectoriesExist();
await ensureThumbnailCache(); await ensureThumbnailCache();
@@ -3165,6 +3169,10 @@ const setupTasks = async function () {
if (autorun) open(autorunUrl.toString()); if (autorun) open(autorunUrl.toString());
console.log('SillyTavern is listening on: ' + tavernUrl); console.log('SillyTavern is listening on: ' + tavernUrl);
if (listen) {
console.log('\n0.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 (127.0.0.1), change the setting in config.conf to “listen=false”\n');
}
} }
if (listen && !config.whitelistMode && !config.basicAuthMode) { if (listen && !config.whitelistMode && !config.basicAuthMode) {