mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add env vars to enable safe mode and projects (#2301)
* Add NODE_RED_ENABLE_SAFE_MODE and NODE_RED_ENABLE_PROJECTS * Allow env-vars to be set to false to disable features
This commit is contained in:
parent
88609a8829
commit
c7bbe2f1fe
7
packages/node_modules/node-red/red.js
vendored
7
packages/node_modules/node-red/red.js
vendored
@ -133,9 +133,14 @@ try {
|
||||
if (parsedArgs.verbose) {
|
||||
settings.verbose = true;
|
||||
}
|
||||
if (parsedArgs.safe) {
|
||||
if (parsedArgs.safe || (process.env.NODE_RED_ENABLE_SAFE_MODE && !/^false$/i.test(process.env.NODE_RED_ENABLE_SAFE_MODE) )) {
|
||||
settings.safeMode = true;
|
||||
}
|
||||
if (process.env.NODE_RED_ENABLE_PROJECTS) {
|
||||
settings.editorTheme = settings.editorTheme || {};
|
||||
settings.editorTheme.projects = settings.editorTheme.projects || {};
|
||||
settings.editorTheme.projects.enabled = !/^false$/i.test(process.env.NODE_RED_ENABLE_PROJECTS);
|
||||
}
|
||||
|
||||
if (settings.https) {
|
||||
server = https.createServer(settings.https,function(req,res) {app(req,res);});
|
||||
|
Loading…
Reference in New Issue
Block a user