镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add S3 compatible storage as a cloud sync provider - #3975

Open
ianperry95 wants to merge 3 commits into
ChurchApps:mainfrom
ianperry95:feature/s3-cloud-sync
Open

ianperry95 wants to merge 3 commits into
ChurchApps:mainfrom
ianperry95:feature/s3-cloud-sync

Conversation

@ianperry95

@ianperry95 ianperry95 commented Nov 7, 2026 •

Copy link
Copy Markdown

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.zip pair the ChurchApps sync uses. All merge logic stays in syncManager.ts, behind a small new SyncProvider interface, so S3 goes through the same ledger, stale merge guard and weekly backup.

  • What syncs doesn't change. Shows, the portable Config stores, Bibles and media metadata. Media files still aren't synced, same as today.
  • No new dependency. The S3 client is small and has its own SigV4 signer. It only covers the calls sync needs (HEAD, GET, PUT, plus a connection test).
  • One provider at a time. Live presence and the settings socket stay ChurchApps only. createCloudSocket returns early for S3.
  • Credentials: Connect tests the bucket before saving anything. The config goes in the ACCESS store under secrets.s3Sync. The secret key never goes back to the renderer, and leaving the field empty when editing keeps the stored one.
  • ETag cache: the last synced zip is kept with its ETag in userData/cloud-cache. A sync where nothing changed in the cloud skips the download.
  • Path style defaults to on when a custom endpoint is set, since most non-AWS services need it.
  • Error text from the storage server is HTML-escaped before it reaches the alert popup. The popup renders HTML, so a bad or intercepted endpoint could otherwise inject markup.

Files

  • src/electron/cloud/s3/S3Client.ts, sigv4.ts, S3Error.ts: the S3 client and request signing, with tests
  • src/electron/cloud/S3SyncManager.ts: the provider, config storage and ETag cache
  • src/electron/cloud/syncManager.ts: the SyncProvider interface and the s3 registration
  • src/frontend/components/settings/tabs/CloudSyncS3.svelte: the connection form
  • src/frontend/components/settings/tabs/CloudSyncOptions.svelte: Read only, Media sync folder and Restore weekly backup, moved here so both providers share them
  • src/frontend/components/settings/tabs/Files.svelte: uses the two components above
  • src/frontend/utils/cloudSync.ts, save.ts: S3 setup and sync triggers on autosave and close
  • src/electron/IPC/responsesMain.ts, src/frontend/IPC/responsesMain.ts, src/types/IPC/Main.ts: config get/set over IPC
  • public/lang/en.json: cloud.s3* strings

The ChurchApps section of Files.svelte shows a diff from the move into CloudSyncOptions.svelte. Its behaviour shouldn't change.

Testing

  • vitest run on src/electron/cloud: 61 passed, including the new SigV4 and S3 client tests
  • Prettier: clean on the changed files
  • Manual, in an unsigned Windows build connected to a real bucket: the first sync uploaded current.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.zip restore, and svelte-check.

ianperry95 and others added 3 commits November 6, 2026 16:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant