From fdd0a93bada06890c4c9e22c3b86007ec95449a2 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 23 Apr 2021 15:42:57 +0100 Subject: [PATCH 1/4] Deprecate use of httpRoot in settings and add warning (no change is actual behaviour yet - just warning) Should we remove option from settings ? or just label it ? --- packages/node_modules/@node-red/runtime/lib/index.js | 3 +++ .../@node-red/runtime/locales/en-US/runtime.json | 5 +++-- packages/node_modules/node-red/settings.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/index.js b/packages/node_modules/@node-red/runtime/lib/index.js index 30481740f..d10ec18ea 100644 --- a/packages/node_modules/@node-red/runtime/lib/index.js +++ b/packages/node_modules/@node-red/runtime/lib/index.js @@ -181,6 +181,9 @@ function start() { if (settings.settingsFile) { log.info(log._("runtime.paths.settings",{path:settings.settingsFile})); } + if (settings.httpRoot !== undefined) { + log.warn(log._("server.httproot-deprecated")); + } if (settings.httpStatic) { log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)})); } diff --git a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json index 1a29f32b4..c51b463ed 100644 --- a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json +++ b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json @@ -42,7 +42,7 @@ "uninstall-failed-long": "Uninstall of module __name__ failed:", "uninstalled": "Uninstalled module: __name__" }, - "deprecatedOption": "Use of __old__ is deprecated. Use __new__ instead", + "deprecatedOption": "Use of __old__ is DEPRECATED. Use __new__ instead", "unable-to-listen": "Unable to listen on __listenpath__", "port-in-use": "Error: port in use", "uncaught-exception": "Uncaught Exception:", @@ -50,7 +50,8 @@ "now-running": "Server now running at __listenpath__", "failed-to-start": "Failed to start server:", "headless-mode": "Running in headless mode", - "httpadminauth-deprecated": "use of httpAdminAuth is deprecated. Use adminAuth instead", + "httpadminauth-deprecated": "Use of httpAdminAuth is DEPRECATED. Use adminAuth instead", + "httproot-deprecated": "Use of httpRoot is DEPRECATED. Use httpNodeRoot and httpAdminRoot instead", "https": { "refresh-interval": "Refreshing https settings every __interval__ hours", "settings-refreshed": "Server https settings have been refreshed", diff --git a/packages/node_modules/node-red/settings.js b/packages/node_modules/node-red/settings.js index 331654ed8..f68d502c0 100644 --- a/packages/node_modules/node-red/settings.js +++ b/packages/node_modules/node-red/settings.js @@ -96,7 +96,7 @@ module.exports = { // disabled. //httpNodeRoot: '/red-nodes', - // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot', + // **DEPRECATED** The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot', // to apply the same root to both parts. //httpRoot: '/red', From 56fe2014e1ac3b213964475ddbd05902a10dd1d7 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 23 Apr 2021 16:36:15 +0100 Subject: [PATCH 2/4] Update packages/node_modules/@node-red/runtime/lib/index.js Co-authored-by: Nick O'Leary --- packages/node_modules/@node-red/runtime/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/runtime/lib/index.js b/packages/node_modules/@node-red/runtime/lib/index.js index d10ec18ea..d95076e86 100644 --- a/packages/node_modules/@node-red/runtime/lib/index.js +++ b/packages/node_modules/@node-red/runtime/lib/index.js @@ -182,7 +182,7 @@ function start() { log.info(log._("runtime.paths.settings",{path:settings.settingsFile})); } if (settings.httpRoot !== undefined) { - log.warn(log._("server.httproot-deprecated")); + log.warn(log._("server.deprecatedOption",{old:"httpRoot", new: "httpNodeRoot/httpAdminRoot")); } if (settings.httpStatic) { log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)})); From 37981679082f49ceac8bbdee95589e9057bbb6bd Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 23 Apr 2021 16:36:22 +0100 Subject: [PATCH 3/4] Update packages/node_modules/@node-red/runtime/locales/en-US/runtime.json Co-authored-by: Nick O'Leary --- .../node_modules/@node-red/runtime/locales/en-US/runtime.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json index c51b463ed..0f87ad1fa 100644 --- a/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json +++ b/packages/node_modules/@node-red/runtime/locales/en-US/runtime.json @@ -51,7 +51,6 @@ "failed-to-start": "Failed to start server:", "headless-mode": "Running in headless mode", "httpadminauth-deprecated": "Use of httpAdminAuth is DEPRECATED. Use adminAuth instead", - "httproot-deprecated": "Use of httpRoot is DEPRECATED. Use httpNodeRoot and httpAdminRoot instead", "https": { "refresh-interval": "Refreshing https settings every __interval__ hours", "settings-refreshed": "Server https settings have been refreshed", From b053e02174a8993c4c82de35ca2c98095de9e89c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 23 Apr 2021 16:38:45 +0100 Subject: [PATCH 4/4] remove httpRoot from setting.js entirely --- packages/node_modules/node-red/settings.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/node_modules/node-red/settings.js b/packages/node_modules/node-red/settings.js index f68d502c0..a8f445c5b 100644 --- a/packages/node_modules/node-red/settings.js +++ b/packages/node_modules/node-red/settings.js @@ -96,10 +96,6 @@ module.exports = { // disabled. //httpNodeRoot: '/red-nodes', - // **DEPRECATED** The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot', - // to apply the same root to both parts. - //httpRoot: '/red', - // When httpAdminRoot is used to move the UI to a different root path, the // following property can be used to identify a directory of static content // that should be served at http://localhost:1880/.