Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 20, 2024
2 parents 2c94072 + 15e6e9f commit 81bb3af
Show file tree
Hide file tree
Showing 94 changed files with 480 additions and 402 deletions.
32 changes: 17 additions & 15 deletions deploy/enterprise/app/nodered/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"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",
"ioredis": "^5.3.2",
"lodash": "^4.17.21",
"node-red": "^3.0.2",
"node-red-dashboard": "^3.4.0"
}
"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",
"axios": "1.7.7",
"ioredis": "^5.3.2",
"lodash": "^4.17.21",
"node-red": "^3.1.12",
"node-red-dashboard": "^3.4.0",
"passport": "0.7.0",
"passport-custom": "1.1.1"
}
}
73 changes: 71 additions & 2 deletions deploy/enterprise/app/nodered/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
const path = require('path');
const fs = require('fs');
const lodash = require('lodash');
const bcrypt = require('bcryptjs');
const CustomStrategy = require('passport-custom').Strategy;
const axios = require('axios');

// Node-Red Configuration
// https://nodered.org/docs/user-guide/runtime/configuration

const steedosRootUrl = process.env.ROOT_URL || "http://127.0.0.1";

const uiPort = process.env.NODERED_PORT || "1880";
const storageDir = path.join(process.env.STEEDOS_STORAGE_DIR, "data", "nodered");
const storageDir = path.join(process.env.STEEDOS_STORAGE_DIR || "./storage", "data", "nodered");

