I firmly believe in free software. The application I'm making here have capabilities that I've not seen in any system. It presents itself as an opportunity to collaborate on a tool that serves the people rather than corporations. Whose incentives are to help people rather, not make the most money. And whose terms ensure that these freedoms and incentives cannot be taken back or subverted. I license this software under the AGPL.
21 lines
564 B
JavaScript
21 lines
564 B
JavaScript
/*
|
|
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
import webPush from "web-push";
|
|
|
|
const vapidKeys = webPush.generateVAPIDKeys();
|
|
const cookieSecretKey = Buffer.from(
|
|
await crypto.subtle.exportKey(
|
|
"raw",
|
|
await crypto.subtle.generateKey(
|
|
{ name: "HMAC", hash: "SHA-256" }, true, ["sign", "verify"]
|
|
)
|
|
)
|
|
).toString("base64url");
|
|
|
|
console.log(`\
|
|
NUXT_PUBLIC_VAPID_PUBLIC_KEY=${vapidKeys.publicKey}
|
|
NUXT_VAPID_PRIVATE_KEY=${vapidKeys.privateKey}
|
|
NUXT_COOKIE_SECRET_KEY=${cookieSecretKey}
|
|
`);
|