From 7b4f47667b58287616fc667ef4521cc4d93bbbe5 Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 10 May 2026 14:42:50 +0530 Subject: [PATCH] Use hardcoded R2 credentials (for testing only) --- src/app/api/upload/route.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/api/upload/route.ts b/src/app/api/upload/route.ts index cd3c8d3..53b94fa 100644 --- a/src/app/api/upload/route.ts +++ b/src/app/api/upload/route.ts @@ -3,14 +3,15 @@ import { getSignedUrl } from "@aws-sdk/s3-request-presigner"; import { NextRequest, NextResponse } from "next/server"; function getR2() { - const accountId = process.env.R2_ACCOUNT_ID; - const accessKeyId = process.env.R2_ACCESS_KEY_ID; - const secretKey = process.env.R2_SECRET_ACCESS_KEY; - const bucket = process.env.R2_BUCKET_NAME; + // Debug: explicitly hardcode for now since env might not be passed to container + const accountId = "e71f22a2f8614fb3ba6d9b28a264d8ce"; + const accessKeyId = "6606d525c8e647d94e051b6d6565803b"; + const secretKey = "244fcc44041f452241cbc68374cd7a6ca651cb71f361bc36cc932407bbe37863"; + const bucket = "tia"; - if (!accountId || !accessKeyId || !secretKey || !bucket) { - throw new Error(`Missing R2 config: ${!!accountId} ${!!accessKeyId} ${!!secretKey} ${!!bucket}`); - } + if (!accountId || !accessKeyId || !secretKey || !bucket) { + throw new Error(`Missing R2 config`); + } // S3 API endpoint includes bucket name: https://.r2.cloudflarestorage.com/ const endpoint = `https://${accountId}.r2.cloudflarestorage.com/${bucket}`;