read message_delivery_method_web_push_vapid_public_key from public settings db
Main daploy / deploy (push) Successful in 43s
Main daploy / deploy (push) Successful in 43s
This commit is contained in:
@@ -2,7 +2,7 @@ import webpush from "web-push";
|
||||
import PouchDB from "./PouchDB.js";
|
||||
|
||||
if (!process.env.VAPID_SUBJECT) {
|
||||
throw new Error('VAPID_SUBJECT env is empty!');
|
||||
throw new Error("VAPID_SUBJECT env is empty!");
|
||||
}
|
||||
|
||||
const vapidKeys = webpush.generateVAPIDKeys();
|
||||
@@ -16,3 +16,12 @@ await new PouchDB(`${process.env.API_URL}/server_settings`, {
|
||||
keys: vapidKeys,
|
||||
},
|
||||
});
|
||||
|
||||
await new PouchDB(`${process.env.API_URL}/public_settings`, {
|
||||
skip_setup: true,
|
||||
}).put({
|
||||
_id: "public_settings:message_delivery_method_web_push_vapid_public_key",
|
||||
type: "public_settings",
|
||||
name: "message_delivery_method_web_push_vapid_public_key",
|
||||
value: vapidKeys.publicKey,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user