diff --git a/.travis.yml b/.travis.yml index 4cffa0389..e99bc9270 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ matrix: - node_js: "12" script: - ./node_modules/.bin/grunt no-coverage + allow_failures: - node_js: "16" script: - ./node_modules/.bin/grunt no-coverage diff --git a/package.json b/package.json index 9df66ddf4..573c76ee1 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "cookie": "0.4.1", "cookie-parser": "1.4.5", "cors": "2.8.5", - "cron": "1.7.2", + "cronosjs": "1.7.1", "denque": "1.5.0", "express": "4.17.1", "express-session": "1.17.1", diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.js b/packages/node_modules/@node-red/nodes/core/common/20-inject.js index b1db94ff5..772e238a3 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.js +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.js @@ -16,7 +16,7 @@ module.exports = function(RED) { "use strict"; - var cron = require("cron"); + const {scheduleTask} = require("cronosjs"); function InjectNode(n) { RED.nodes.createNode(this,n); @@ -85,7 +85,7 @@ module.exports = function(RED) { if (RED.settings.verbose) { this.log(RED._("inject.crontab", this)); } - this.cronjob = new cron.CronJob(this.crontab, function() { node.emit("input", {}); }, null, true); + this.cronjob = scheduleTask(this.crontab,() => { node.emit("input", {})}); } }; diff --git a/packages/node_modules/@node-red/nodes/package.json b/packages/node_modules/@node-red/nodes/package.json index a1a8fc5ce..c46d4f975 100644 --- a/packages/node_modules/@node-red/nodes/package.json +++ b/packages/node_modules/@node-red/nodes/package.json @@ -22,7 +22,7 @@ "cookie-parser": "1.4.5", "cookie": "0.4.1", "cors": "2.8.5", - "cron": "1.7.2", + "cronosjs": "1.7.1", "denque": "1.5.0", "fs-extra": "9.1.0", "fs.notify": "0.0.4", diff --git a/packages/node_modules/@node-red/runtime/lib/index.js b/packages/node_modules/@node-red/runtime/lib/index.js index 30481740f..fd3fda721 100644 --- a/packages/node_modules/@node-red/runtime/lib/index.js +++ b/packages/node_modules/@node-red/runtime/lib/index.js @@ -181,6 +181,9 @@ function start() { if (settings.settingsFile) { log.info(log._("runtime.paths.settings",{path:settings.settingsFile})); } + if (settings.httpRoot !== undefined) { + log.warn(log._("server.deprecatedOption",{old:"httpRoot", new: "httpNodeRoot/httpAdminRoot"})); + } if (settings.httpStatic) { log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)})); } diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js index 0533fe5e6..1734192bf 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js @@ -38,6 +38,8 @@ var activeProject; var globalGitUser = false; +var usingHostName = false; + function init(_settings, _runtime) { settings = _settings; runtime = _runtime; @@ -77,6 +79,7 @@ function init(_settings, _runtime) { } else { flowsFile = 'flows_'+require('os').hostname()+'.json'; flowsFullPath = fspath.join(settings.userDir,flowsFile); + usingHostName = true; } var ffExt = fspath.extname(flowsFullPath); var ffBase = fspath.basename(flowsFullPath,ffExt); @@ -526,7 +529,7 @@ async function getFlows() { if (projectsEnabled) { log.info(log._("storage.localfilesystem.projects.projects-directory", {projectsDirectory: projectsDir})); } - + if (activeProject) { // At this point activeProject will be a string, so go load it and // swap in an instance of Project @@ -541,6 +544,7 @@ async function getFlows() { } else { projectLogMessages.forEach(log.warn); } + if (usingHostName) { log.warn(log._("storage.localfilesystem.warn_name")) }; log.info(log._("storage.localfilesystem.flows-file",{path:flowsFullPath})); } } diff --git a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json index 1a29f32b4..a96e36e73 100644 --- a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json +++ b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json @@ -42,7 +42,7 @@ "uninstall-failed-long": "Uninstall of module __name__ failed:", "uninstalled": "Uninstalled module: __name__" }, - "deprecatedOption": "Use of __old__ is deprecated. Use __new__ instead", + "deprecatedOption": "Use of __old__ is DEPRECATED. Use __new__ instead", "unable-to-listen": "Unable to listen on __listenpath__", "port-in-use": "Error: port in use", "uncaught-exception": "Uncaught Exception:", @@ -50,7 +50,7 @@ "now-running": "Server now running at __listenpath__", "failed-to-start": "Failed to start server:", "headless-mode": "Running in headless mode", - "httpadminauth-deprecated": "use of httpAdminAuth is deprecated. Use adminAuth instead", + "httpadminauth-deprecated": "Use of httpAdminAuth is DEPRECATED. Use adminAuth instead", "https": { "refresh-interval": "Refreshing https settings every __interval__ hours", "settings-refreshed": "Server https settings have been refreshed", @@ -159,6 +159,7 @@ "restore": "Restoring __type__ file backup : __path__", "restore-fail": "Restoring __type__ file backup failed : __message__", "fsync-fail": "Flushing file __path__ to disk failed : __message__", + "warn_name": "Flows file name not set. Generating name using hostname.", "projects": { "changing-project": "Setting active project : __project__", "active-project": "Active project : __project__", diff --git a/packages/node_modules/node-red/red.js b/packages/node_modules/node-red/red.js index 55e355a7c..436537873 100755 --- a/packages/node_modules/node-red/red.js +++ b/packages/node_modules/node-red/red.js @@ -263,7 +263,6 @@ httpsPromise.then(function(startupHttps) { settings.httpAdminRoot = false; settings.httpNodeRoot = false; } else { - settings.httpRoot = settings.httpRoot||"/"; settings.disableEditor = settings.disableEditor||false; } diff --git a/packages/node_modules/node-red/settings.js b/packages/node_modules/node-red/settings.js index 331654ed8..b0243180f 100644 --- a/packages/node_modules/node-red/settings.js +++ b/packages/node_modules/node-red/settings.js @@ -12,6 +12,13 @@ **/ module.exports = { + // The file containing the flows. If not set, it defaults to flows_.json + flowFile: 'flows.json', + + // To enabled pretty-printing of the flow within the flow file, set the following + // property to true: + //flowFilePretty: true, + // the tcp port that the Node-RED web server is listening on uiPort: process.env.PORT || 1880, @@ -61,13 +68,6 @@ module.exports = { // Colourise the console output of the debug node //debugUseColors: true, - // The file containing the flows. If not set, it defaults to flows_.json - //flowFile: 'flows.json', - - // To enabled pretty-printing of the flow within the flow file, set the following - // property to true: - //flowFilePretty: true, - // By default, credentials are encrypted in storage using a generated key. To // specify your own secret, set the following property. // If you want to disable encryption of credentials, set this property to false. @@ -96,10 +96,6 @@ module.exports = { // disabled. //httpNodeRoot: '/red-nodes', - // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot', - // to apply the same root to both parts. - //httpRoot: '/red', - // When httpAdminRoot is used to move the UI to a different root path, the // following property can be used to identify a directory of static content // that should be served at http://localhost:1880/. @@ -110,7 +106,7 @@ module.exports = { //apiMaxLength: '5mb', // If you installed the optional node-red-dashboard you can set it's path - // relative to httpRoot + // relative to httpNodeRoot // Other optional properties include // readOnly:{boolean}, // middleware:{function or array}, (req,res,next) - http middleware