Fixed agent invite link when UserAllowedIP is used.

Ylian Saint-Hilaire committed Oct 11, 2019 at 15:39 UTC b6b125f50625c372b3ab1763b890296abbe24749
3 files changed +2 -12
meshuser.js
+1 -1
@@ -1681,7 +1681,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1681 var event = { etype: 'mesh', userid: user._id, username: user.name, meshid: meshid, name: command.meshname, mtype: command.meshtype, desc: command.desc, action: 'createmesh', links: links, msg: 'Device group created: ' + command.meshname, domain: domain.id };
1682 parent.parent.DispatchEvent(['*', meshid, user._id], obj, event); // Even if DB change stream is active, this event must be acted upon.
1683
1684 - try { ws.send(JSON.stringify({ action: 'createmesh', responseid: command.responseid, result: 'ok', meshid: meshid, links: mesh.links })); } catch (ex) { }
1684 + try { ws.send(JSON.stringify({ action: 'createmesh', responseid: command.responseid, result: 'ok', meshid: meshid, links: links })); } catch (ex) { }
1685 });
1686 break;
1687 }
readme.md
-10
@@ -110,13 +110,6 @@ As an alternative to using command line arguments, you can create a `./node-modu
110 "title": "Customer2",
111 "title2": "Other String"
112 }
113 - },
114 - "peers": {
115 - "serverId" : "Server1",
116 - "servers": {
117 - "Server1": { "url": "wss://192.168.1.100:443/" },
118 - "Server2": { "url": "wss://192.168.1.101:443/" }
119 - }
113 }
114 }
115 ```
@@ -133,8 +126,6 @@ For the configuration above, the root domain and two other domains will be acces
126
127 When you setup many domains, the server considers each domain separately. Each domain has separate user accounts, administrators, etc. Within each domain, you can put a `title` and `title2` as strings that will show up at the top of the web site. `userQuota` indicates the default maximum amount of data a user can have in it's "My Files" folder. `meshQuota` is the maximum total size of files in each mesh folder. `newAccounts` indicates if new accounts can be created from the login page, `0` if not allowed, `1` if allowed. Note that if a web site has no accounts, the new account option will be available until an account is created and the first account will be the site administrator.
128
136 -MeshCentral also supports server peering, add the `peers` section with a list of all peers. If you want to do server peering, make sure all servers are configured to use the same database. Also, the `serverId` value is optional. If it's not specified, the computer hostname is used instead.
137 -
129 Other Notes
130 -----------
131
@@ -152,7 +143,6 @@ How to install MeshCentral2 in a few minutes.
143 Demonstration of MeshCentral2 usages and more tips & tricks.
144 [![MeshCentral2 - Usages](https://img.youtube.com/vi/1E3NqGJzYds/mqdefault.jpg)](https://www.youtube.com/watch?v=1E3NqGJzYds)
145
155 -
146 How to setup Intel® AMT client initiated remote access (CIRA) to connect to MeshCentral2.
147 [![MeshCentral2 - Intel AMT CIRA](https://img.youtube.com/vi/rA2KHa2jkO0/mqdefault.jpg)](https://www.youtube.com/watch?v=rA2KHa2jkO0)
148
webserver.js
+1 -1
@@ -1161,7 +1161,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1161
1162 // Called to process an agent invite request
1163 function handleAgentInviteRequest(req, res) {
1164 - const domain = checkUserIpAddress(req, res);
1164 + const domain = getDomain(req);
1165 if ((domain == null) || ((req.query.m == null) && (req.query.c == null))) {
1166 parent.debug('web', 'handleAgentInviteRequest: failed checks.');
1167 res.sendStatus(404);