1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved database error handling, new Let's Encrypt server console commands.

This commit is contained in:
Ylian Saint-Hilaire 2020-03-04 14:57:03 -08:00
parent 2741344268
commit 672517f27d
7 changed files with 137 additions and 94 deletions

View file

@ -21,8 +21,7 @@ limitations under the License.
*/
// Construct a WSMAN communication object
function CreateWsmanComm(/*host, port, user, pass, tls, extra*/)
{
function CreateWsmanComm(/*host, port, user, pass, tls, extra*/) {
var obj = {};
obj.PendingAjax = []; // List of pending AJAX calls. When one frees up, another will start.
obj.ActiveAjaxCount = 0; // Number of currently active AJAX calls
@ -31,15 +30,13 @@ function CreateWsmanComm(/*host, port, user, pass, tls, extra*/)
obj.digest = null;
obj.RequestCount = 0;
if (arguments.length == 1 && typeof(arguments[0] == 'object'))
{
if (arguments.length == 1 && typeof (arguments[0] == 'object')) {
obj.host = arguments[0].host;
obj.port = arguments[0].port;
obj.authToken = arguments[0].authToken;
obj.tls = arguments[0].tls;
}
else
{
else {
obj.host = arguments[0];
obj.port = arguments[1];
obj.user = arguments[2];
@ -75,14 +72,10 @@ function CreateWsmanComm(/*host, port, user, pass, tls, extra*/)
if (globalDebugFlags & 1) { console.log("SEND: " + postdata + "\r\n\r\n"); } // DEBUG
// We are in a DukTape environement
if (obj.digest == null)
{
if (obj.authToken)
{
if (obj.digest == null) {
if (obj.authToken) {
obj.digest = require('http-digest').create({ authToken: obj.authToken });
}
else
{
} else {
obj.digest = require('http-digest').create(obj.user, obj.pass);
}
obj.digest.http = require('http');