mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-20 21:49:16 +00:00

- Removed commented-out Supabase imports from various files to streamline the codebase. - Updated `created_at` type in `ExtPublish` model from `date` to `string` for consistency.
17 lines
523 B
TypeScript
17 lines
523 B
TypeScript
import { writeFileSync } from "fs"
|
|
import { createClient } from "@supabase/supabase-js"
|
|
|
|
if (!process.env.SUPABASE_URL || !process.env.SUPABASE_ANON_KEY) {
|
|
throw new Error("SUPABASE_URL and SUPABASE_ANON_KEY must be set")
|
|
}
|
|
|
|
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_ANON_KEY)
|
|
|
|
const { data, error } = await supabase.storage.from("pub").download("server_public_key.pem")
|
|
if (error) {
|
|
console.error(error)
|
|
throw error
|
|
}
|
|
|
|
writeFileSync("./keys/server_public_key.pem", await data.text())
|