From d4527d74fdc08e123711bea7879d1ae2bbd11d3b Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:33:23 +0800 Subject: [PATCH] updated secrets --- .github/workflows/deploy.yml | 3 +++ src/lib/server/db.ts | 4 ++-- src/lib/server/email.ts | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4d2790a..ca9233b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,6 +14,9 @@ jobs: - name: Build and start containers run: docker compose up -d --build --remove-orphans + env: + RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} + RESEND_FROM: ${{ secrets.RESEND_FROM }} - name: Prune dangling images run: docker image prune -f diff --git a/src/lib/server/db.ts b/src/lib/server/db.ts index b8e46e5..8e17221 100644 --- a/src/lib/server/db.ts +++ b/src/lib/server/db.ts @@ -2,9 +2,9 @@ import { DatabaseSync } from "node:sqlite"; import { mkdirSync } from "node:fs"; import { dirname, resolve } from "node:path"; import { randomUUID } from "node:crypto"; -import { DATABASE_PATH } from "$env/static/private"; +import { env } from "$env/dynamic/private"; -const DB_PATH = resolve(DATABASE_PATH ?? "data/dsec.db"); +const DB_PATH = resolve(env.DATABASE_PATH ?? "data/dsec.db"); let db: DatabaseSync | null = null; diff --git a/src/lib/server/email.ts b/src/lib/server/email.ts index a8e39f8..b86d9ad 100644 --- a/src/lib/server/email.ts +++ b/src/lib/server/email.ts @@ -1,8 +1,8 @@ import { Resend } from "resend"; -import { RESEND_API_KEY, RESEND_FROM } from "$env/static/private"; +import { env } from "$env/dynamic/private"; -const API_KEY = RESEND_API_KEY; -const FROM = RESEND_FROM; +const API_KEY = env.RESEND_API_KEY; +const FROM = env.RESEND_FROM; async function send(email: string, subject: string, text: string): Promise { if (!API_KEY) {