feat: download snapshots as real compressed archives (auth M6a)

- the download format follows the file's first bytes and manifest hints: plain SQL ->
  .sql.gz, tar -> .tar.gz, SQLite -> .sqlite.gz, hub filesystem archive -> .tessera-fs.gz,
  unknown -> .dump.gz; pg_dump -Fc stays .dump; gzip/zstd/xz/bzip2/zip pass through
- gzip is streamed (async-compression) in 64 KiB frames; no Content-Encoding, no
  Content-Length on compressed bodies, application/gzip, nosniff, no-store; HEAD is 405
- order: authenticate, find, permission, then admission (export slots and free disk), so a
  caller without permission cannot use up the slots
- the export directory, the slot and the audit end-of-download row live with the response
  body: finished, client disconnect, and a sweep of tessera-export-* at start after a crash
- audit export.requested / ready / finished / disconnected

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 17:27:06 +07:00
parent 228ca42801
commit e72b72111d
14 changed files with 725 additions and 41 deletions

View File

@@ -114,6 +114,9 @@ export function SnapshotSheet({
<path d="M8 2v8M4.5 7 8 10.5 11.5 7M3 13.5h10" />
</svg>
</a>}
{canDownload && <p className="mt-1 text-xs text-star-300">
Contains the source's raw data. It is downloaded as a .gz archive unless the format is already compressed; unpack it with gunzip.
</p>}
{canManage && (confirmDelete ? (
<div className="sheet-confirm" role="alertdialog" aria-label="Confirm deletion">
<p>Remove this recovery point from the hub catalogue? This cannot be undone.</p>