From 4e39b4c740bc706ba0cea6a93f4d8c186ab880ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E5=BB=BA=E5=9B=BD?= <9340100@qq.com> Date: Mon, 6 Jan 2025 08:12:18 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20STEEDOS=5FNODERED=5FENABLED=3Dtrue=20?= =?UTF-8?q?=E6=97=B6=E6=89=8D=E5=90=AF=E5=8A=A8=E5=86=85=E7=BD=AE=20node-r?= =?UTF-8?q?ed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/enterprise/docker-compose.yml | 1 + deploy/enterprise/fs/opt/steedos/entrypoint.sh | 4 ++++ .../fs/opt/steedos/templates/supervisord/nodered.conf | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deploy/enterprise/docker-compose.yml b/deploy/enterprise/docker-compose.yml index fc4f7a0903..f0f3b303b6 100644 --- a/deploy/enterprise/docker-compose.yml +++ b/deploy/enterprise/docker-compose.yml @@ -38,6 +38,7 @@ services: - B6_PLUGIN_PACKAGES=@builder6/node-red,lodash - B6_PLUGIN_SERVICES=@builder6/node-red - B6_PLUGIN_MODULES=@builder6/node-red + - STEEDOS_NODERED_ENABLED=true # - B6_OIDC_ENABLED=false # - B6_OIDC_ISSUER=https://id.steedos.cn/realms/master # - B6_OIDC_CLIENT_ID=steedos-oidc-public diff --git a/deploy/enterprise/fs/opt/steedos/entrypoint.sh b/deploy/enterprise/fs/opt/steedos/entrypoint.sh index 0536bb7d35..6954ecdee7 100755 --- a/deploy/enterprise/fs/opt/steedos/entrypoint.sh +++ b/deploy/enterprise/fs/opt/steedos/entrypoint.sh @@ -22,6 +22,10 @@ init_env_file() { export STEEDOS_UNPKG_ENABLED=false fi + if [ -z "${STEEDOS_NODERED_ENABLED}" ]; then + export STEEDOS_NODERED_ENABLED=false + fi + # Build an env file with current env variables. We single-quote the values, as well as escaping any single-quote characters. printenv | grep -E '^STEEDOS_|^B6_|^MONGO_|ROOT_URL|CACHER|TRANSPORTER|PORT|NODE_ENV' | sed "s/'/'\\\''/g; s/=/='/; s/$/'/" > "$CONF_PATH/pre-define.env" diff --git a/deploy/enterprise/fs/opt/steedos/templates/supervisord/nodered.conf b/deploy/enterprise/fs/opt/steedos/templates/supervisord/nodered.conf index d0b78273b8..f33e16c3c1 100644 --- a/deploy/enterprise/fs/opt/steedos/templates/supervisord/nodered.conf +++ b/deploy/enterprise/fs/opt/steedos/templates/supervisord/nodered.conf @@ -2,8 +2,8 @@ directory=/opt/steedos/nodered/ command=/opt/steedos/run-with-env.sh ./node_modules/.bin/node-red --settings settings.js priority=15 -autostart=true -autorestart=true +autostart=%(ENV_STEEDOS_NODERED_ENABLED)s +autorestart=%(ENV_STEEDOS_NODERED_ENABLED)s startsecs=0 startretries=3 stdout_logfile=/steedos-storage/logs/%(program_name)s/%(program_name)s-%(ENV_HOSTNAME)s.log