feat: enable S3 video uploads and update related configurations

- Added support for self-hosted S3 video uploads with new environment variables: OPENFRAME_ENABLE_S3_VIDEO_UPLOADS and OPENFRAME_MAX_VIDEO_UPLOAD_BYTES.
- Updated .env.example and .env.docker.example to reflect new configuration options.
- Enhanced Content Security Policy to include origins for S3-compatible storage.
- Updated dependencies for AWS SDK to support new features.
- Refactored upload logic to accommodate both Bunny and S3 upload providers.
- Updated documentation to clarify the usage of direct uploads and S3 configurations.
- Closes #11
This commit is contained in:
yusufipk
2026-05-27 17:04:39 +02:00
parent b6de3a29aa
commit 4bf6e821af
57 changed files with 2707 additions and 436 deletions
+32
View File
@@ -361,6 +361,7 @@ model VideoVersion {
title String?
thumbnailUrl String?
duration Int? // Duration in seconds
sizeBytes BigInt @default(0) @map("size_bytes") // R2-hosted video file size
// Status
isActive Boolean @default(true) // Currently displayed version
@@ -701,6 +702,37 @@ model UploadReservation {
@@map("upload_reservations")
}
enum UploadSessionStatus {
INITIATED
FINALIZED
CANCELLED
EXPIRED
}
model VideoUploadSession {
id String @id @default(cuid())
uploadJti String @unique @map("upload_jti")
userId String
projectId String
billedUserId String @map("billed_user_id")
objectKey String @unique @map("object_key")
thumbnailObjectKey String @map("thumbnail_object_key")
declaredSizeBytes BigInt @map("declared_size_bytes")
contentType String @map("content_type")
reservationId String? @map("reservation_id")
expiresAt DateTime @map("expires_at")
status UploadSessionStatus @default(INITIATED)
consumedAt DateTime? @map("consumed_at")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([projectId, status])
@@index([userId, status])
@@index([billedUserId])
@@index([expiresAt])
@@map("video_upload_sessions")
}
// Rate limiting table (created as UNLOGGED via raw SQL migration)
// Defined here so `prisma db push` doesn't drop it
model RateLimit {