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
16
db.js
16
db.js
@ -3426,13 +3426,17 @@ 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;
|
||||||
try {
|
if (parent.config.settings.autobackup && (typeof parent.config.settings.autobackup.zippassword == 'string')) {
|
||||||
archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));
|
try {
|
||||||
archive = archiver.create('zip-encrypted', { zlib: { level: 9 }, encryptionMethod: 'aes256', password: parent.config.settings.autobackup.zippassword });
|
archiver.registerFormat('zip-encrypted', require('archiver-zip-encrypted'));
|
||||||
if (func) { func('Creating encrypted ZIP'); }
|
archive = archiver.create('zip-encrypted', { zlib: { level: 9 }, encryptionMethod: 'aes256', password: parent.config.settings.autobackup.zippassword });
|
||||||
} catch (ex) { // registering encryption failed, so create without encryption
|
if (func) { func('Creating encrypted ZIP'); }
|
||||||
|
} catch (ex) { // registering encryption failed, so create without encryption
|
||||||
|
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 } });
|
archive = archiver('zip', { zlib: { level: 9 } });
|
||||||
if (func) { func('Creating encrypted ZIP failed, so falling back to normal ZIP'); }
|
|
||||||
}
|
}
|
||||||
output.on('close', function () {
|
output.on('close', function () {
|
||||||
obj.performingBackup = false;
|
obj.performingBackup = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user