File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ const EnvironmentSchema = z
346346 OBJECT_STORE_REGION : z . string ( ) . optional ( ) ,
347347 OBJECT_STORE_SERVICE : z . string ( ) . default ( "s3" ) ,
348348
349- ARTIFACTS_OBJECT_STORE_BUCKET : z . string ( ) ,
349+ ARTIFACTS_OBJECT_STORE_BUCKET : z . string ( ) . optional ( ) ,
350350 ARTIFACTS_OBJECT_STORE_BASE_URL : z . string ( ) . optional ( ) ,
351351 ARTIFACTS_OBJECT_STORE_ACCESS_KEY_ID : z . string ( ) . optional ( ) ,
352352 ARTIFACTS_OBJECT_STORE_SECRET_ACCESS_KEY : z . string ( ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -63,10 +63,15 @@ export async function action({ request }: ActionFunctionArgs) {
6363 logger . error ( "Failed to create presigned POST" , { error } ) ;
6464 return json ( { error : "Failed to generate artifact upload URL" } , { status : 500 } ) ;
6565 }
66- default :
66+ case "artifacts_bucket_not_configured" : {
67+ logger . error ( "Artifacts bucket not configured" , { error } ) ;
68+ return json ( { error : "Internal server error" } , { status : 500 } ) ;
69+ }
70+ default : {
6771 error satisfies never ;
6872 logger . error ( "Failed creating artifact" , { error } ) ;
6973 return json ( { error : "Internal server error" } , { status : 500 } ) ;
74+ }
7075 }
7176 }
7277 ) ;
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ export class ArtifactsService extends BaseService {
6161 }
6262
6363 private createPresignedPost ( key : string , sizeLimit : number , contentLength ?: number ) {
64+ if ( ! this . bucket ) {
65+ return errAsync ( {
66+ type : "artifacts_bucket_not_configured" as const ,
67+ } ) ;
68+ }
69+
6470 const ttlSeconds = 300 ; // 5 minutes
6571 const expiresAt = new Date ( Date . now ( ) + ttlSeconds * 1000 ) ;
6672
You can’t perform that action at this time.
0 commit comments