const flowFilePath = path.join(storageDir, 'flows.json');
const templateFlowFilePath = path.join(__dirname, 'flows-template.json'); // 模板文件路径
Expand All @@ -26,7 +31,71 @@ module.exports = {
functionGlobalContext: {
lodash
},
header: {
title: "Steedos Flows",
},
page: {
title: "Steedos Flows",
},
uiPort,
// adminAuth: {
// type: "credentials",
// users: [{
// username: "admin",
// permissions: "*"
// }],
// authenticate: function(username, password) {
// if (username === 'admin') {
// // 将环境变量中的密码与输入的密码进行比较
// if (password === process.env.NODERED_PASSWORD) {
// return Promise.resolve({username: "admin", permissions: "*"});
// } else {
// return Promise.resolve(null);
// }
// } else {
// return Promise.resolve(null);
// }
// }
// },
httpStatic: path.join(__dirname, 'public'),
httpRoot: "/nodered/"
httpRoot: "/flows/",
adminAuth: {
type: "credentials",
users: function(username) {
// 返回一个 Promise
return new Promise(function(resolve) {
// 不需要在这里验证密码,因为密码在 authenticate 函数中处理
// 返回包含用户名的用户对象,但不包含密码
resolve({ username: username, permissions: "*" });
});
},
authenticate: function(username, password) {
return new Promise(function(resolve) {
// 构建请求体
const requestBody = {
"user": { "email": username },
"password-unencrypted": password
};

// 发送 POST 请求到身份验证接口
axios.post(`${steedosRootUrl}/accounts/password/login`, requestBody)
.then(response => {
console.log(response)
// 根据接口返回的数据判断验证是否成功
if (response.status === 200) {
// 验证成功,返回包含用户名和权限的用户对象
resolve({ username: username, permissions: "*" });
} else {
// 验证失败
resolve(null);
}
})
.catch(error => {
// 处理错误,拒绝 Promise
console.error('Authentication error:', error);
resolve(null);
});
});
}
},
};
6 changes: 5 additions & 1 deletion deploy/enterprise/fs/opt/steedos/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ init_env_file() {
tr -dc A-Za-z0-9 </dev/urandom | head -c 13
echo ""
)
local generated_steedos_nodered_password=$(
tr -dc A-Za-z0-9 </dev/urandom | head -c 13
echo ""
)
local generated_steedos_encryption_password=$(
tr -dc A-Za-z0-9 </dev/urandom | head -c 13
echo ""
Expand All @@ -39,7 +43,7 @@ init_env_file() {
tr -dc A-Za-z0-9 </dev/urandom | head -c 13
echo ''
)
bash "$TEMPLATES_PATH/docker.env.sh" "$default_steedos_mongodb_user" "$generated_steedos_mongodb_password" "$generated_steedos_encryption_password" "$generated_steedos_encription_salt" "$generated_steedos_supervisor_password" > "$ENV_PATH"
bash "$TEMPLATES_PATH/docker.env.sh" "$default_steedos_mongodb_user" "$generated_steedos_mongodb_password" "$generated_steedos_encryption_password" "$generated_steedos_encription_salt" "$generated_steedos_supervisor_password" "$generated_steedos_nodered_password" > "$ENV_PATH"
fi


Expand Down
3 changes: 3 additions & 0 deletions deploy/enterprise/fs/opt/steedos/templates/docker.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MONGO_PASSWORD="$2"
ENCRYPTION_PASSWORD="$3"
ENCRYPTION_SALT="$4"
SUPERVISOR_PASSWORD="$5"
NODERED_PASSWORD="$5"

cat <<EOF
Expand All @@ -27,6 +28,8 @@ STEEDOS_ENCRYPTION_SALT=$ENCRYPTION_SALT
STEEDOS_SUPERVISOR_USER=steedos
STEEDOS_SUPERVISOR_PASSWORD=$SUPERVISOR_PASSWORD
NODERED_PASSWORD=$NODERED_PASSWORD
UNPKG_BASE_URL=/unpkg
NPM_CACHE_ENABLED=true
Expand Down
4 changes: 2 additions & 2 deletions deploy/enterprise/fs/opt/steedos/templates/nginx-app.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ fi
}
location /nodered/ {
location /flows/ {
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_cache_bypass \$http_upgrade;
proxy_set_header Host \$host;
proxy_pass http://localhost:1880/nodered/;
proxy_pass http://localhost:1880/flows/;
}
location /nginx/ {
Expand Down
10 changes: 5 additions & 5 deletions ee/sso-oidc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@steedos/ee_sso-oidc",
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"main": "package.service.js",
"scripts": {
"build": "tsc"
Expand All @@ -11,14 +11,14 @@
"access": "public"
},
"dependencies": {
"@steedos/accounts": "2.7.9-beta.3",
"@steedos/objectql": "2.7.9-beta.3",
"@steedos/service-package-loader": "2.7.9-beta.3",
"@steedos/accounts": "2.7.9-beta.4",
"@steedos/objectql": "2.7.9-beta.4",
"@steedos/service-package-loader": "2.7.9-beta.4",
"@techpass/passport-openidconnect": "^0.3.2",
"express": "4.18.1",
"node-fetch": "^2.6.7",
"passport": "^0.6.0",
"request-ip": "^2.2.0"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
],
"useWorkspaces": true,
"npmClient": "yarn",
"version": "2.7.9-beta.3"
"version": "2.7.9-beta.4"
}
14 changes: 7 additions & 7 deletions packages/accounts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/accounts",
"private": false,
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"main": "lib/index.js",
"files": [
"/package.json",
Expand Down Expand Up @@ -29,7 +29,7 @@
"@accounts/two-factor": "^0.20.1",
"@accounts/types": "0.20.1",
"@babel/runtime": "^7.12.18",
"@steedos/utils": "2.7.9-beta.3",
"@steedos/utils": "2.7.9-beta.4",
"app-root-path": "^2.2.1",
"bcryptjs": "^2.4.3",
"body-parser": "1.19.0",
Expand All @@ -56,20 +56,20 @@
"validator": "^13.6.0"
},
"devDependencies": {
"@steedos/auth": "2.7.9-beta.3",
"@steedos/meteor-bundle-runner": "2.7.9-beta.3",
"@steedos/objectql": "2.7.9-beta.3",
"@steedos/auth": "2.7.9-beta.4",
"@steedos/meteor-bundle-runner": "2.7.9-beta.4",
"@steedos/objectql": "2.7.9-beta.4",
"@types/dotenv-flow": "^3.0.0",
"@types/node": "12.6.8",
"cross-env": "^7.0.3",
"dotenv": "^8.2.0",
"dotenv-flow": "^3.1.0",
"nodemon": "^2.0.19",
"steedos-server": "2.7.9-beta.3",
"steedos-server": "2.7.9-beta.4",
"typescript": "4.6.3"
},
"publishConfig": {
"access": "public"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
10 changes: 5 additions & 5 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/auth",
"private": false,
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"main": "lib/index.js",
"scripts": {
"watch": "tsc --watch",
Expand All @@ -13,9 +13,9 @@
"access": "public"
},
"dependencies": {
"@steedos/cachers": "2.7.9-beta.3",
"@steedos/objectql": "2.7.9-beta.3",
"@steedos/utils": "2.7.9-beta.3",
"@steedos/cachers": "2.7.9-beta.4",
"@steedos/objectql": "2.7.9-beta.4",
"@steedos/utils": "2.7.9-beta.4",
"bcryptjs": "^2.4.3",
"cookies": "^0.8.0",
"express": "^4.16.4",
Expand All @@ -27,5 +27,5 @@
"devDependencies": {
"typescript": "4.6.3"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
4 changes: 2 additions & 2 deletions packages/cachers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/cachers",
"private": false,
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand All @@ -19,5 +19,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steedos-cli",
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"description": "Develop and run your enterprise apps in miniutes",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -38,8 +38,8 @@
"@oclif/command": "^1.8.16",
"@oclif/config": "^1.8.3",
"@oclif/plugin-help": "^5.1.12",
"@steedos/metadata-core": "2.7.9-beta.3",
"@steedos/metadata-registrar": "2.7.9-beta.3",
"@steedos/metadata-core": "2.7.9-beta.4",
"@steedos/metadata-registrar": "2.7.9-beta.4",
"archiver": "^5.0.2",
"chalk": "2.4.2",
"change-case": "^3.1.0",
Expand Down Expand Up @@ -81,5 +81,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": false,
"name": "@steedos/client",
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"description": "client lib for steedos",
"main": "lib/index.js",
"scripts": {
Expand All @@ -17,8 +17,8 @@
},
"license": "MIT",
"dependencies": {
"@steedos/filters": "2.7.9-beta.3",
"@steedos/filters": "2.7.9-beta.4",
"node-fetch": "^2.6.7"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
24 changes: 12 additions & 12 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@steedos/core",
"private": false,
"version": "2.7.9-beta.3",
"version": "2.7.9-beta.4",
"description": "",
"main": "lib/index.js",
"scripts": {
Expand All @@ -14,15 +14,15 @@
"author": "",
"license": "ISC",
"dependencies": {
"@steedos/auth": "2.7.9-beta.3",
"@steedos/filters": "2.7.9-beta.3",
"@steedos/i18n": "2.7.9-beta.3",
"@steedos/metadata-core": "2.7.9-beta.3",
"@steedos/migrate": "2.7.9-beta.3",
"@steedos/objectql": "2.7.9-beta.3",
"@steedos/odata-v4-mongodb": "2.7.9-beta.3",
"@steedos/process": "2.7.9-beta.3",
"@steedos/standard-objects": "2.7.9-beta.3",
"@steedos/auth": "2.7.9-beta.4",
"@steedos/filters": "2.7.9-beta.4",
"@steedos/i18n": "2.7.9-beta.4",
"@steedos/metadata-core": "2.7.9-beta.4",
"@steedos/migrate": "2.7.9-beta.4",
"@steedos/objectql": "2.7.9-beta.4",
"@steedos/odata-v4-mongodb": "2.7.9-beta.4",
"@steedos/process": "2.7.9-beta.4",
"@steedos/standard-objects": "2.7.9-beta.4",
"body-parser": "^1.18.1",
"bunyan-sfdx-no-dtrace": "^1.8.2",
"clone": "^2.1.2",
Expand All @@ -45,7 +45,7 @@
"devDependencies": {
"@salesforce/kit": "1.0.4",
"@salesforce/ts-types": "1.1.2",
"@steedos/meteor-bundle-runner": "2.7.9-beta.3",
"@steedos/meteor-bundle-runner": "2.7.9-beta.4",
"@types/express": "^4.16.1",
"@types/node": "^11.10.4",
"@types/underscore": "^1.8.13",
Expand All @@ -57,5 +57,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "7a32fe79d99c41ad8658f3e9a913814092869c60"
"gitHead": "3162f373294a238808d1b55cc876cdc2edcf5d19"
}
Loading

0 comments on commit 81bb3af

Please sign in to comment.