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

When some files are re-generated, the old copy is now kept as -old.

This commit is contained in:
Ylian Saint-Hilaire 2022-08-26 14:19:28 -07:00
parent b0733a85de
commit 15ee1feca5
3 changed files with 21 additions and 0 deletions

View file

@ -1785,6 +1785,7 @@ function CreateMeshCentralServer(config, args) {
if ((vapidKeys == null) || (typeof vapidKeys.publicKey != 'string') || (typeof vapidKeys.privateKey != 'string')) {
console.log("Generating web push VAPID keys...");
vapidKeys = obj.webpush.generateVAPIDKeys();
obj.common.moveOldFiles([obj.path.join(obj.datapath, 'vapid.json')]);
obj.fs.writeFileSync(obj.path.join(obj.datapath, 'vapid.json'), JSON.stringify(vapidKeys));
}
obj.webpush.vapidPublicKey = vapidKeys.publicKey;