add file storage, local and prod

This commit is contained in:
Leon van Zyl
2025-11-30 08:16:24 +02:00
parent db09a4fff8
commit 654a3cf84c
19 changed files with 415 additions and 9 deletions

View File

@@ -24,6 +24,10 @@ interface DiagnosticsResponse {
ai: {
configured: boolean;
};
storage: {
configured: boolean;
type: "local" | "remote";
};
overallStatus: StatusLevel;
}
@@ -115,6 +119,10 @@ export async function GET(req: Request) {
env.BETTER_AUTH_SECRET && env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET;
const aiConfigured = env.OPENROUTER_API_KEY; // We avoid live-calling the AI provider here
// Storage configuration check
const storageConfigured = Boolean(process.env.BLOB_READ_WRITE_TOKEN);
const storageType: "local" | "remote" = storageConfigured ? "remote" : "local";
const overallStatus: StatusLevel = (() => {
if (!env.POSTGRES_URL || !dbConnected || !schemaApplied) return "error";
if (!authConfigured) return "error";
@@ -138,6 +146,10 @@ export async function GET(req: Request) {
ai: {
configured: aiConfigured,
},
storage: {
configured: storageConfigured,
type: storageType,
},
overallStatus,
};