* feat: implement cloud backup auto-sync feature with scheduling - Added a new cron route for auto-syncing Google Drive backups hourly. - Introduced a schedule management system for enabling/disabling auto-sync and setting the sync hour. - Updated the logo upload API to handle logo file management more efficiently. - Created a public storage bucket for company logos with appropriate size and type restrictions. - Enhanced the LogoUpload component to validate file types and sizes during upload. - Added tests for the new auto-sync functionality to ensure correct behavior under various conditions. * Update extensions/general/cloud-backup/lib/sync.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update app/api/settings/logo/route.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * refactor: remove unused parameters from saveExtensionData function --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
24 lines
928 B
SQL
24 lines
928 B
SQL
-- Migration: Public `logos` storage bucket for company logos
|
|
--
|
|
-- Logos render on invoices, the invoice PDF, and the public invoice-action
|
|
-- page, so they need to be fetchable without signed URLs. The existing
|
|
-- `documents` bucket is private (WORM archive) and not appropriate for
|
|
-- this use case — `getPublicUrl()` on that bucket returns an unusable URL.
|
|
--
|
|
-- This bucket is world-readable; writes happen via the server route using
|
|
-- the service role, so we do not need user-scoped INSERT/UPDATE/DELETE
|
|
-- policies for authenticated clients.
|
|
|
|
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
|
|
VALUES (
|
|
'logos',
|
|
'logos',
|
|
true,
|
|
2097152, -- 2 MB
|
|
ARRAY['image/png', 'image/jpeg', 'image/svg+xml', 'image/webp']
|
|
)
|
|
ON CONFLICT (id) DO UPDATE
|
|
SET public = EXCLUDED.public,
|
|
file_size_limit = EXCLUDED.file_size_limit,
|
|
allowed_mime_types = EXCLUDED.allowed_mime_types;
|