From c5c27820c998a618890c4103af6b99534161a73e Mon Sep 17 00:00:00 2001 From: Noah Zalev Date: Wed, 17 Nov 2021 17:24:43 -0500 Subject: [PATCH 1/2] Added awsrds config option --- db.js | 1 + meshcentral-config-schema.json | 1 + 2 files changed, 2 insertions(+) diff --git a/db.js b/db.js index 5ae1d6e5..2599b864 100644 --- a/db.js +++ b/db.js @@ -1976,6 +1976,7 @@ module.exports.CreateDB = function (parent, func) { // SSL options different on mariadb/mysql var sslOptions = ''; if (obj.databaseType == 4) { + if (props.awsrds) { cmd += ' --single-transaction'; } if (props.ssl) { sslOptions = ' --ssl'; if (props.ssl.cacertpath) sslOptions = ' --ssl-ca=' + props.ssl.cacertpath; diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index bd44e2d5..e5b9f8e7 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -22,6 +22,7 @@ "password": { "type": "string", "description": "MariaDB password" }, "connectionLimit": { "type": "number", "description": "MariaDB connection limit" }, "database": { "type": "string", "default": "meshcentral", "description": "Name of MariaDB database used" }, + "awsrds": { "type": "boolean", "default": false, "description": "Set true to resolve LOCK TABLE permissions on AWS RDS." }, "ssl": { "type": "object", "description": "SSL Options. Set to true (boolean) for default options.", From c3b9de37f916528444c756f6badfc65c419e5d06 Mon Sep 17 00:00:00 2001 From: Noah Zalev Date: Wed, 17 Nov 2021 19:12:18 -0500 Subject: [PATCH 2/2] Add MySQL AWS RDS support to mysqldump --- db.js | 3 ++- meshcentral-config-schema.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/db.js b/db.js index 2599b864..86e0b8e1 100644 --- a/db.js +++ b/db.js @@ -1973,10 +1973,11 @@ module.exports.CreateDB = function (parent, func) { if (props.host) { cmd += ' -h ' + props.host; } if (props.port) { cmd += ' -P ' + props.port; } + if (props.awsrds) { cmd += ' --single-transaction'; } + // SSL options different on mariadb/mysql var sslOptions = ''; if (obj.databaseType == 4) { - if (props.awsrds) { cmd += ' --single-transaction'; } if (props.ssl) { sslOptions = ' --ssl'; if (props.ssl.cacertpath) sslOptions = ' --ssl-ca=' + props.ssl.cacertpath; diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index e5b9f8e7..750754a2 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -44,6 +44,7 @@ "user": { "type": "string", "description": "MySQL username" }, "password": { "type": "string", "description": "MySQL password" }, "database": { "type": "string", "default": "meshcentral", "description": "Name of MySQL database used" }, + "awsrds": { "type": "boolean", "default": false, "description": "Set true to resolve LOCK TABLE permissions on AWS RDS." }, "ssl": { "type": "object", "description": "SSL Options. Set to true (boolean) for default options.",