mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 19:11:51 +00:00
fix mysql autoback zippassword
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
parent
aae551dab9
commit
c1e3354c91
1 changed files with 10 additions and 6 deletions
4
db.js
4
db.js
|
@ -3426,6 +3426,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||||
var archiver = require('archiver');
|
var archiver = require('archiver');
|
||||||
var output = parent.fs.createWriteStream(newAutoBackupPath + '.zip');
|
var output = parent.fs.createWriteStream(newAutoBackupPath + '.zip');
|
||||||
var archive = null;
|
var archive = null;
|
||||||
|
if (parent.config.settings.autobackup && (typeof parent.config.settings.autobackup.zippassword == 'string')) {
|
||||||
try {
|
try {
|
||||||
archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));
|
archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));
|
||||||
archive = archiver.create('zip-encrypted', { zlib: { level: 9 }, encryptionMethod: 'aes256', password: parent.config.settings.autobackup.zippassword });
|
archive = archiver.create('zip-encrypted', { zlib: { level: 9 }, encryptionMethod: 'aes256', password: parent.config.settings.autobackup.zippassword });
|
||||||
|
@ -3434,6 +3435,9 @@ module.exports.CreateDB = function (parent, func) {
|
||||||
archive = archiver('zip', { zlib: { level: 9 } });
|
archive = archiver('zip', { zlib: { level: 9 } });
|
||||||
if (func) { func('Creating encrypted ZIP failed, so falling back to normal ZIP'); }
|
if (func) { func('Creating encrypted ZIP failed, so falling back to normal ZIP'); }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
archive = archiver('zip', { zlib: { level: 9 } });
|
||||||
|
}
|
||||||
output.on('close', function () {
|
output.on('close', function () {
|
||||||
obj.performingBackup = false;
|
obj.performingBackup = false;
|
||||||
if (func) { if (sqlDumpSuccess) { func('Auto-backup completed.'); } else { func('Auto-backup completed without MySQL/MariaDB database: ' + error); } }
|
if (func) { if (sqlDumpSuccess) { func('Auto-backup completed.'); } else { func('Auto-backup completed without MySQL/MariaDB database: ' + error); } }
|
||||||
|
|
Loading…
Reference in a new issue