Skip to content

Commit

Permalink
fix: add missing secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli committed Jan 25, 2024
1 parent 18457d9 commit c026d38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export default defineNuxtConfig(
),
},
},
turnstile: {
secretKeyPath: process.env.NUXT_PUBLIC_SITE_URL
? '/run/secrets/jonas-thelemann_turnstile-key'
: undefined,
},
site: {
id: 'jonas-thelemann',
identity: {
Expand Down
10 changes: 4 additions & 6 deletions src/server/api/contact.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { createTransport } from 'nodemailer'

const MAIL_FROM = '"jonas-thelemann" <noreply+contact@jonas-thelemann.de>'
const MAIL_TO = 'e-mail+contact@jonas-thelemann.de'
const SECRET_STOMPER_NODEMAILER_TRANSPORTER_PATH =
'/run/secrets/stomper_nodemailer-transporter'
const SECRET_NODEMAILER_TRANSPORTER_PATH =
'/run/secrets/jonas-thelemann_nodemailer-transporter'

export default defineEventHandler(async function (event) {
await assertTurnstileValid(event)
Expand All @@ -20,10 +20,8 @@ const sendMail = async (event: H3Event) => {

const transport = runtimeConfig.nodemailer.transporter
? runtimeConfig.nodemailer.transporter
: existsSync(SECRET_STOMPER_NODEMAILER_TRANSPORTER_PATH)
? JSON.parse(
readFileSync(SECRET_STOMPER_NODEMAILER_TRANSPORTER_PATH, 'utf-8'),
)
: existsSync(SECRET_NODEMAILER_TRANSPORTER_PATH)
? JSON.parse(readFileSync(SECRET_NODEMAILER_TRANSPORTER_PATH, 'utf-8'))
: undefined

if (!transport) {
Expand Down

0 comments on commit c026d38

Please sign in to comment.