multi-backup-targets #5

Merged
stamatisd merged 0 commits from multi-backup-targets into main 2026-06-11 06:32:45 -05:00
stamatisd commented 2026-06-10 22:53:44 -05:00 (Migrated from git.etawen.dev)

Added multi-target backup support and optimized the backup flow.

Backups can now be written to multiple enabled destinations, including local PS5 storage, USB, FTP, and the browser Drive queue for auto backups. The payload now packages the save ZIP once into a temporary staging file, then copies or uploads that same ZIP to each destination, instead of rebuilding the archive per target.

Also added per-destination progress/notifications, so backups report results like Local backup done (1/3), FTP backup failed (2/3), and final backup 2/3 done.

Added multi-target backup support and optimized the backup flow. Backups can now be written to multiple enabled destinations, including local PS5 storage, USB, FTP, and the browser Drive queue for auto backups. The payload now packages the save ZIP once into a temporary staging file, then copies or uploads that same ZIP to each destination, instead of rebuilding the archive per target. Also added per-destination progress/notifications, so backups report results like Local backup done (1/3), FTP backup failed (2/3), and final backup 2/3 done.
earthonion commented 2026-06-11 06:32:44 -05:00 (Migrated from git.etawen.dev)

Reviewed — going to merge. The PASS-command rewrite is a real correctness/security improvement: replacing snprintf("PASS %s", pass) with ftp_cmd_arg(ftp, "PASS", cfg->pass, ...) doing direct send_all_fd byte writes eliminates format-string interpretation of password characters (a password with % would have misbehaved before), and the ftp_arg_has_crlf injection guard is a nice belt-and-suspenders.

Minor observations, none blocking:

  • Staging path BACKUP_TMP_DIR/<filename> is deterministic from save filename. Two concurrent backups of the same save (e.g. manual + auto firing on game close) could race on the .tmp write. A pid/timestamp suffix on the staging name would close that. Low-probability in practice.
  • Final notify message backup N/M done doesn't name which target failed (the intermediate cloud_set_step calls do, but the toast-style result is just the count). Including the failed target name(s) in the final notification would help debugging.
  • USB target hardcodes /mnt/usb0 as default; the existing save-scan code at L11054 / L15676 enumerates /mnt/usb0..7. Backup target could auto-detect the first writable USB instead of requiring config override. Workaround via cloud.json exists, so just a nicety.

Merging.

Reviewed — going to merge. The PASS-command rewrite is a real correctness/security improvement: replacing `snprintf("PASS %s", pass)` with `ftp_cmd_arg(ftp, "PASS", cfg->pass, ...)` doing direct `send_all_fd` byte writes eliminates format-string interpretation of password characters (a password with `%` would have misbehaved before), and the `ftp_arg_has_crlf` injection guard is a nice belt-and-suspenders. Minor observations, none blocking: - Staging path `BACKUP_TMP_DIR/<filename>` is deterministic from save filename. Two concurrent backups of the same save (e.g. manual + auto firing on game close) could race on the `.tmp` write. A pid/timestamp suffix on the staging name would close that. Low-probability in practice. - Final notify message `backup N/M done` doesn't name which target failed (the intermediate `cloud_set_step` calls do, but the toast-style result is just the count). Including the failed target name(s) in the final notification would help debugging. - USB target hardcodes `/mnt/usb0` as default; the existing save-scan code at L11054 / L15676 enumerates `/mnt/usb0..7`. Backup target could auto-detect the first writable USB instead of requiring config override. Workaround via cloud.json exists, so just a nicety. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
git-etawen-dev-earthonion/garlic-savemgr!5
No description provided.