mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-31 17:53:40 -04:00
More multiplexor work, letsencrypt will now default to cert if names not set.
This commit is contained in:
parent
585c89ebd2
commit
68e140a38b
@ -107,6 +107,7 @@
|
|||||||
<Compile Include="mcrec.js" />
|
<Compile Include="mcrec.js" />
|
||||||
<Compile Include="meshaccelerator.js" />
|
<Compile Include="meshaccelerator.js" />
|
||||||
<Compile Include="meshctrl.js" />
|
<Compile Include="meshctrl.js" />
|
||||||
|
<Compile Include="meshdesktopmultiplex.js" />
|
||||||
<Compile Include="meshmail.js" />
|
<Compile Include="meshmail.js" />
|
||||||
<Compile Include="meshsms.js" />
|
<Compile Include="meshsms.js" />
|
||||||
<Compile Include="meshscanner.js" />
|
<Compile Include="meshscanner.js" />
|
||||||
|
@ -1190,6 +1190,7 @@ function CreateMeshCentralServer(config, args) {
|
|||||||
} else {
|
} else {
|
||||||
// Check Let's Encrypt settings
|
// Check Let's Encrypt settings
|
||||||
var leok = true;
|
var leok = true;
|
||||||
|
if ((typeof obj.config.letsencrypt.names != 'string') && (typeof obj.config.settings.cert == 'string')) { obj.config.letsencrypt.names = obj.config.settings.cert; }
|
||||||
if (typeof obj.config.letsencrypt.email != 'string') { leok = false; addServerWarning("Missing Let's Encrypt email address."); }
|
if (typeof obj.config.letsencrypt.email != 'string') { leok = false; addServerWarning("Missing Let's Encrypt email address."); }
|
||||||
else if (typeof obj.config.letsencrypt.names != 'string') { leok = false; addServerWarning("Invalid Let's Encrypt host names."); }
|
else if (typeof obj.config.letsencrypt.names != 'string') { leok = false; addServerWarning("Invalid Let's Encrypt host names."); }
|
||||||
else if (obj.config.letsencrypt.names.indexOf('*') >= 0) { leok = false; addServerWarning("Invalid Let's Encrypt names, can't contain a *."); }
|
else if (obj.config.letsencrypt.names.indexOf('*') >= 0) { leok = false; addServerWarning("Invalid Let's Encrypt names, can't contain a *."); }
|
||||||
|
@ -26,6 +26,8 @@ function CreateDesktopDecoder() {
|
|||||||
obj.images = {};
|
obj.images = {};
|
||||||
obj.lastScreenSizeCmd = null;
|
obj.lastScreenSizeCmd = null;
|
||||||
obj.lastScreenSizeCounter = 0;
|
obj.lastScreenSizeCounter = 0;
|
||||||
|
obj.firstData = null;
|
||||||
|
obj.lastData = null;
|
||||||
|
|
||||||
obj.processAgentData = function (data) {
|
obj.processAgentData = function (data) {
|
||||||
if ((typeof data != 'object') || (data.length < 4)) return;
|
if ((typeof data != 'object') || (data.length < 4)) return;
|
||||||
@ -37,7 +39,7 @@ function CreateDesktopDecoder() {
|
|||||||
command = data.readUInt16BE(8);
|
command = data.readUInt16BE(8);
|
||||||
cmdsize = data.readUInt32BE(4);
|
cmdsize = data.readUInt32BE(4);
|
||||||
if (data.length == (cmdsize + 8)) {
|
if (data.length == (cmdsize + 8)) {
|
||||||
data = data.slice(8, block.data.length);
|
data = data.slice(8, data.length);
|
||||||
} else {
|
} else {
|
||||||
console.log('TODO-PARTIAL-JUMBO', command, cmdsize, data.length);
|
console.log('TODO-PARTIAL-JUMBO', command, cmdsize, data.length);
|
||||||
return; // TODO
|
return; // TODO
|
||||||
@ -47,30 +49,48 @@ function CreateDesktopDecoder() {
|
|||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 3: // Tile, check dimentions and store
|
case 3: // Tile, check dimentions and store
|
||||||
var x = data.readUInt16BE(4);
|
var x = data.readUInt16BE(4), y = data.readUInt16BE(6);
|
||||||
var y = data.readUInt16BE(6);
|
|
||||||
var dimensions = require('image-size')(data.slice(8));
|
var dimensions = require('image-size')(data.slice(8));
|
||||||
|
var sx = (x / 16), sy = (y / 16), sw = (dimensions.width / 16), sh = (dimensions.height / 16);
|
||||||
obj.counter++;
|
obj.counter++;
|
||||||
console.log("Tile", x, y, dimensions.width, dimensions.height);
|
//console.log("Tile", x, y, dimensions.width, dimensions.height);
|
||||||
|
|
||||||
|
// Keep a reference to this image & how many tiles it covers
|
||||||
|
obj.images[obj.counter] = { next: null, prev: obj.lastData, data: data };
|
||||||
|
obj.images[obj.lastData].next = obj.counter;
|
||||||
|
obj.lastData = obj.counter;
|
||||||
|
obj.imagesCounters[obj.counter] = (sw * sh);
|
||||||
|
obj.imagesCount++;
|
||||||
|
if (obj.imagesCount == 2000000000) { obj.imagesCount = 1; } // Loop the counter if needed
|
||||||
|
|
||||||
// Update the screen with the correct pointers.
|
// Update the screen with the correct pointers.
|
||||||
var sx = (x / 16), sy = (y / 16), sw = (dimensions.width / 16), sh = (dimensions.height / 16);
|
|
||||||
for (var i = 0; i < sw; i++) {
|
for (var i = 0; i < sw; i++) {
|
||||||
for (var j = 0; j < sh; j++) {
|
for (var j = 0; j < sh; j++) {
|
||||||
var k = ((obj.swidth * (j + sy)) + (i + sx)), oi = obj.screen[k];
|
var k = ((obj.swidth * (j + sy)) + (i + sx)), oi = obj.screen[k];
|
||||||
if (--obj.imagesCounters[oi] == 0) { obj.imagesCount--; delete obj.images[oi]; delete obj.imagesCounters[oi]; }
|
if ((oi != null) && (--obj.imagesCounters[oi] == 0)) {
|
||||||
|
// Remove data from the link list
|
||||||
|
obj.imagesCount--;
|
||||||
|
var d = obj.images[oi];
|
||||||
|
obj.images[d.prev].next = d.next;
|
||||||
|
obj.images[d.next].prev = d.prev;
|
||||||
|
delete obj.images[oi];
|
||||||
|
delete obj.imagesCounters[oi];
|
||||||
|
|
||||||
|
// If any viewers are currently on image "oi" must be moved to "d.next"
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
obj.screen[k] = obj.counter;
|
obj.screen[k] = obj.counter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep a reference to this image & how many tiles it covers
|
// Debug, display the link list
|
||||||
obj.images[obj.counter] = data;
|
//var xx = '', xptr = obj.firstData;
|
||||||
obj.imagesCounters[obj.counter] = (sw * sh);
|
//while (xptr != null) { xx += '>' + xptr; xptr = obj.images[xptr].next; }
|
||||||
obj.imagesCount++;
|
//console.log('list', xx);
|
||||||
console.log('images', obj.imagesCount);
|
//console.log('images', obj.imagesCount);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 7:// Screen Size, clear the screen state and compute the tile count
|
case 7: // Screen Size, clear the screen state and compute the tile count
|
||||||
obj.counter++;
|
obj.counter++;
|
||||||
obj.lastScreenSizeCmd = data;
|
obj.lastScreenSizeCmd = data;
|
||||||
obj.lastScreenSizeCounter = obj.counter;
|
obj.lastScreenSizeCounter = obj.counter;
|
||||||
@ -86,8 +106,18 @@ function CreateDesktopDecoder() {
|
|||||||
obj.imagesCount = 0;
|
obj.imagesCount = 0;
|
||||||
obj.imagesCounters = {};
|
obj.imagesCounters = {};
|
||||||
obj.images = {};
|
obj.images = {};
|
||||||
|
obj.images[obj.counter] = { next: null, prev: null, data: data};
|
||||||
|
obj.firstData = obj.counter;
|
||||||
|
obj.lastData = obj.counter;
|
||||||
|
|
||||||
console.log("ScreenSize", obj.width, obj.height, obj.swidth, obj.sheight, obj.swidth * obj.sheight);
|
// Add viewers must be set to start at "obj.counter"
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
//console.log("ScreenSize", obj.width, obj.height, obj.swidth, obj.sheight, obj.swidth * obj.sheight);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 11, 14, 88
|
||||||
|
console.log('Un-handled command: ' + command);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user