[PR #5260] [MERGED] Stream prepared backups directly to Safari #6694

Closed
opened 2026-10-23 04:12:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5260
Author: @SpicyMarinara
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/19/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/5259-safari-backup-stream


📝 Commits (3)

  • f1e56c4 Fix Safari backup download streaming
  • 3326a8a Remove obsolete backup response helper
  • be091f3 Prevent HEAD from consuming backup jobs

📊 Changes

9 files changed (+140 additions, -94 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/data/backup-and-restore.md (+2 -4)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+12 -82)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/middleware/privileged-gate.ts (+10 -1)
📝 packages/server/src/routes/backup.routes.ts (+25 -6)
➕ scripts/regressions/backup-download-handoff.regression.ts (+36 -0)
📝 scripts/regressions/docker-proxy-auth.regression.ts (+48 -0)
📝 scripts/regressions/open-issues.regression.ts (+5 -1)

📄 Description

Why

Safari still buffered the entire prepared backup ZIP into page memory before handing it to the browser. Large backups could therefore fail after a long preparation even though the asynchronous job introduced for v2.4.3 had completed successfully.

What changed

  • return a short-lived, job-scoped download URL only after privileged status polling confirms the archive is ready
  • stream the ZIP through the browser's native download handling instead of creating a page-held Blob
  • allow that one-time capability to replace only the reusable admin secret; trusted-host and normal authentication checks still apply
  • add focused handoff and trust-boundary regressions
  • update the backup documentation and changelog

Closes #5259

Validation

  • Manually verify a large backup download in Safari
  • Manually verify remote/Docker download with Basic Auth and an admin secret
  • Run pnpm check
  • Run pnpm localization:check
  • Run the focused backup/auth regression scripts

AI-generated PR: validation boxes intentionally remain unchecked for maintainer verification.

Summary by CodeRabbit

  • New Features

    • Backup archives now download directly through the browser after preparation, including improved Safari support.
    • Secure, short-lived one-time download links are provided.
    • A confirmation message appears when the download starts.
  • Bug Fixes

    • Removed unnecessary file-saving prompts and fallback behavior.
  • Documentation

    • Updated backup and restore instructions to explain browser-dependent download behavior.
  • Security

    • Authentication and trusted-host protections remain enforced for backup downloads.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5260 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/19/2026 **Status:** ✅ Merged **Merged:** 8/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/5259-safari-backup-stream` --- ### 📝 Commits (3) - [`f1e56c4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f1e56c46d622e73d9142877f3de12c209077c725) Fix Safari backup download streaming - [`3326a8a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3326a8ac6c32ea313b8dc8bb56e37a851572a397) Remove obsolete backup response helper - [`be091f3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be091f3ecce665ba33923de2d424352be8af5335) Prevent HEAD from consuming backup jobs ### 📊 Changes **9 files changed** (+140 additions, -94 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/data/backup-and-restore.md` (+2 -4) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+12 -82) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/middleware/privileged-gate.ts` (+10 -1) 📝 `packages/server/src/routes/backup.routes.ts` (+25 -6) ➕ `scripts/regressions/backup-download-handoff.regression.ts` (+36 -0) 📝 `scripts/regressions/docker-proxy-auth.regression.ts` (+48 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+5 -1) </details> ### 📄 Description ## Why Safari still buffered the entire prepared backup ZIP into page memory before handing it to the browser. Large backups could therefore fail after a long preparation even though the asynchronous job introduced for v2.4.3 had completed successfully. ## What changed - return a short-lived, job-scoped download URL only after privileged status polling confirms the archive is ready - stream the ZIP through the browser's native download handling instead of creating a page-held Blob - allow that one-time capability to replace only the reusable admin secret; trusted-host and normal authentication checks still apply - add focused handoff and trust-boundary regressions - update the backup documentation and changelog Closes #5259 ## Validation - [ ] Manually verify a large backup download in Safari - [ ] Manually verify remote/Docker download with Basic Auth and an admin secret - [ ] Run `pnpm check` - [ ] Run `pnpm localization:check` - [ ] Run the focused backup/auth regression scripts AI-generated PR: validation boxes intentionally remain unchecked for maintainer verification. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Backup archives now download directly through the browser after preparation, including improved Safari support. - Secure, short-lived one-time download links are provided. - A confirmation message appears when the download starts. - **Bug Fixes** - Removed unnecessary file-saving prompts and fallback behavior. - **Documentation** - Updated backup and restore instructions to explain browser-dependent download behavior. - **Security** - Authentication and trusted-host protections remain enforced for backup downloads. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:12:48 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6694
No description provided.