mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-27 06:33:15 -05:00
fix mysql autoback zippassword
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
This commit is contained in:
parent
aae551dab9
commit
c1e3354c91
4
db.js
4
db.js
@ -3426,6 +3426,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
var archiver = require('archiver');
|
||||
var output = parent.fs.createWriteStream(newAutoBackupPath + '.zip');
|
||||
var archive = null;
|
||||
if (parent.config.settings.autobackup && (typeof parent.config.settings.autobackup.zippassword == 'string')) {
|
||||
try {
|
||||
archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));
|
||||
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 } });
|
||||
if (func) { func('Creating encrypted ZIP failed, so falling back to normal ZIP'); }
|
||||
}
|
||||
} else {
|
||||
archive = archiver('zip', { zlib: { level: 9 } });
|
||||
}
|
||||
output.on('close', function () {
|
||||
obj.performingBackup = false;
|
||||
if (func) { if (sqlDumpSuccess) { func('Auto-backup completed.'); } else { func('Auto-backup completed without MySQL/MariaDB database: ' + error); } }
|
||||
|
Loading…
x
Reference in New Issue
Block a user