diff --git a/src/services/parse_filters.js b/src/services/parse_filters.js index 17166b1fa..e6c04beca 100644 --- a/src/services/parse_filters.js +++ b/src/services/parse_filters.js @@ -45,7 +45,8 @@ function calculateSmartValue(v) { module.exports = function (searchText) { // if the string doesn't start with attribute then we consider it as just standard full text search if (!searchText.trim().startsWith("@")) { - const sanitizedSearchText = searchText.replace(/[^\w ]+/g, ""); + // replace with space instead of empty string since these characters are probably separators + const sanitizedSearchText = searchText.replace(/[^\w ]+/g, " "); return [ { diff --git a/src/www b/src/www index 943aeaf88..4d919657f 100755 --- a/src/www +++ b/src/www @@ -35,6 +35,14 @@ async function startTrilium() { app.set('port', usedPort); if (config['Network']['https']) { + if (!config['Network']['keyPath'] || !config['Network']['keyPath'].trim().length) { + throw new Error("keyPath in config.ini is required when https=true, but it's empty"); + } + + if (!config['Network']['certPath'] || !config['Network']['certPath'].trim().length) { + throw new Error("certPath in config.ini is required when https=true, but it's empty"); + } + const options = { key: fs.readFileSync(config['Network']['keyPath']), cert: fs.readFileSync(config['Network']['certPath'])