-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,14 @@ import sbp from '@sbp/sbp' | |
let vapidPublicKey: string | ||
let vapidPrivateKey: Object | ||
|
||
// TODO: Load from configuration | ||
const vapid = { VAPID_EMAIL: 'mailto:[email protected]' } | ||
// 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:[email protected]' } | ||
|
||
export const initVapid = async () => { | ||
const vapidKeyPair = await sbp('chelonia/db/get', '_private_immutable_vapid_key').then(async (vapidKeyPair: string): Promise<[Object, string]> => { | ||
|
This file was deleted.
Oops, something went wrong.