Merge branch 'dev' into sync-dev

This commit is contained in:
Nick O'Leary
2024-03-28 14:56:36 +00:00
committed by GitHub
230 changed files with 47663 additions and 3550 deletions

View File

@@ -33,8 +33,7 @@ if (NODE_MAJOR_VERSION >= 16) {
function checkVersion(userSettings) {
var semver = require('semver');
if (!semver.satisfies(process.version,">=14.0.0")) {
// TODO: in the future, make this a hard error.
if (!semver.satisfies(process.version,">=18.0.0")) {
// var e = new Error("Unsupported version of Node.js");
// e.code = "unsupported_version";
// throw e;

View File

@@ -1,6 +1,6 @@
{
"name": "node-red",
"version": "3.1.7",
"version": "4.0.0-beta.1",
"description": "Low-code programming for event-driven applications",
"homepage": "https://nodered.org",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
"flow"
],
"dependencies": {
"@node-red/editor-api": "3.1.7",
"@node-red/runtime": "3.1.7",
"@node-red/util": "3.1.7",
"@node-red/nodes": "3.1.7",
"@node-red/editor-api": "4.0.0-beta.1",
"@node-red/runtime": "4.0.0-beta.1",
"@node-red/util": "4.0.0-beta.1",
"@node-red/nodes": "4.0.0-beta.1",
"basic-auth": "2.0.1",
"bcryptjs": "2.4.3",
"express": "4.19.2",
@@ -47,6 +47,6 @@
"bcrypt": "5.1.0"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}

View File

@@ -26,6 +26,13 @@ if (process.argv[2] === 'admin') {
return;
}
var semver = require('semver');
if (!semver.satisfies(process.version, ">=18.0.0")) {
console.log("Unsupported version of Node.js:", process.version);
console.log("Node-RED requires Node.js v18 or later");
process.exit(1)
}
var http = require('http');
var https = require('https');
var util = require("util");
@@ -346,7 +353,7 @@ httpsPromise.then(function(startupHttps) {
} catch(err) {
if (err.code == "unsupported_version") {
console.log("Unsupported version of Node.js:",process.version);
console.log("Node-RED requires Node.js v8.9.0 or later");
console.log("Node-RED requires Node.js v18 or later");
} else {
console.log("Failed to start server:");
if (err.stack) {
@@ -408,9 +415,15 @@ httpsPromise.then(function(startupHttps) {
if (settings.httpAdminRoot !== false) {
app.use(settings.httpAdminRoot,RED.httpAdmin);
}
if (settings.httpNodeRoot !== false && settings.httpNodeAuth) {
app.use(settings.httpNodeRoot,basicAuthMiddleware(settings.httpNodeAuth.user,settings.httpNodeAuth.pass));
if (typeof settings.httpNodeAuth === "function" || Array.isArray(settings.httpNodeAuth)) {
app.use(settings.httpNodeRoot, settings.httpNodeAuth);
} else {
app.use(settings.httpNodeRoot, basicAuthMiddleware(settings.httpNodeAuth.user, settings.httpNodeAuth.pass));
}
}
if (settings.httpNodeRoot !== false) {
app.use(settings.httpNodeRoot,RED.httpNode);
}

View File

@@ -449,6 +449,7 @@ module.exports = {
* - ui (for use with Node-RED Dashboard)
* - debugUseColors
* - debugMaxLength
* - debugStatusLength
* - execMaxBufferSize
* - httpRequestTimeout
* - mqttReconnectTime
@@ -504,6 +505,9 @@ module.exports = {
/** The maximum length, in characters, of any message sent to the debug sidebar tab */
debugMaxLength: 1000,
/** The maximum length, in characters, of status messages under the debug node */
//debugStatusLength: 32,
/** Maximum buffer size for the exec node. Defaults to 10Mb */
//execMaxBufferSize: 10000000,