Tasks & Workflows
Day to day, you do five things with Apple Juicer: discover new backups, unlock encrypted ones, browse and download, index artifacts, and occasionally purge data. Each maps to an endpoint you can also drive from a script.
Discovering backups
Section titled “Discovering backups”- Make sure backups exist under
APPLE_JUICER_BACKUP_PATHS__BASE_PATH. - Call
POST /backups/refresh(or click Refresh in the UI) to rescan. - New backups are inserted and existing ones updated in Postgres, with size, device name, and encryption flag.
If backups arrive regularly, run the refresh on a schedule.
Unlocking and sessions
Section titled “Unlocking and sessions”- Enter the encryption passphrase in the UI.
POST /backups/{id}/unlockhands it toUnlockManager, which usesiphone-backup-decryptto open the keybag and Manifest.- The response carries a
session_tokenand a TTL. Send it asX-Backup-Sessionon the manifest and file routes. - To revoke early, call
POST /backups/{id}/lock. It is idempotent.
Sessions live in memory, so restarting the backend clears them.
Browsing and downloading
Section titled “Browsing and downloading”- Page through manifest entries with
GET /backups/{id}/files, filtering bydomainandpath_likeand paging withlimitandoffset. - Stream a file with
GET /backups/{id}/file/{file_id}, sending both the API and session headers. The backend deletes the temporary copy as soon as the response finishes.
Indexing artifacts
Section titled “Indexing artifacts”- Decrypting a backup enqueues
index_backup_jobfor it. - The worker parses the artifact databases and writes the normalized tables and the search index.
- When it finishes, the backup’s status becomes
INDEXEDand the artifact tabs light up.
To re-index, enqueue another job. The worker truncates the previous rows first, so you always end up with consistent data.
Purging data
Section titled “Purging data”- Drop the decrypted copy with
DELETE /backups/{id}/decrypted. The encrypted backup stays put. - Remove a backup’s rows by deleting it in Postgres;
ON DELETE CASCADEcleans up every related artifact automatically. - Empty the queue with
rq empty default. - Clear stale temp folders under
backup_paths.temp_pathif the backend ever crashed mid-download.
Automating it
Section titled “Automating it”A few endpoints lend themselves to a cron job or a watcher:
- Scheduled refresh —
curl -s -X POST http://localhost:8080/backups/refresh -H "X-API-Token: $TOKEN"on a timer. - Re-index on change — dispatch jobs for recently modified backups overnight.
- Watch for new backups — trigger the refresh the moment a new backup lands on the host.