Repository navigation
Add S3 compatible storage as a cloud sync provider - #3975
Open
ianperry95 wants to merge 3 commits into
Open
ianperry95 wants to merge 3 commits into
ianperry95 wants to merge 3 commits into
Conversation
Sync the same current.zip / previous.zip pair the ChurchApps sync uses to any S3 compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, MinIO, Wasabi). Requests are signed with a small built-in SigV4 implementation, so no SDK is added. The connection is tested before it is saved, the secret key stays in the main process, and the last synced zip is cached by ETag so unchanged data is not downloaded again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connect to a bucket with endpoint, region, bucket, folder and access keys, then enable sync like the ChurchApps sync. Only one sync provider is active at a time. The read-only, media folder and backup restore options move into a shared component, and live presence stays ChurchApps only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Error codes, messages and status text come from the configured storage server, and the alert popup renders messages as HTML. A malicious or intercepted endpoint could otherwise inject markup into the renderer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cloud sync only works through ChurchApps. Anyone who doesn't have a ChurchApps account, or who wants their data in storage they control, has no way to sync shows and settings between machines.
Change
Adds S3 compatible storage as a second cloud sync provider in the Files tab. It works with any S3 compatible bucket: AWS S3, Cloudflare R2, Backblaze B2, MinIO, Wasabi and others. You enter endpoint, region, bucket, an optional folder, access key and secret key, then turn on sync the same way as ChurchApps.
The provider stores the same
current.zip/previous.zippair the ChurchApps sync uses. All merge logic stays insyncManager.ts, behind a small newSyncProviderinterface, so S3 goes through the same ledger, stale merge guard and weekly backup.createCloudSocketreturns early for S3.ACCESSstore undersecrets.s3Sync. The secret key never goes back to the renderer, and leaving the field empty when editing keeps the stored one.userData/cloud-cache. A sync where nothing changed in the cloud skips the download.Files
src/electron/cloud/s3/S3Client.ts,sigv4.ts,S3Error.ts: the S3 client and request signing, with testssrc/electron/cloud/S3SyncManager.ts: the provider, config storage and ETag cachesrc/electron/cloud/syncManager.ts: theSyncProviderinterface and thes3registrationsrc/frontend/components/settings/tabs/CloudSyncS3.svelte: the connection formsrc/frontend/components/settings/tabs/CloudSyncOptions.svelte: Read only, Media sync folder and Restore weekly backup, moved here so both providers share themsrc/frontend/components/settings/tabs/Files.svelte: uses the two components abovesrc/frontend/utils/cloudSync.ts,save.ts: S3 setup and sync triggers on autosave and closesrc/electron/IPC/responsesMain.ts,src/frontend/IPC/responsesMain.ts,src/types/IPC/Main.ts: config get/set over IPCpublic/lang/en.json:cloud.s3*stringsThe ChurchApps section of
Files.svelteshows a diff from the move intoCloudSyncOptions.svelte. Its behaviour shouldn't change.Testing
vitest runonsrc/electron/cloud: 61 passed, including the new SigV4 and S3 client testscurrent.zip. I deleted a show while the app was closed, changed the machine ID and reopened. The startup sync pulled the show back down, so the new-device path works end to end.Not tested: two physical machines editing and deleting against the same bucket, the weekly
previous.ziprestore, andsvelte-check.