Refuse to update a non-local node module

This commit is contained in:
Nick O'Leary
2017-01-24 22:50:40 +00:00
parent 8d34f87667
commit a69683183f
3 changed files with 19 additions and 3 deletions

View File

@@ -314,6 +314,9 @@
"body":"Updating the node will require a restart of Node-RED to complete the update. This must be done manually.",
"title": "Update nodes"
},
"cannotUpdate": {
"body":"An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
},
"button": {
"review": "Open node information",
"install": "Install",

View File

@@ -57,6 +57,11 @@ module.exports = {
res.status(400).json({error:"module_already_loaded", message:"Module already loaded"});
return;
}
if (!module.local) {
log.audit({event: "nodes.install",module:node.module, version:node.version, error:"module_not_local"},req);
res.status(400).json({error:"module_not_local", message:"Module not locally installed"});
return;
}
isUpgrade = true;
}
promise = redNodes.installModule(node.module,node.version);