From 528302f2974af0d3aeab454b63de3d42ff547696 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <50353452+hotlong@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:05:34 +0800 Subject: [PATCH] =?UTF-8?q?[Feature]:=20=E4=BC=81=E4=B8=9A=E7=89=88=20dock?= =?UTF-8?q?er=20=E9=A2=84=E8=A3=85node-red=20#7002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/enterprise/app/nodered/package.json | 18 ++++++++++++++++ .../enterprise/app/nodered/public/index.html | 5 +++++ deploy/enterprise/app/nodered/settings.js | 21 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 deploy/enterprise/app/nodered/package.json create mode 100644 deploy/enterprise/app/nodered/public/index.html create mode 100644 deploy/enterprise/app/nodered/settings.js diff --git a/deploy/enterprise/app/nodered/package.json b/deploy/enterprise/app/nodered/package.json new file mode 100644 index 0000000000..c7c6334c95 --- /dev/null +++ b/deploy/enterprise/app/nodered/package.json @@ -0,0 +1,18 @@ +{ + "name": "nodered-app", + "version": "1.0.0", + "private": "true", + "license": "MIT", + "scripts": { + "start": "node-red --settings settings.js" + }, + "dependencies": { + "@steedos/node-red-contrib-steedos": "^2.4.1", + "dotenv-flow": "^3.2.0", + "ioredis": "^5.3.2", + "lodash": "^4.17.21", + "node-red": "^3.0.2", + "node-red-dashboard": "^3.4.0" + } + } + \ No newline at end of file diff --git a/deploy/enterprise/app/nodered/public/index.html b/deploy/enterprise/app/nodered/public/index.html new file mode 100644 index 0000000000..d26359197c --- /dev/null +++ b/deploy/enterprise/app/nodered/public/index.html @@ -0,0 +1,5 @@ + + + Welcome to Steedos Integration. + + \ No newline at end of file diff --git a/deploy/enterprise/app/nodered/settings.js b/deploy/enterprise/app/nodered/settings.js new file mode 100644 index 0000000000..37f6c310ce --- /dev/null +++ b/deploy/enterprise/app/nodered/settings.js @@ -0,0 +1,21 @@ +"use strict"; +const path = require('path'); +const lodash = require('lodash'); + +// Node-Red Configuration +// https://nodered.org/docs/user-guide/runtime/configuration + +process.env.PORT = 3200; + +const storageDir = path.join(process.env.STEEDOS_STORAGE_DIR, "data", "node-red"); + +module.exports = { + flowFile: path.join(storageDir,'flows.json'), + flowFilePretty: true, + credentialSecret: process.env.NODERED_CREDENTIAL_SECRET || 'steedos', + userDir: path.join(storageDir, '.node-red'), + functionGlobalContext: { + lodash + }, + httpStatic: path.join(__dirname, 'public'), +};