server: set vapid keys on initial setup

This commit is contained in:
Johann150 2022-11-21 22:30:34 +01:00
parent 563f3672a9
commit 01fa4332c2
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -35,8 +35,11 @@ async function getMeta(): Promise<void> {
},
});
if (metas.length === 0) {
const { publicKey, privateKey } = push.generateVAPIDKeys();
await db.manager.insert(Meta, {
id: 'x',
swPublicKey: publicKey,
swPrivateKey: privateKey,
});
metas = await db.manager.find(Meta, {
order: {