From 80a6a5ef117b803beeda2ffb6427cd48637433c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Thu, 28 Nov 2024 11:07:42 +0000 Subject: [PATCH] Document VAPID_EMAIL --- backend/vapid.js | 10 ++++++++-- giconf.json | 5 ----- 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 giconf.json diff --git a/backend/vapid.js b/backend/vapid.js index 37064dd808..2005bf3897 100644 --- a/backend/vapid.js +++ b/backend/vapid.js @@ -3,8 +3,14 @@ import sbp from '@sbp/sbp' let vapidPublicKey: string let vapidPrivateKey: Object -// TODO: Load from configuration -const vapid = { VAPID_EMAIL: 'mailto:test@example.com' } +// The Voluntary Application Server Identification (VAPID) email field is "a +// stable identity for the application server" that "can be used by a push +// service to establish behavioral expectations for an application server" +// RFC 8292 +if (!process.env.VAPID_EMAIL) { + console.warn('Missing VAPID identification. Please set VAPID_EMAIL to a value like "mailto:some@example".') +} +const vapid = { VAPID_EMAIL: process.env.VAPID_EMAIL || 'mailto:test@example.com' } export const initVapid = async () => { const vapidKeyPair = await sbp('chelonia/db/get', '_private_immutable_vapid_key').then(async (vapidKeyPair: string): Promise<[Object, string]> => { diff --git a/giconf.json b/giconf.json deleted file mode 100644 index 992c6cfba6..0000000000 --- a/giconf.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "VAPID_EMAIL": "mailto:support@okTurtles.org", - "VAPID_PUBLIC_KEY": "BPZrB5emRHd9w36EKEGuyF5rTZNf11qxp4Hr57Td0I3acZWt5jK8xLUhYpzgQ7P8OpH3kUuHSNsNxre4qr1vtiM", - "VAPID_PRIVATE_KEY": "jza_sGZNhBaT53r9VnQVf17ejZST9zv4nx8WX-nNKks" -}