Files
OpenFrame/scripts/configure-r2-cors.ts
T
yusufipk 4bf6e821af 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
2026-05-27 17:04:39 +02:00

21 lines
537 B
TypeScript

import 'dotenv/config';
import { ensureR2UploadCors, R2_BUCKET_NAME, r2Client } from '@/lib/r2';
import { logError } from '@/lib/logger';
async function main() {
const origins = await ensureR2UploadCors();
console.log(`Configured upload CORS on bucket "${R2_BUCKET_NAME}" for origins:`);
for (const origin of origins) {
console.log(` - ${origin}`);
}
}
main()
.catch((error) => {
logError('Failed to configure R2 upload CORS:', error);
process.exitCode = 1;
})
.finally(() => {
r2Client.destroy();
});