Add security override config

This commit is contained in:
10sa
2023-05-19 21:39:48 +09:00
parent da76933c95
commit 6f8ba8fd69
2 changed files with 12 additions and 2 deletions

View File

@ -10,6 +10,11 @@ const enableExtensions = true; //Enables support for TavernAI-extras project
const listen = true; // If true, Can be access from other device or PC. otherwise can be access only from hosting machine.
const allowKeysExposure = false; // If true, private API keys could be fetched to the frontend.
// If true, Allows insecure settings for listen, whitelist, and authentication.
// Change this setting only on "trusted networks". Do not change this value unless you are aware of the issues that can arise from changing this setting and configuring a insecure setting.
const securityOverride = false;
module.exports = {
port,
whitelist,
@ -21,4 +26,5 @@ module.exports = {
listen,
disableThumbnails,
allowKeysExposure,
securityOverride,
};

View File

@ -2715,8 +2715,12 @@ const setupTasks = async function () {
}
if (listen && !config.whitelistMode && !config.basicAuthMode) {
if (config.securityOverride)
console.warn("Security has been override. If it's not a trusted network, change the settings.");
else {
console.error('Your SillyTavern is currently unsecurely open to the public. Enable whitelisting or basic authentication.');
process.exit(1);
}
}
if (true === cliArguments.ssl)