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
1 changed files with 3 additions and 0 deletions

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: {