From ea5260e6e302f0f7fe76bfa2819b0e1ebd3d0e32 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 19 Feb 2026 11:26:29 -0600 Subject: [PATCH] Website: Update how scripts and mdm commands are stored in the website's configuration. (#39997) Changes: - Updated the version of Sails.js used by the website - Changed how scripts and MDM commands are stored in the website's JSON configuration. --- website/package.json | 2 +- website/scripts/build-static-content.js | 7 ++++--- website/views/pages/app-details.ejs | 2 +- website/views/pages/command-details.ejs | 2 +- website/views/pages/script-details.ejs | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/website/package.json b/website/package.json index a7bdc13701..bb51906f82 100644 --- a/website/package.json +++ b/website/package.json @@ -14,7 +14,7 @@ "jsonwebtoken": "9.0.2", "jsrsasign": "11.1.0", "moment": "2.29.4", - "sails": "^1.5.14", + "sails": "^1.5.17", "sails-hook-apianalytics": "^2.0.6", "sails-hook-organics": "^3.0.0", "sails-hook-orm": "^4.0.3", diff --git a/website/scripts/build-static-content.js b/website/scripts/build-static-content.js index b1c69c7954..1017ec681a 100644 --- a/website/scripts/build-static-content.js +++ b/website/scripts/build-static-content.js @@ -1482,7 +1482,7 @@ module.exports = { // Add the uninstall script and the latest version to this app's configuration. // Note: we esacape the uninstall script to prevent issues when storing these values in the website's JSON configuration. - appInformation.uninstallScript = _.escape(scriptToUninstallThisApp); + appInformation.uninstallScript = scriptToUninstallThisApp; appInformation.version = latestVersionOfThisApp.version.split(',')[0]; appLibrary.push(appInformation); }); @@ -1523,7 +1523,7 @@ module.exports = { } // Format the script so it be safely stored as a string in the website's JSON configuration. - script.script = _.escape(script.script); + script.script = script.script; // Create a url slug for this script script.slug = _.kebabCase(script.platform+' '+script.name);// ex: macos-collect-fleetd-logs @@ -1584,8 +1584,9 @@ module.exports = { command.lineNumberInYaml = lineNumberForEdittingThisCommand; // Set the line number for edits. - command.command = _.escape(command.command); + // Note: The command descriptions are escaped because they include references to XML tags (e.g., ) that can cause issues with Vue. command.description = _.escape(command.description); + command.command = command.command; // Create a url slug for this script command.slug = _.kebabCase(command.platform+' '+command.name); diff --git a/website/views/pages/app-details.ejs b/website/views/pages/app-details.ejs index 9686db5775..4e927dc5b5 100644 --- a/website/views/pages/app-details.ejs +++ b/website/views/pages/app-details.ejs @@ -40,7 +40,7 @@ <% }%>
-
<%= _.unescape(thisApp.uninstallScript) %>
+
<%= thisApp.uninstallScript %>
diff --git a/website/views/pages/command-details.ejs b/website/views/pages/command-details.ejs index 42ac71965a..378a61b952 100644 --- a/website/views/pages/command-details.ejs +++ b/website/views/pages/command-details.ejs @@ -28,7 +28,7 @@
-
<%= _.unescape(thisCommand.command) %>
+
<%= thisCommand.command %>
diff --git a/website/views/pages/script-details.ejs b/website/views/pages/script-details.ejs index d9bca97245..5847e7a853 100644 --- a/website/views/pages/script-details.ejs +++ b/website/views/pages/script-details.ejs @@ -23,9 +23,9 @@ <%if(thisScript.platform === 'windows'){%> -
<%= _.unescape(thisScript.script) %>
+
<%= thisScript.script %>
<%} else {%> -
<%= _.unescape(thisScript.script) %>
+
<%= thisScript.script %>
<%}%>