mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'dev' into monaco-0-49-0
This commit is contained in:
commit
6317420d4a
@ -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());
|
||||
|
@ -25,7 +25,7 @@ function hasPermission(userScope,permission) {
|
||||
}
|
||||
var i;
|
||||
|
||||
if (util.isArray(permission)) {
|
||||
if (Array.isArray(permission)) {
|
||||
// Multiple permissions requested - check each one
|
||||
for (i=0;i<permission.length;i++) {
|
||||
if (!hasPermission(userScope,permission[i])) {
|
||||
@ -36,7 +36,7 @@ function hasPermission(userScope,permission) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (util.isArray(userScope)) {
|
||||
if (Array.isArray(userScope)) {
|
||||
if (userScope.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ function init(config) {
|
||||
} else {
|
||||
var us = config.users;
|
||||
/* istanbul ignore else */
|
||||
if (!util.isArray(us)) {
|
||||
if (!Array.isArray(us)) {
|
||||
us = [us];
|
||||
}
|
||||
for (var i=0;i<us.length;i++) {
|
||||
|
@ -70,7 +70,7 @@ function serveFilesFromTheme(themeValue, themeApp, directory, baseDirectory) {
|
||||
var result = [];
|
||||
if (themeValue) {
|
||||
var array = themeValue;
|
||||
if (!util.isArray(array)) {
|
||||
if (!Array.isArray(array)) {
|
||||
array = [array];
|
||||
}
|
||||
|
||||
|
@ -372,6 +372,7 @@
|
||||
"deleted": "削除",
|
||||
"flowDeleted": "削除されたフロー",
|
||||
"flowAdded": "追加されたフロー",
|
||||
"moved": "移動",
|
||||
"movedTo": "__id__ へ移動",
|
||||
"movedFrom": "__id__ から移動"
|
||||
},
|
||||
|
@ -25,7 +25,8 @@ export default {
|
||||
"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": ``,
|
||||
"ja": `<p>複数ユーザ同時利用モードは、前のベータ版で導入されました。本リリースでは、他のユーザがエディタ上のどこにいるかを表示するようになりました。</p>
|
||||
<p>直近のベータ版と同様、settingsファイルで本機能を有効にする方法の詳細については、リリースの投稿を確認してください。</p>`,
|
||||
"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
|
||||
@ -35,7 +36,7 @@ export default {
|
||||
{
|
||||
title: {
|
||||
"en-US": "Better background deploy handling",
|
||||
// "ja": "",
|
||||
"ja": "バックグラウンドのデプロイ処理の改善",
|
||||
"fr": "Meilleure gestion du déploiement en arrière-plan"
|
||||
},
|
||||
image: 'images/nr4-background-deploy.png',
|
||||
@ -43,7 +44,7 @@ export default {
|
||||
"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": ``,
|
||||
"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>`
|
||||
}
|
||||
@ -51,15 +52,16 @@ export default {
|
||||
{
|
||||
title: {
|
||||
"en-US": "Improved flow diffs",
|
||||
// "ja": "",
|
||||
"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": ``,
|
||||
<p>When faced with a long list of changes to look at, this makes it much easier to focus on more significant items.</p>`,
|
||||
"ja": `<p>フローの変更内容を表示する時に、Node-REDは設定が変更されたノードと、移動されただけのノードを区別するようになりました。<p>
|
||||
<p>これによって、多くの変更内容を確認する際に、重要な項目に焦点を当てることができます。</p>`,
|
||||
"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
|
||||
@ -69,12 +71,12 @@ export default {
|
||||
{
|
||||
title: {
|
||||
"en-US": "That's it for Beta 3!",
|
||||
"ja": "ベータ2については以上です!",
|
||||
"ja": "ベータ3については以上です!",
|
||||
"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>`,
|
||||
"ja": `<p>クリックを続けて、これまでのベータリリースで追加された内容を確認してください。</p>`,
|
||||
"fr": `<p>Continuez à cliquer pour voir ce qui a été ajouté dans la version bêta 1</p>`
|
||||
}
|
||||
},
|
||||
|
@ -25,19 +25,19 @@ module.exports = function(RED) {
|
||||
function sendResults(node,send,_msgid,msgs,cloneFirstMessage) {
|
||||
if (msgs == null) {
|
||||
return;
|
||||
} else if (!util.isArray(msgs)) {
|
||||
} else if (!Array.isArray(msgs)) {
|
||||
msgs = [msgs];
|
||||
}
|
||||
var msgCount = 0;
|
||||
for (var m=0; m<msgs.length; m++) {
|
||||
if (msgs[m]) {
|
||||
if (!util.isArray(msgs[m])) {
|
||||
if (!Array.isArray(msgs[m])) {
|
||||
msgs[m] = [msgs[m]];
|
||||
}
|
||||
for (var n=0; n < msgs[m].length; n++) {
|
||||
var msg = msgs[m][n];
|
||||
if (msg !== null && msg !== undefined) {
|
||||
if (typeof msg === 'object' && !Buffer.isBuffer(msg) && !util.isArray(msg)) {
|
||||
if (typeof msg === 'object' && !Buffer.isBuffer(msg) && !Array.isArray(msg)) {
|
||||
if (msgCount === 0 && cloneFirstMessage !== false) {
|
||||
msgs[m][n] = RED.util.cloneMessage(msgs[m][n]);
|
||||
msg = msgs[m][n];
|
||||
@ -47,7 +47,7 @@ module.exports = function(RED) {
|
||||
} else {
|
||||
var type = typeof msg;
|
||||
if (type === 'object') {
|
||||
type = Buffer.isBuffer(msg)?'Buffer':(util.isArray(msg)?'Array':'Date');
|
||||
type = Buffer.isBuffer(msg)?'Buffer':(Array.isArray(msg)?'Array':'Date');
|
||||
}
|
||||
node.error(RED._("function.error.non-message-returned",{ type: type }));
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ var api = module.exports = {
|
||||
}
|
||||
}
|
||||
safeSettings.libraries = runtime.library.getLibraries();
|
||||
if (util.isArray(runtime.settings.paletteCategories)) {
|
||||
if (Array.isArray(runtime.settings.paletteCategories)) {
|
||||
safeSettings.paletteCategories = runtime.settings.paletteCategories;
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ Node.prototype.send = function(msg) {
|
||||
|
||||
if (msg === null || typeof msg === "undefined") {
|
||||
return;
|
||||
} else if (!util.isArray(msg)) {
|
||||
} else if (!Array.isArray(msg)) {
|
||||
// A single message has been passed in
|
||||
if (typeof msg !== 'object') {
|
||||
this.error(Log._("nodes.flow.non-message-returned", { type: typeof msg }));
|
||||
@ -425,7 +425,7 @@ Node.prototype.send = function(msg) {
|
||||
if (i < msg.length) {
|
||||
var msgs = msg[i]; // msgs going to output i
|
||||
if (msgs !== null && typeof msgs !== "undefined") {
|
||||
if (!util.isArray(msgs)) {
|
||||
if (!Array.isArray(msgs)) {
|
||||
msgs = [msgs];
|
||||
}
|
||||
var k = 0;
|
||||
|
@ -862,7 +862,7 @@ function encodeObject(msg,opts) {
|
||||
message: msg.msg.message
|
||||
});
|
||||
} else {
|
||||
var isArray = util.isArray(msg.msg);
|
||||
var isArray = Array.isArray(msg.msg);
|
||||
var needsStringify = isArray;
|
||||
if (isArray) {
|
||||
msg.format = "array["+msg.msg.length+"]";
|
||||
@ -906,7 +906,7 @@ function encodeObject(msg,opts) {
|
||||
}
|
||||
} else if (value instanceof Error) {
|
||||
value = value.toString()
|
||||
} else if (util.isArray(value) && value.length > debuglength) {
|
||||
} else if (Array.isArray(value) && value.length > debuglength) {
|
||||
value = {
|
||||
__enc__: true,
|
||||
type: "array",
|
||||
|
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user