Added a bunch of HTTP to HTTPS redirections.

This commit is contained in:
Ylian Saint-Hilaire 2019-08-09 15:38:59 -07:00
parent bb4bc55c48
commit d2bb4e9840
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.3.9-o",
"version": "0.3.9-p",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -94,8 +94,12 @@ module.exports.CreateRedirServer = function (parent, db, args, func) {
for (var i in parent.config.domains) {
if (parent.config.domains[i].dns != null) { continue; }
var url = parent.config.domains[i].url;
obj.app.get(url, performRedirection);
obj.app.get(url, performRedirection); // Root redirection
obj.app.use(url + "clickonce", obj.express.static(obj.parent.path.join(__dirname, "public/clickonce"))); // Indicates the clickonce folder is public
// Setup all of the redirections to HTTPS
const redirections = ['terms', 'logout', 'MeshServerRootCert.cer', 'mescript.ashx', 'checkmail', 'agentinvite', 'messenger', 'meshosxagent', 'devicepowerevents.ashx', 'downloadfile.ashx', 'userfiles/*', 'webrelay.ashx', 'health.ashx', 'logo.png', 'welcome.jpg'];
for (i in redirections) { obj.app.get(url + redirections[i], performRedirection); }
}
// Find a free port starting with the specified one and going up.