Load VAPID keys from configuration

This commit is contained in:
Alex Gleason
2024-10-08 19:57:46 -05:00
parent 8f437839d0
commit 198ec973b6
8 changed files with 79 additions and 28 deletions

View File

@@ -104,7 +104,7 @@ const instanceV2Controller: AppController = async (c) => {
streaming: `${wsProtocol}//${host}`,
},
vapid: {
public_key: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
public_key: await Conf.vapidPublicKey,
},
accounts: {
max_featured_tags: 10,

View File

@@ -2,6 +2,7 @@ import { nip19 } from 'nostr-tools';
import { z } from 'zod';
import { AppController } from '@/app.ts';
import { Conf } from '@/config.ts';
import { Storages } from '@/storages.ts';
import { parseBody } from '@/utils/api.ts';
import { getTokenHash } from '@/utils/auth.ts';
@@ -76,6 +77,6 @@ export const pushSubscribeController: AppController = async (c) => {
endpoint: subscription.endpoint,
alerts: data?.alerts ?? {},
policy: data?.policy ?? 'all',
// TODO: server_key
server_key: await Conf.vapidPublicKey,
});
};