mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
50 Commits
improve-me
...
4717-add-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
805ed593fb | ||
|
|
c604ac2207 | ||
|
|
3fd2d07c75 | ||
|
|
b76d692a65 | ||
|
|
6600910163 | ||
|
|
a6973bd7ed | ||
|
|
d58127730f | ||
|
|
5494c167fc | ||
|
|
c5ae0be7b1 | ||
|
|
b653914ee0 | ||
|
|
c107c5fc92 | ||
|
|
0980c03129 | ||
|
|
f6c3fdc806 | ||
|
|
2c2628d816 | ||
|
|
56fe2801eb | ||
|
|
87b1ee9642 | ||
|
|
e1c36d232b | ||
|
|
13ee8cec24 | ||
|
|
a977b87cb3 | ||
|
|
14dfb9aef8 | ||
|
|
d520cde57a | ||
|
|
70167d7d1d | ||
|
|
ac6a4945cb | ||
|
|
fd1a001a23 | ||
|
|
f3c561cd86 | ||
|
|
f55ee6e665 | ||
|
|
edc5e88d5a | ||
|
|
47bf166a6e | ||
|
|
cf26209790 | ||
|
|
e55ebde170 | ||
|
|
d706c9cb37 | ||
|
|
20d2450cac | ||
|
|
34345461f1 | ||
|
|
aa372a1707 | ||
|
|
03648dc7e8 | ||
|
|
66a667fe58 | ||
|
|
1bb3a0eca5 | ||
|
|
08927dfb55 | ||
|
|
b27483de9c | ||
|
|
211d420fb2 | ||
|
|
b8ca4665c1 | ||
|
|
960af87fb0 | ||
|
|
de7339ae97 | ||
|
|
0995af62b6 | ||
|
|
c2e03a40b4 | ||
|
|
c855050bcf | ||
|
|
28907082f1 | ||
|
|
f83174c40a | ||
|
|
ec062d008f | ||
|
|
a587655a5a |
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18, 20]
|
||||
node-version: [18, 20, 22]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
|
||||
33
CHANGELOG.md
33
CHANGELOG.md
@@ -1,3 +1,36 @@
|
||||
#### 4.0.0-beta.3: Beta Release
|
||||
|
||||
Editor
|
||||
|
||||
- Improve background-deploy notification handling (#4692) @knolleary
|
||||
- Hide workspace tab on middle mouse click (#4657) @Steve-Mcl
|
||||
- multiplayer: Add user presence indicators (#4666) @knolleary
|
||||
- Enable updating dependency node of package.json in project feature (#4676) @kazuhitoyokoi
|
||||
- Add French translations for 4.0.0-beta.2 (#4681) @GogoVega
|
||||
- Add Japanese translations for 4.0.0-beta.2 (#4674) @kazuhitoyokoi
|
||||
- Fix saving of conf-type properties in module packaged subflows (#4658) @knolleary
|
||||
- Add npm install timeout notification (#4662) @hardillb
|
||||
- Fix undo of subflow env property edits (#4667) @knolleary
|
||||
- Fix three error typos in monaco.js (#4660) @JoshuaCWebDeveloper
|
||||
- docs: Add closing paragraph tag (#4664) @ZJvandeWeg
|
||||
- Avoid login loops when autoLogin enabled but login fails (#4684) @knolleary
|
||||
|
||||
Runtime
|
||||
|
||||
- Allow blank strings to be used for env var property substitutions (#4672) @knolleary
|
||||
- Use rfdc for cloning pure JSON values (#4679) @knolleary
|
||||
- fix: remove outdated Node 11+ check (#4314) @Rotzbua
|
||||
- feat(ci): add new nodejs v22 (#4694) @Rotzbua
|
||||
- fix(node): increase required node >=18.5 (#4690) @Rotzbua
|
||||
- fix(dns): remove outdated node check (#4689) @Rotzbua
|
||||
- fix(polyfill): remove import module polyfill (#4688) @Rotzbua
|
||||
- Fix typo (#4686) @Rotzbua
|
||||
|
||||
Nodes
|
||||
|
||||
- Pass full error object in Function node and copy over cause property (#4685) @knolleary
|
||||
- Replacing vm.createScript in favour of vm.Script (#4534) @patlux
|
||||
|
||||
#### 4.0.0-beta.2: Beta Release
|
||||
|
||||
Editor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"description": "Low-code programming for event-driven applications",
|
||||
"homepage": "https://nodered.org",
|
||||
"license": "Apache-2.0",
|
||||
@@ -123,6 +123,6 @@
|
||||
"supertest": "6.3.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=18.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,20 +160,30 @@ function completeVerify(profile,done) {
|
||||
|
||||
|
||||
function genericStrategy(adminApp,strategy) {
|
||||
var crypto = require("crypto")
|
||||
var session = require('express-session')
|
||||
var MemoryStore = require('memorystore')(session)
|
||||
const crypto = require("crypto")
|
||||
const session = require('express-session')
|
||||
const MemoryStore = require('memorystore')(session)
|
||||
|
||||
adminApp.use(session({
|
||||
// As the session is only used across the life-span of an auth
|
||||
// hand-shake, we can use a instance specific random string
|
||||
secret: crypto.randomBytes(20).toString('hex'),
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
store: new MemoryStore({
|
||||
checkPeriod: 86400000 // prune expired entries every 24h
|
||||
})
|
||||
}));
|
||||
const sessionOptions = {
|
||||
// As the session is only used across the life-span of an auth
|
||||
// hand-shake, we can use a instance specific random string
|
||||
secret: crypto.randomBytes(20).toString('hex'),
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
store: new MemoryStore({
|
||||
checkPeriod: 86400000 // prune expired entries every 24h
|
||||
})
|
||||
}
|
||||
if (settings.httpAdminCookieOptions) {
|
||||
sessionOptions.cookie = {
|
||||
path: '/',
|
||||
httpOnly: true,
|
||||
secure: false,
|
||||
maxAge: null,
|
||||
...settings.httpAdminCookieOptions
|
||||
}
|
||||
}
|
||||
adminApp.use(session(sessionOptions));
|
||||
//TODO: all passport references ought to be in ./auth
|
||||
adminApp.use(passport.initialize());
|
||||
adminApp.use(passport.session());
|
||||
@@ -205,9 +215,10 @@ function genericStrategy(adminApp,strategy) {
|
||||
passport.use(new strategy.strategy(options, verify));
|
||||
|
||||
adminApp.get('/auth/strategy',
|
||||
passport.authenticate(strategy.name, {session:false,
|
||||
passport.authenticate(strategy.name, {
|
||||
session:false,
|
||||
failureMessage: true,
|
||||
failureRedirect: settings.httpAdminRoot
|
||||
failureRedirect: settings.httpAdminRoot + '?session_message=Login Failed'
|
||||
}),
|
||||
completeGenerateStrategyAuth,
|
||||
handleStrategyError
|
||||
@@ -221,7 +232,7 @@ function genericStrategy(adminApp,strategy) {
|
||||
passport.authenticate(strategy.name, {
|
||||
session:false,
|
||||
failureMessage: true,
|
||||
failureRedirect: settings.httpAdminRoot
|
||||
failureRedirect: settings.httpAdminRoot + '?session_message=Login Failed'
|
||||
}),
|
||||
completeGenerateStrategyAuth,
|
||||
handleStrategyError
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-api",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "4.0.0-beta.2",
|
||||
"@node-red/editor-client": "4.0.0-beta.2",
|
||||
"@node-red/util": "4.0.0-beta.3-1",
|
||||
"@node-red/editor-client": "4.0.0-beta.3-1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"body-parser": "1.20.2",
|
||||
"clone": "2.1.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/editor-client",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -63,7 +63,7 @@ RED.deploy = (function() {
|
||||
'<img src="red/images/spin.svg"/>'+
|
||||
'</span>'+
|
||||
'</a>'+
|
||||
'<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
|
||||
'<a id="red-ui-header-button-deploy-options" class="red-ui-deploy-button" href="#"><i class="fa fa-caret-down"></i><i class="fa fa-lock"></i></a>'+
|
||||
'</span></li>').prependTo(".red-ui-header-toolbar");
|
||||
const mainMenuItems = [
|
||||
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
|
||||
@@ -124,6 +124,9 @@ RED.deploy = (function() {
|
||||
})
|
||||
|
||||
RED.events.on('workspace:dirty',function(state) {
|
||||
if (RED.settings.user?.permissions === 'read') {
|
||||
return
|
||||
}
|
||||
if (state.dirty) {
|
||||
// window.onbeforeunload = function() {
|
||||
// return
|
||||
@@ -169,6 +172,22 @@ RED.deploy = (function() {
|
||||
activeBackgroundDeployNotification.update(message, options)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
updateLockedState()
|
||||
RED.events.on('login', updateLockedState)
|
||||
}
|
||||
|
||||
function updateLockedState() {
|
||||
if (RED.settings.user?.permissions === 'read') {
|
||||
$(".red-ui-deploy-button-group").addClass("readOnly");
|
||||
$("#red-ui-header-button-deploy").addClass("disabled");
|
||||
} else {
|
||||
$(".red-ui-deploy-button-group").removeClass("readOnly");
|
||||
if (RED.nodes.dirty()) {
|
||||
$("#red-ui-header-button-deploy").removeClass("disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getNodeInfo(node) {
|
||||
@@ -624,7 +643,10 @@ RED.deploy = (function() {
|
||||
}
|
||||
});
|
||||
RED.nodes.eachSubflow(function (subflow) {
|
||||
subflow.changed = false;
|
||||
if (subflow.changed) {
|
||||
subflow.changed = false;
|
||||
RED.events.emit("subflows:change", subflow);
|
||||
}
|
||||
});
|
||||
RED.nodes.eachWorkspace(function (ws) {
|
||||
if (ws.changed || ws.added) {
|
||||
|
||||
@@ -1721,8 +1721,8 @@ RED.editor = (function() {
|
||||
}
|
||||
|
||||
if (!isSameObj(old_env, new_env)) {
|
||||
editing_node.env = new_env;
|
||||
editState.changes.env = editing_node.env;
|
||||
editing_node.env = new_env;
|
||||
editState.changed = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
_monaco.languages.json.jsonDefaults.setDiagnosticsOptions(diagnosticOptions);
|
||||
if(modeConfiguration) { _monaco.languages.json.jsonDefaults.setModeConfiguration(modeConfiguration); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up json options", err)
|
||||
console.warn("monaco - Error setting up json options", error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
if(htmlDefaults) { _monaco.languages.html.htmlDefaults.setOptions(htmlDefaults); }
|
||||
if(handlebarDefaults) { _monaco.languages.html.handlebarDefaults.setOptions(handlebarDefaults); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up html options", err)
|
||||
console.warn("monaco - Error setting up html options", error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ RED.editor.codeEditor.monaco = (function() {
|
||||
if(lessDefaults_modeConfiguration) { _monaco.languages.css.cssDefaults.setDiagnosticsOptions(lessDefaults_modeConfiguration); }
|
||||
if(scssDefaults_modeConfiguration) { _monaco.languages.css.cssDefaults.setDiagnosticsOptions(scssDefaults_modeConfiguration); }
|
||||
} catch (error) {
|
||||
console.warn("monaco - Error setting up CSS/SCSS/LESS options", err)
|
||||
console.warn("monaco - Error setting up CSS/SCSS/LESS options", error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -186,6 +186,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
.red-ui-deploy-button-group.readOnly {
|
||||
.fa-caret-down { display: none; }
|
||||
.fa-lock { display: inline-block; }
|
||||
}
|
||||
.red-ui-deploy-button-group:not(.readOnly) {
|
||||
.fa-caret-down { display: inline-block; }
|
||||
.fa-lock { display: none; }
|
||||
}
|
||||
.red-ui-deploy-button-group.readOnly {
|
||||
a {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.open .button {
|
||||
background: var(--red-ui-header-button-background-active);
|
||||
border-color: var(--red-ui-header-button-background-active);
|
||||
|
||||
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-background-deploy.png
vendored
Normal file
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-background-deploy.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-diff-update.png
vendored
Normal file
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-diff-update.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-multiplayer-location.png
vendored
Normal file
BIN
packages/node_modules/@node-red/editor-client/src/tours/images/nr4-multiplayer-location.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -1,12 +1,12 @@
|
||||
export default {
|
||||
version: "4.0.0-beta.2",
|
||||
version: "4.0.0-beta.3",
|
||||
steps: [
|
||||
{
|
||||
titleIcon: "fa fa-map-o",
|
||||
title: {
|
||||
"en-US": "Welcome to Node-RED 4.0 Beta 2!",
|
||||
"ja": "Node-RED 4.0 Beta 2へようこそ!",
|
||||
"fr": "Bienvenue dans Node-RED 4.0 Beta 2!"
|
||||
"en-US": "Welcome to Node-RED 4.0 Beta 3!",
|
||||
"ja": "Node-RED 4.0 Beta 3へようこそ!",
|
||||
"fr": "Bienvenue dans Node-RED 4.0 Beta 3!"
|
||||
},
|
||||
description: {
|
||||
"en-US": "<p>Let's take a moment to discover the new features in this release.</p>",
|
||||
@@ -20,22 +20,62 @@ export default {
|
||||
"ja": "複数ユーザ同時利用モード",
|
||||
"fr": "Mode Multi-utilisateur"
|
||||
},
|
||||
image: 'images/nr4-multiplayer.png',
|
||||
image: 'images/nr4-multiplayer-location.png',
|
||||
description: {
|
||||
"en-US": `<p>This release includes the first small steps towards making Node-RED easier
|
||||
to work with when you have multiple people editing flows at the same time.</p>
|
||||
<p>When this feature is enabled, you will now see who else has the editor open and some
|
||||
basic information on where they are in the editor.</p>
|
||||
<p>Check the release post for details on how to enable this feature in your settings file.</p>`,
|
||||
"ja": `<p>本リリースには、複数ユーザが同時にフローを編集する時に、Node-REDをより使いやすくするのための最初の微修正が入っています。</p>
|
||||
<p>本機能を有効にすると、誰がエディタを開いているか、その人がエディタ上のどこにいるかの基本的な情報が表示されます。</p>
|
||||
<p>設定ファイルで本機能を有効化する方法の詳細は、リリースの投稿を確認してください。</p>`,
|
||||
"fr": `<p>Cette version inclut les premières étapes visant à rendre Node-RED plus facile à utiliser
|
||||
lorsque plusieurs personnes modifient des flux en même temps.</p>
|
||||
<p>Lorsque cette fonctionnalité est activée, vous pourrez désormais voir si d’autres utilisateurs ont
|
||||
ouvert l'éditeur. Vous pourrez également savoir où ces utilisateurs se trouvent dans l'éditeur.</p>
|
||||
<p>Consultez la note de publication pour plus de détails sur la façon d'activer cette fonctionnalité
|
||||
dans votre fichier de paramètres.</p>`
|
||||
"en-US": `<p>Multiplayer mode was introduced in the previous beta. With this release it
|
||||
now shows where in the editor other users are.</p>
|
||||
<p>As with the last beta, check the release post for details on how to enable this feature in your settings file.</p>`,
|
||||
// "ja": ``,
|
||||
"fr": `<p>Le mode multi-utilisateur a été introduit dans la version bêta précédente. Avec cette nouvelle version, vous
|
||||
pourrez désormais savoir où ces utilisateurs se trouvent dans l'éditeur.</p>
|
||||
<p>Comme pour la dernière version bêta, consultez la note de publication pour plus de détails sur la façon d'activer
|
||||
cette fonctionnalité dans votre fichier de paramètres.</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "Better background deploy handling",
|
||||
// "ja": "",
|
||||
"fr": "Meilleure gestion du déploiement en arrière-plan"
|
||||
},
|
||||
image: 'images/nr4-background-deploy.png',
|
||||
description: {
|
||||
"en-US": `<p>If another user deploys changes whilst you are editing, we now use a more discrete notification
|
||||
that doesn't stop you continuing your work - especially if they are being very productive and deploying lots
|
||||
of changes.</p>`,
|
||||
// "ja": ``,
|
||||
"fr": `<p>Si un autre utilisateur déploie des modifications pendant que vous êtes en train de modifier, vous recevrez
|
||||
une notification plus discrète qu'auparavant qui ne vous empêche pas de continuer votre travail.</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "Improved flow diffs",
|
||||
// "ja": "",
|
||||
"fr": "Amélioration des différences de flux"
|
||||
},
|
||||
image: 'images/nr4-diff-update.png',
|
||||
description: {
|
||||
"en-US": `<p>When viewing changes made to a flow, Node-RED now distinguishes between nodes that have had configuration
|
||||
changes and those that have only been moved.<p>
|
||||
<p>When faced with a long list of changes to look at, this makes it much easier to focus on more sigificant items.</p>`,
|
||||
// "ja": ``,
|
||||
"fr": `<p>Lors de l'affichage des modifications apportées à un flux, Node-RED fait désormais la distinction entre les
|
||||
noeuds qui ont changé de configuration et ceux qui ont seulement été déplacés.<p>
|
||||
<p>Face à une longue liste de changements à examiner, il est beaucoup plus facile de se concentrer sur les éléments les
|
||||
plus importants.</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "That's it for Beta 3!",
|
||||
"ja": "ベータ2については以上です!",
|
||||
"fr": "C'est tout pour la bêta 3 !"
|
||||
},
|
||||
description: {
|
||||
"en-US": `<p>Keep clicking through to see what was added in previous beta releases</p>`,
|
||||
"ja": `<p>クリックを続けてベータ1で追加された内容を確認してください。</p>`,
|
||||
"fr": `<p>Continuez à cliquer pour voir ce qui a été ajouté dans la version bêta 1</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -87,18 +127,6 @@ export default {
|
||||
des noeuds pour la palette.</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "That's it for Beta 2!",
|
||||
"ja": "ベータ2については以上です!",
|
||||
"fr": "C'est tout pour la bêta 2 !"
|
||||
},
|
||||
description: {
|
||||
"en-US": `<p>Keep clicking through to see what was added in Beta 1</p>`,
|
||||
"ja": `<p>クリックを続けてベータ1で追加された内容を確認してください。</p>`,
|
||||
"fr": `<p>Continuez à cliquer pour voir ce qui a été ajouté dans la version bêta 1</p>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
"en-US": "Timestamp formatting options",
|
||||
|
||||
@@ -76,7 +76,7 @@ declare namespace RED {
|
||||
*/
|
||||
function compareObjects(obj1: any, obj2: any): boolean;
|
||||
/**
|
||||
* Generates a psuedo-unique-random id.
|
||||
* Generates a pseudo-unique-random id.
|
||||
* @return {string} a random-ish id
|
||||
* @memberof @node-red/util_util
|
||||
*/
|
||||
|
||||
@@ -374,7 +374,7 @@ module.exports = function(RED) {
|
||||
iniOpt.breakOnSigint = true;
|
||||
}
|
||||
}
|
||||
node.script = vm.createScript(functionText, createVMOpt(node, ""));
|
||||
node.script = new vm.Script(functionText, createVMOpt(node, ""));
|
||||
if (node.fin && (node.fin !== "")) {
|
||||
var finText = `(function () {
|
||||
var node = {
|
||||
@@ -438,10 +438,9 @@ module.exports = function(RED) {
|
||||
|
||||
//store the error in msg to be used in flows
|
||||
msg.error = err;
|
||||
|
||||
var line = 0;
|
||||
var errorMessage;
|
||||
if (stack.length > 0) {
|
||||
let line = 0;
|
||||
let errorMessage;
|
||||
while (line < stack.length && stack[line].indexOf("ReferenceError") !== 0) {
|
||||
line++;
|
||||
}
|
||||
@@ -455,11 +454,13 @@ module.exports = function(RED) {
|
||||
errorMessage += " (line "+lineno+", col "+cha+")";
|
||||
}
|
||||
}
|
||||
if (errorMessage) {
|
||||
err.message = errorMessage
|
||||
}
|
||||
}
|
||||
if (!errorMessage) {
|
||||
errorMessage = err.toString();
|
||||
}
|
||||
done(errorMessage);
|
||||
// Pass the whole error object so any additional properties
|
||||
// (such as cause) are preserved
|
||||
done(err);
|
||||
}
|
||||
else if (typeof err === "string") {
|
||||
done(err);
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<h4>Automatic mode</h4>
|
||||
<p>Automatic mode uses the <code>parts</code> property of incoming messages to
|
||||
determine how the sequence should be joined. This allows it to automatically
|
||||
reverse the action of a <b>split</b> node.
|
||||
reverse the action of a <b>split</b> node.</p>
|
||||
|
||||
<h4>Manual mode</h4>
|
||||
<p>When configured to join in manual mode, the node is able to join sequences
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/nodes",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -28,11 +28,6 @@ let installEnabled = true;
|
||||
let installAllowList = ['*'];
|
||||
let installDenyList = [];
|
||||
|
||||
let IMPORT_SUPPORTED = true;
|
||||
const nodeVersionParts = process.versions.node.split(".").map(v => parseInt(v));
|
||||
if (nodeVersionParts[0] < 12 || (nodeVersionParts[0] === 12 && nodeVersionParts[1] < 17)) {
|
||||
IMPORT_SUPPORTED = false;
|
||||
}
|
||||
|
||||
function getInstallDir() {
|
||||
return path.resolve(settings.userDir || process.env.NODE_RED_HOME || ".");
|
||||
@@ -110,18 +105,6 @@ function requireModule(module) {
|
||||
return require(moduleDir);
|
||||
}
|
||||
function importModule(module) {
|
||||
if (!IMPORT_SUPPORTED) {
|
||||
// On Node < 12.17 - fall back to try a require
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const mod = requireModule(module);
|
||||
resolve(mod);
|
||||
} catch(err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!registryUtil.checkModuleAllowed( module, null,installAllowList,installDenyList)) {
|
||||
const e = new Error("Module not allowed");
|
||||
e.code = "module_not_allowed";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/registry",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/util": "4.0.0-beta.2",
|
||||
"@node-red/util": "4.0.0-beta.3-1",
|
||||
"clone": "2.1.2",
|
||||
"fs-extra": "11.1.1",
|
||||
"semver": "7.5.4",
|
||||
|
||||
@@ -678,6 +678,9 @@ class Flow {
|
||||
if (logMessage.hasOwnProperty('stack')) {
|
||||
errorMessage.error.stack = logMessage.stack;
|
||||
}
|
||||
if (logMessage.hasOwnProperty('cause')) {
|
||||
errorMessage.error.cause = logMessage.cause;
|
||||
}
|
||||
targetCatchNode.receive(errorMessage);
|
||||
handled = true;
|
||||
});
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
"refresh-interval": "Erneuerung der https-Einstellungen erfolgt alle __interval__ Stunden",
|
||||
"settings-refreshed": "https-Einstellungen wurden erneuert",
|
||||
"refresh-failed": "Erneuerung der https-Einstellungen fehlgeschlagen: __message__",
|
||||
"nodejs-version": "httpsRefreshInterval erfordert Node.js 11 oder höher",
|
||||
"function-required": "httpsRefreshInterval erfordert die https-Eigenschaft in Form einer Funktion"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
"refresh-interval": "Refreshing https settings every __interval__ hours",
|
||||
"settings-refreshed": "Server https settings have been refreshed",
|
||||
"refresh-failed": "Failed to refresh https settings: __message__",
|
||||
"nodejs-version": "httpsRefreshInterval requires Node.js 11 or later",
|
||||
"function-required": "httpsRefreshInterval requires https property to be a function"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
"refresh-interval": "Actualizando la configuración HTTPS cada __interval__ horas",
|
||||
"settings-refreshed": "La configuración HTTPS del servidor se ha actualizado",
|
||||
"refresh-failed": "No se pudo actualizar la configuración HTTPS: __message__",
|
||||
"nodejs-version": "httpsRefreshInterval requiere Node.js 11 o superior",
|
||||
"function-required": "httpsRefreshInterval requiere que la propiedad HTTPS sea una función"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
"refresh-interval": "Actualisation des paramètres https toutes les __interval__ heures",
|
||||
"settings-refreshed": "Les paramètres https du serveur ont été actualisés",
|
||||
"refresh-failed": "Échec de l'actualisation des paramètres https : __message__",
|
||||
"nodejs-version": "httpsRefreshInterval nécessite Node.js 11 ou version ultérieure",
|
||||
"function-required": "httpsRefreshInterval nécessite que la propriété https soit une fonction"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
"refresh-interval": "__interval__ 時間毎にhttps設定を更新します",
|
||||
"settings-refreshed": "サーバのhttps設定が更新されました",
|
||||
"refresh-failed": "https設定の更新で失敗しました: __message__",
|
||||
"nodejs-version": "httpsRefreshIntervalにはNode.js 11以降が必要です",
|
||||
"function-required": "httpsRefreshIntervalでは、httpsプロパティはfunctionである必要があります"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
"refresh-interval": "Atualizando as configurações de https a cada __interval__ hora(s)",
|
||||
"settings-refreshed": "As configurações https do servidor foram atualizadas",
|
||||
"refresh-failed": "Falha ao atualizar as configurações https: __message__",
|
||||
"nodejs-version": "httpsRefreshInterval requer Node.js 11 ou posterior",
|
||||
"function-required": "httpsRefreshInterval requer que a propriedade https seja uma função"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
"refresh-interval": "Обновление настроек https каждые __interval__ часов",
|
||||
"settings-refreshed": "Настройки сервера https обновлены",
|
||||
"refresh-failed": "Не удалось обновить настройки https: __message__",
|
||||
"nodejs-version": "httpsRefreshInterval требует Node.js 11 или выше",
|
||||
"function-required": "httpsRefreshInterval требует, чтобы свойство https было функцией"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/runtime",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./lib/index.js",
|
||||
"repository": {
|
||||
@@ -16,8 +16,8 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@node-red/registry": "4.0.0-beta.2",
|
||||
"@node-red/util": "4.0.0-beta.2",
|
||||
"@node-red/registry": "4.0.0-beta.3-1",
|
||||
"@node-red/util": "4.0.0-beta.3-1",
|
||||
"async-mutex": "0.4.0",
|
||||
"clone": "2.1.2",
|
||||
"express": "4.19.2",
|
||||
|
||||
@@ -27,7 +27,7 @@ const util = require("util");
|
||||
const { hasOwnProperty } = Object.prototype;
|
||||
const log = require("./log")
|
||||
/**
|
||||
* Safely returns the object construtor name.
|
||||
* Safely returns the object constructor name.
|
||||
* @return {String} the name of the object constructor if it exists, empty string otherwise.
|
||||
*/
|
||||
function constructorName(obj) {
|
||||
@@ -37,7 +37,7 @@ function constructorName(obj) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a psuedo-unique-random id.
|
||||
* Generates a pseudo-unique-random id.
|
||||
* @return {String} a random-ish id
|
||||
* @memberof @node-red/util_util
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@node-red/util",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-1",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
8
packages/node_modules/node-red/lib/red.js
vendored
8
packages/node_modules/node-red/lib/red.js
vendored
@@ -25,11 +25,9 @@ var api = require("@node-red/editor-api");
|
||||
var server = null;
|
||||
var apiEnabled = false;
|
||||
|
||||
const NODE_MAJOR_VERSION = process.versions.node.split('.')[0];
|
||||
if (NODE_MAJOR_VERSION >= 16) {
|
||||
const dns = require('dns');
|
||||
dns.setDefaultResultOrder('ipv4first');
|
||||
}
|
||||
// Ensure ipv4 results are returned first: https://github.com/node-red/node-red/issues/4010
|
||||
const dns = require('dns');
|
||||
dns.setDefaultResultOrder('ipv4first');
|
||||
|
||||
function checkVersion(userSettings) {
|
||||
var semver = require('semver');
|
||||
|
||||
12
packages/node_modules/node-red/package.json
vendored
12
packages/node_modules/node-red/package.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red",
|
||||
"version": "4.0.0-beta.2",
|
||||
"version": "4.0.0-beta.3-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": "4.0.0-beta.2",
|
||||
"@node-red/runtime": "4.0.0-beta.2",
|
||||
"@node-red/util": "4.0.0-beta.2",
|
||||
"@node-red/nodes": "4.0.0-beta.2",
|
||||
"@node-red/editor-api": "4.0.0-beta.3-1",
|
||||
"@node-red/runtime": "4.0.0-beta.3-1",
|
||||
"@node-red/util": "4.0.0-beta.3-1",
|
||||
"@node-red/nodes": "4.0.0-beta.3-1",
|
||||
"basic-auth": "2.0.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"express": "4.19.2",
|
||||
@@ -47,6 +47,6 @@
|
||||
"bcrypt": "5.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=18.5"
|
||||
}
|
||||
}
|
||||
|
||||
63
packages/node_modules/node-red/red.js
vendored
63
packages/node_modules/node-red/red.js
vendored
@@ -42,6 +42,7 @@ try { bcrypt = require('bcrypt'); }
|
||||
catch(e) { bcrypt = require('bcryptjs'); }
|
||||
var nopt = require("nopt");
|
||||
var path = require("path");
|
||||
const os = require("os")
|
||||
var fs = require("fs-extra");
|
||||
var RED = require("./lib/red.js");
|
||||
|
||||
@@ -59,6 +60,7 @@ var knownOpts = {
|
||||
"userDir": [path],
|
||||
"verbose": Boolean,
|
||||
"safe": Boolean,
|
||||
"version": Boolean,
|
||||
"define": [String, Array]
|
||||
};
|
||||
var shortHands = {
|
||||
@@ -92,6 +94,7 @@ if (parsedArgs.help) {
|
||||
console.log(" -v, --verbose enable verbose output");
|
||||
console.log(" --safe enable safe mode");
|
||||
console.log(" -D, --define X=Y overwrite value in settings file");
|
||||
console.log(" --version show version information");
|
||||
console.log(" -?, --help show this help");
|
||||
console.log(" admin <command> run an admin command");
|
||||
console.log("");
|
||||
@@ -99,6 +102,13 @@ if (parsedArgs.help) {
|
||||
process.exit();
|
||||
}
|
||||
|
||||
if (parsedArgs.version) {
|
||||
console.log("Node-RED v"+RED.version())
|
||||
console.log("Node.js "+process.version)
|
||||
console.log(os.type()+" "+os.release()+" "+os.arch()+" "+os.endianness())
|
||||
process.exit()
|
||||
}
|
||||
|
||||
if (parsedArgs.argv.remain.length > 0) {
|
||||
flowFile = parsedArgs.argv.remain[0];
|
||||
}
|
||||
@@ -240,39 +250,34 @@ httpsPromise.then(function(startupHttps) {
|
||||
// Max value based on (2^31-1)ms - the max that setInterval can accept
|
||||
httpsRefreshInterval = 596;
|
||||
}
|
||||
// Check whether setSecureContext is available (Node.js 11+)
|
||||
if (server.setSecureContext) {
|
||||
// Check whether `http` is a callable function
|
||||
if (typeof settings.https === "function") {
|
||||
delayedLogItems.push({type:"info", id:"server.https.refresh-interval", params:{interval:httpsRefreshInterval}});
|
||||
setInterval(function () {
|
||||
try {
|
||||
// Get the result of the function, because createServer doesn't accept functions as input
|
||||
Promise.resolve(settings.https()).then(function(refreshedHttps) {
|
||||
if (refreshedHttps) {
|
||||
// The key/cert needs to be updated in the NodeJs http(s) server, when no key/cert is yet available or when the key/cert has changed.
|
||||
// Note that the refreshed key/cert can be supplied as a string or a buffer.
|
||||
var updateKey = (server.key == undefined || (Buffer.isBuffer(server.key) && !server.key.equals(refreshedHttps.key)) || (typeof server.key == "string" && server.key != refreshedHttps.key));
|
||||
var updateCert = (server.cert == undefined || (Buffer.isBuffer(server.cert) && !server.cert.equals(refreshedHttps.cert)) || (typeof server.cert == "string" && server.cert != refreshedHttps.cert));
|
||||
// Check whether `http` is a callable function
|
||||
if (typeof settings.https === "function") {
|
||||
delayedLogItems.push({type:"info", id:"server.https.refresh-interval", params:{interval:httpsRefreshInterval}});
|
||||
setInterval(function () {
|
||||
try {
|
||||
// Get the result of the function, because createServer doesn't accept functions as input
|
||||
Promise.resolve(settings.https()).then(function(refreshedHttps) {
|
||||
if (refreshedHttps) {
|
||||
// The key/cert needs to be updated in the NodeJs http(s) server, when no key/cert is yet available or when the key/cert has changed.
|
||||
// Note that the refreshed key/cert can be supplied as a string or a buffer.
|
||||
var updateKey = (server.key == undefined || (Buffer.isBuffer(server.key) && !server.key.equals(refreshedHttps.key)) || (typeof server.key == "string" && server.key != refreshedHttps.key));
|
||||
var updateCert = (server.cert == undefined || (Buffer.isBuffer(server.cert) && !server.cert.equals(refreshedHttps.cert)) || (typeof server.cert == "string" && server.cert != refreshedHttps.cert));
|
||||
|
||||
// Only update the credentials in the server when key or cert has changed
|
||||
if(updateKey || updateCert) {
|
||||
server.setSecureContext(refreshedHttps);
|
||||
RED.log.info(RED.log._("server.https.settings-refreshed"));
|
||||
}
|
||||
// Only update the credentials in the server when key or cert has changed
|
||||
if(updateKey || updateCert) {
|
||||
server.setSecureContext(refreshedHttps);
|
||||
RED.log.info(RED.log._("server.https.settings-refreshed"));
|
||||
}
|
||||
}).catch(function(err) {
|
||||
RED.log.error(RED.log._("server.https.refresh-failed",{message:err}));
|
||||
});
|
||||
} catch(err) {
|
||||
}
|
||||
}).catch(function(err) {
|
||||
RED.log.error(RED.log._("server.https.refresh-failed",{message:err}));
|
||||
}
|
||||
}, httpsRefreshInterval*60*60*1000);
|
||||
} else {
|
||||
delayedLogItems.push({type:"warn", id:"server.https.function-required"});
|
||||
}
|
||||
});
|
||||
} catch(err) {
|
||||
RED.log.error(RED.log._("server.https.refresh-failed",{message:err}));
|
||||
}
|
||||
}, httpsRefreshInterval*60*60*1000);
|
||||
} else {
|
||||
delayedLogItems.push({type:"warn", id:"server.https.nodejs-version"});
|
||||
delayedLogItems.push({type:"warn", id:"server.https.function-required"});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
6
packages/node_modules/node-red/settings.js
vendored
6
packages/node_modules/node-red/settings.js
vendored
@@ -133,6 +133,7 @@ module.exports = {
|
||||
* - httpServerOptions
|
||||
* - httpAdminRoot
|
||||
* - httpAdminMiddleware
|
||||
* - httpAdminCookieOptions
|
||||
* - httpNodeRoot
|
||||
* - httpNodeCors
|
||||
* - httpNodeMiddleware
|
||||
@@ -178,6 +179,11 @@ module.exports = {
|
||||
// next();
|
||||
// },
|
||||
|
||||
/** The following property can be used to set addition options on the session
|
||||
* cookie used as part of adminAuth authentication system
|
||||
* Available options are documented here: https://www.npmjs.com/package/express-session#cookie
|
||||
*/
|
||||
// httpAdminCookieOptions: { },
|
||||
|
||||
/** Some nodes, such as HTTP In, can be used to listen for incoming http requests.
|
||||
* By default, these are served relative to '/'. The following property
|
||||
|
||||
@@ -390,7 +390,8 @@ describe('function node', function() {
|
||||
msg.should.have.property('level', helper.log().ERROR);
|
||||
msg.should.have.property('id', 'n1');
|
||||
msg.should.have.property('type', 'function');
|
||||
msg.should.have.property('msg', 'ReferenceError: retunr is not defined (line 2, col 1)');
|
||||
msg.should.have.property('msg')
|
||||
msg.msg.message.should.equal('ReferenceError: retunr is not defined (line 2, col 1)');
|
||||
done();
|
||||
} catch(err) {
|
||||
done(err);
|
||||
@@ -659,7 +660,8 @@ describe('function node', function() {
|
||||
msg.should.have.property('level', helper.log().ERROR);
|
||||
msg.should.have.property('id', name);
|
||||
msg.should.have.property('type', 'function');
|
||||
msg.should.have.property('msg', 'Error: Callback must be a function');
|
||||
msg.should.have.property('msg')
|
||||
msg.msg.message.should.equal('Callback must be a function');
|
||||
done();
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
@@ -2509,69 +2509,59 @@ describe('HTTP Request Node', function() {
|
||||
});
|
||||
|
||||
describe('should parse broken headers', function() {
|
||||
let port = testPort++
|
||||
|
||||
const versions = process.versions.node.split('.')
|
||||
let server;
|
||||
|
||||
if (( versions[0] == 14 && versions[1] >= 20 ) ||
|
||||
( versions[0] == 16 && versions[1] >= 16 ) ||
|
||||
( versions[0] == 18 && versions[1] >= 5 ) ||
|
||||
( versions[0] > 18)) {
|
||||
// only test if on new enough NodeJS version
|
||||
before(function() {
|
||||
server = net.createServer(function (socket) {
|
||||
socket.write("HTTP/1.0 200\nContent-Type: text/plain\n\nHelloWorld")
|
||||
socket.end()
|
||||
})
|
||||
|
||||
let port = testPort++
|
||||
server.listen(port,'127.0.0.1', function(err) {
|
||||
})
|
||||
});
|
||||
|
||||
let server;
|
||||
after(function() {
|
||||
server.close()
|
||||
});
|
||||
|
||||
before(function() {
|
||||
server = net.createServer(function (socket) {
|
||||
socket.write("HTTP/1.0 200\nContent-Type: text/plain\n\nHelloWorld")
|
||||
socket.end()
|
||||
it('should accept broken headers', function (done) {
|
||||
var flow = [{id:'n1',type:'http request',wires:[['n2']],method:'GET',ret:'obj',url:`http://localhost:${port}/`, insecureHTTPParser: true},
|
||||
{id:"n2", type:"helper"}];
|
||||
helper.load(httpRequestNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on('input', function(msg) {
|
||||
try {
|
||||
msg.payload.should.equal('HelloWorld')
|
||||
done()
|
||||
} catch (err) {
|
||||
done(err)
|
||||
}
|
||||
})
|
||||
n1.receive({payload: 'foo'})
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(port,'127.0.0.1', function(err) {
|
||||
it('should reject broken headers', function (done) {
|
||||
var flow = [{id:'n1',type:'http request',wires:[['n2']],method:'GET',ret:'obj',url:`http://localhost:${port}/`},
|
||||
{id:"n2", type:"helper"}];
|
||||
helper.load(httpRequestNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on('input', function(msg) {
|
||||
try{
|
||||
msg.payload.should.match(/RequestError: Parse Error/)
|
||||
done()
|
||||
} catch (err) {
|
||||
done(err)
|
||||
}
|
||||
})
|
||||
});
|
||||
n1.receive({payload: 'foo'})
|
||||
|
||||
after(function() {
|
||||
server.close()
|
||||
});
|
||||
|
||||
it('should accept broken headers', function (done) {
|
||||
var flow = [{id:'n1',type:'http request',wires:[['n2']],method:'GET',ret:'obj',url:`http://localhost:${port}/`, insecureHTTPParser: true},
|
||||
{id:"n2", type:"helper"}];
|
||||
helper.load(httpRequestNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on('input', function(msg) {
|
||||
try {
|
||||
msg.payload.should.equal('HelloWorld')
|
||||
done()
|
||||
} catch (err) {
|
||||
done(err)
|
||||
}
|
||||
})
|
||||
n1.receive({payload: 'foo'})
|
||||
});
|
||||
});
|
||||
|
||||
it('should reject broken headers', function (done) {
|
||||
var flow = [{id:'n1',type:'http request',wires:[['n2']],method:'GET',ret:'obj',url:`http://localhost:${port}/`},
|
||||
{id:"n2", type:"helper"}];
|
||||
helper.load(httpRequestNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on('input', function(msg) {
|
||||
try{
|
||||
msg.payload.should.match(/RequestError: Parse Error/)
|
||||
done()
|
||||
} catch (err) {
|
||||
done(err)
|
||||
}
|
||||
})
|
||||
n1.receive({payload: 'foo'})
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user