Skip to content

Commit

Permalink
Fixed multi-tenancy DNS support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylianst committed Jan 4, 2018
1 parent eb363f0 commit d455e35
Show file tree
Hide file tree
Showing 24 changed files with 167 additions and 110 deletions.
Binary file modified agents/MeshService.exe
Binary file not shown.
Binary file modified agents/MeshService64.exe
Binary file not shown.
186 changes: 96 additions & 90 deletions agents/meshcore.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion agents/tinycore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Intel Corporation
Copyright 2018 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 3 additions & 1 deletion amtevents.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral Intel AMT Event Parser
* @description MeshCentral Intel(R) AMT Event Parser
* @author Ylian Saint-Hilaire & Bryan Roe
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion amtscanner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral Intel AMT Local Scanner
* @description MeshCentral Intel(R) AMT Local Scanner
* @author Ylian Saint-Hilaire & Joko Sastriawan
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
2 changes: 2 additions & 0 deletions amtscript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @fileoverview Script Compiler / Decompiler / Runner
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.1.0e
*/

Expand Down
3 changes: 3 additions & 0 deletions certoperations.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/**
* @description Certificate generator
* @author Joko Sastriawan / Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

module.exports.CertificateOperations = function () {
var obj = {};

Expand Down
9 changes: 8 additions & 1 deletion common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

/**
* @description MeshCentral Common Library
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

var crypto = require('crypto');

// Binary encoding and decoding functions
Expand Down
4 changes: 3 additions & 1 deletion db.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral database
* @description MeshCentral database module
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.2
*/

Expand Down
4 changes: 3 additions & 1 deletion interceptor.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Intel AMT Interceptor
* @description MeshCentral Intel(R) AMT Interceptor
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.3
*/

Expand Down
4 changes: 3 additions & 1 deletion meshagent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral MeshAgent
* @description MeshCentral MeshAgent communication module
* @author Ylian Saint-Hilaire & Bryan Roe
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion meshcentral.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral
* @description MeshCentral main module
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
13 changes: 11 additions & 2 deletions meshmail.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral MeshMail
* @description MeshCentral e-mail server communication modules
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down Expand Up @@ -32,7 +34,14 @@ module.exports.CreateMeshMain = function (parent) {

// Perform all e-mail substitution
function mailReplacements(text, domain, username, email, cookie) {
var url = 'http' + ((obj.parent.args.notls == null) ? 's' : '') + '://' + parent.certificates.CommonName + ':' + obj.parent.args.port + domain.url;
var url;
if (domain.dns == null) {
// Default domain or subdomain of the default.
url = 'http' + ((obj.parent.args.notls == null) ? 's' : '') + '://' + parent.certificates.CommonName + ':' + obj.parent.args.port + domain.url;
} else {
// Domain with a DNS name.
url = 'http' + ((obj.parent.args.notls == null) ? 's' : '') + '://' + domain.dns + ':' + obj.parent.args.port + domain.url;
}
if (cookie != null) { text = text.split('[[[CALLBACKURL]]]').join(url + 'checkmail?c=' + cookie) }
return text.split('[[[USERNAME]]]').join(username).split('[[[SERVERURL]]]').join(url).split('[[[SERVERNAME]]]').join(domain.title);
}
Expand Down
4 changes: 3 additions & 1 deletion meshrelay.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral MeshRelay
* @description MeshCentral connection relay module
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion meshscanner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral Mesh Agent Local Scanner
* @description MeshCentral Mesh Agent Local Scanner
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion meshuser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral MeshAgent
* @description MeshCentral MeshAgent
* @author Ylian Saint-Hilaire & Bryan Roe
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion mpsserver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral Intel AMT MPS server
* @description MeshCentral Intel(R) AMT MPS server
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion multiserver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral Multi-Server Support
* @description MeshCentral Multi-Server Support
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.1.1-r",
"version": "0.1.1-u",
"keywords": [
"Remote Management",
"Intel AMT",
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ MeshCentral
===========

For more information, [visit MeshCommander.com/MeshCentral2](http://www.meshcommander.com/meshcentral2).

Download the [full PDF user's guide](http://info.meshcentral.com/downloads/meshcentral2/MeshCentral2UserGuide.pdf) with more information on installing, configuring and running MeshCentral2.

This is a full computer management web site. With MeshCentral, you can run your own web server and it to remotely manage and control computers on a local network or anywhere on the internet. Once you get the server started, will create a mesh (a group of computers) and then download and install a mesh agent on each computer you want to manage. A minute later, the new computer will show up on the web site and you can take control of it, etc. MeshCentral includes full web-based remote desktop, terminal and file management capability.
Expand Down
2 changes: 2 additions & 0 deletions redirserver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral web server
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
4 changes: 3 additions & 1 deletion swarmserver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral1 legacy swarm server, used to update agents and get them on MeshCentral2
* @description MeshCentral v1 legacy Swarm Server, used to update agents and get them on MeshCentral2
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down
9 changes: 6 additions & 3 deletions webserver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/**
* @description Meshcentral web server
* @description MeshCentral web server
* @author Ylian Saint-Hilaire
* @copyright Intel Corporation 2018
* @license Apache-2.0
* @version v0.0.1
*/

Expand Down Expand Up @@ -126,8 +128,8 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
{
var dnscount = 0;
obj.tlsSniCredentials = {};
for (var i in obj.certificates.dns) { if (obj.parent.config.domains[i].dns != null) { obj.dnsDomains[obj.parent.config.domains[i].dns.toLowerCase()] = obj.parent.config.domains[i]; obj.tlsSniCredentials[obj.parent.config.domains[i].dns] = obj.crypto.createCredentials(obj.certificates.dns[i]).context; dnscount++; } }
if (dnscount > 0) { obj.tlsSniCredentials[''] = obj.crypto.createCredentials({ cert: obj.certificates.web.cert, key: obj.certificates.web.key, ca: obj.certificates.ca }).context; } else { obj.tlsSniCredentials = null; }
for (var i in obj.certificates.dns) { if (obj.parent.config.domains[i].dns != null) { obj.dnsDomains[obj.parent.config.domains[i].dns.toLowerCase()] = obj.parent.config.domains[i]; obj.tlsSniCredentials[obj.parent.config.domains[i].dns] = obj.tls.createSecureContext(obj.certificates.dns[i]).context; dnscount++; } }
if (dnscount > 0) { obj.tlsSniCredentials[''] = obj.tls.createSecureContext({ cert: obj.certificates.web.cert, key: obj.certificates.web.key, ca: obj.certificates.ca }).context; } else { obj.tlsSniCredentials = null; }
}
function TlsSniCallback(name, cb) { var c = obj.tlsSniCredentials[name]; if (c != null) { cb(null, c); } else { cb(null, obj.tlsSniCredentials['']); } }

Expand Down Expand Up @@ -1535,6 +1537,7 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
obj.app.post('/restoreserver.ashx', handleRestoreRequest);
if (parent.multiServer != null) { obj.app.ws('/meshserver.ashx', function (ws, req) { parent.multiServer.CreatePeerInServer(parent.multiServer, ws, req); } ); }
for (var i in parent.config.domains) {
if (parent.config.domains[i].dns != null) { continue; } // This is a subdomain with a DNS name, no added HTTP bindings needed.
var url = parent.config.domains[i].url;
obj.app.get(url, handleRootRequest);
obj.app.get(url + 'terms', handleTermsRequest);
Expand Down

0 comments on commit d455e35

Please sign in to comment.