mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added .well-known support.
This commit is contained in:
parent
d1aeaaf02d
commit
2329023259
2 changed files with 19 additions and 9 deletions
|
@ -94,9 +94,9 @@ 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.post(url + "amtevents.ashx", obj.parent.webserver.handleAmtEventRequest);
|
||||
obj.app.get(url + "meshsettings", obj.parent.webserver.handleMeshSettingsRequest);
|
||||
obj.app.get(url + "meshagents", obj.parent.webserver.handleMeshAgentRequest);
|
||||
obj.app.post(url + 'amtevents.ashx', obj.parent.webserver.handleAmtEventRequest);
|
||||
obj.app.get(url + 'meshsettings', obj.parent.webserver.handleMeshSettingsRequest);
|
||||
obj.app.get(url + 'meshagents', obj.parent.webserver.handleMeshAgentRequest);
|
||||
|
||||
// Server redirects
|
||||
if (parent.config.domains[i].redirects) {
|
||||
|
@ -115,6 +115,10 @@ module.exports.CreateRedirServer = function (parent, db, args, func) {
|
|||
obj.app.get(url, performRedirection); // Root redirection
|
||||
obj.app.get(url + 'player.htm', performRedirection); // Player redirection
|
||||
|
||||
// Setup any .well-known folders
|
||||
var p = obj.parent.path.join(obj.parent.datapath, '.well-known' + ((parent.config.domains[i].id == '') ? '' : ('-' + parent.config.domains[i].id)));
|
||||
if (obj.parent.fs.existsSync(p)) { obj.app.use(url + '.well-known', obj.express.static(p)); }
|
||||
|
||||
// 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); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue