Skip to content

feat: add resumable upload - #2

Merged
Syrup merged 7 commits into
mainfrom
feat/resumable-upload
Jun 4, 2026
Merged

Syrup merged 7 commits into
mainfrom
feat/resumable-upload

Conversation

@Syrup

@Syrup Syrup commented May 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add resumable uploads for interrupted backup runs.

This now uses per-chunk age encryption instead of one full encrypted payload. Resume can re-read the original source file, skip chunks already recorded in local upload state, upload missing chunks, then finalize the backup with manifest.age and locator.json.

What changed

  • Added gloak resume <backup-id>.
  • Added local upload state under ~/.gloak/uploads/<backup-id>.json.
  • Changed the alpha backup format to encrypt each chunk independently with age.
  • Updated manifest metadata to store plaintext and encrypted chunk sizes/hashes.
  • Updated upload to record chunk progress after each successful upload.
  • Updated resume to validate saved plaintext chunk hashes before skipping uploads.
  • Updated verify to check encrypted chunks, decrypt them, then check plaintext chunks.
  • Updated restore to decrypt and write chunks one by one.
  • Updated README, including resume docs and the new per-chunk data flow.

Why per-chunk encryption

Age recipient encryption is randomized, so re-encrypting a whole file from the beginning does not reproduce the same ciphertext chunks. Per-chunk encryption avoids that problem. Resume compares plaintext chunk hashes from the source file against the saved state, then uploads only missing chunks.

Testing

  • go test ./...
  • go build ./...

@Syrup Syrup self-assigned this May 28, 2026
@Syrup Syrup changed the title Add resumable upload feat: add resumable upload May 28, 2026
@Syrup Syrup added the enhancement New feature or request label May 28, 2026
@Syrup
Syrup marked this pull request as ready for review June 4, 2026 18:13
Copilot AI review requested due to automatic review settings June 4, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Syrup
Syrup merged commit 685887c into main Jun 4, 2026
4 checks passed
@Syrup
Syrup deleted the feat/resumable-upload branch June 4, 2026 18:29
@StackNadi StackNadi deleted a comment from opencode-agent Bot Jun 4, 2026
Syrup added a commit that referenced this pull request Oct 13, 2026
* feat: add resumable upload

* feat(resume): add upload state model

* test(resume): fix upload state timestamp assertion

* feat(resume): record upload progress

* test(resume): cover mid-upload failure state

* feat(resume): complete interrupted upload resume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants