mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
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:
@@ -82,6 +82,16 @@ async function getPublicTables(client: Client) {
|
||||
return result.rows.map((row) => row.table_name);
|
||||
}
|
||||
|
||||
async function ensureRateLimitCleanupFunction(client: Client) {
|
||||
await client.query(`
|
||||
CREATE OR REPLACE FUNCTION cleanup_rate_limits() RETURNS void AS $$
|
||||
BEGIN
|
||||
DELETE FROM rate_limits WHERE window_start < NOW() - INTERVAL '1 hour';
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
`);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
if (!process.env.DATABASE_URL) {
|
||||
throw new Error('DATABASE_URL is required');
|
||||
@@ -132,6 +142,7 @@ async function main() {
|
||||
await runPrisma(['migrate', 'resolve', '--applied', migrationName]);
|
||||
}
|
||||
|
||||
await ensureRateLimitCleanupFunction(client);
|
||||
console.log('Fresh database bootstrap complete');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user