feat: add webhook signing key as config variable

This commit is contained in:
mrjvs
2026-08-12 20:54:28 +02:00
parent 8a8c84756d
commit be092ca6b5
5 changed files with 6 additions and 2 deletions

View File

@@ -45,7 +45,8 @@ There are no fully required configuration variables, the app can runs minimally
| | `PN_WEBSITE_DISCORD_SUPPORTER_ROLE_ID` | Role to give for supporter access | (No role) |
| | | | |
| Payments | `PN_WEBSITE_STRIPE_SECRET_KEY` | Stripe secret key | - |
| (Requires `discord` feature) | `PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL` | Email address to send stripe notifications to | (No notifications) |
| (Requires `discord` feature) | `PN_WEBSITE_STRIPE_WEBHOOK_SECRET` | Stripe webhook signing key | - |
| | `PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL` | Email address to send stripe notifications to | (No notifications) |
| | `PN_WEBSITE_MONGO_CONNECTION_STRING` | MongoDB connection string for account server | - |
| | `PN_WEBSITE_SMTP_HOST` | Host for the SMTP server | - |
| | `PN_WEBSITE_SMTP_PORT` | Port for the SMTP server | `587` |

View File

@@ -28,6 +28,7 @@ PN_WEBSITE_DISCORD_SUPPORTER_ROLE_ID=
# Optional - Donation features + rewards (Requires discord):
PN_WEBSITE_STRIPE_SECRET_KEY=
PN_WEBSITE_STRIPE_WEBHOOK_SECRET=
PN_WEBSITE_STRIPE_NOTIFICATION_EMAIL=notifs@example.com
PN_WEBSITE_MONGO_CONNECTION_STRING=mongodb://localhost:27017/account?directConnection=true
PN_WEBSITE_SMTP_HOST=localhost

View File

@@ -33,6 +33,7 @@ export default defineNuxtConfig({
githubApiToken: '',
stripeSecretKey: '',
stripeWebhookSecret: '',
stripeNotificationEmail: '',
hcaptchaSecretKey: '',
grpcHost: '',

View File

@@ -49,7 +49,7 @@ export async function handleStripeEvent(event: H3Event, stripe: Stripe, webhook:
return;
}
if (webhook.type === 'customer.subscription.updated' || webhook.type === 'customer.subscription.deleted') {
if (webhook.type === 'customer.subscription.updated' || webhook.type === 'customer.subscription.created' || webhook.type === 'customer.subscription.deleted') {
const subscription = webhook.data.object;
const subscriptionItem = subscription.items.data[0];
if (!subscriptionItem) {

View File

@@ -9,6 +9,7 @@ declare module 'nuxt/schema' {
githubApiToken: string;
stripeSecretKey: string;
stripeWebhookSecret: string;
stripeNotificationEmail: string;
hcaptchaSecretKey: string;