Tasks & Workflows¶
This page outlines the recurring operational workflows for Apple Juicer.
Discovering Backups¶
- Ensure backups exist under
APPLE_JUICER_BACKUP_PATHS__BASE_PATH. - Call
POST /backups/refresh(or click “Refresh” in the UI) to scan the filesystem. - Newly discovered backups are inserted or existing rows updated in Postgres, including size bytes, device name, and encryption flags. (@api/routes/backups.py#34-51)
Tip: run refresh on a schedule (cron, GitHub Actions, etc.) if new backups arrive regularly.
Unlocking & Session Handling¶
- User supplies the encryption passphrase in the UI.
POST /backups/{id}/unlockcallsUnlockManager→iphone_backup_decryptto unlock the keybag and Manifest. (@api/routes/backups.py#53-69)- The response includes
session_tokenand TTL which must be set asX-Backup-Sessionfor subsequent manifest/file calls. - To revoke credentials early, call
POST /backups/{id}/lock(idempotent). (@api/routes/backups.py#71-81)
Sessions are stored in memory, so rebooting the backend clears them automatically.
Browsing & Downloads¶
- Use
GET /backups/{id}/fileswithdomain,path_like,limit, andoffsetquery params to page through Manifest entries. (@api/routes/backups.py#84-111) - Download files with
GET /backups/{id}/file/{file_id}– remember to set both API and session headers. The backend deletes temp files right after the response finishes. (@api/routes/backups.py#122-141)
Indexing Artifacts¶
- Trigger a job (currently via UI button) that enqueues
index_backup_jobwith artifact bundle metadata. - Worker pulls the job, parses SQLite DBs, and writes normalized tables. (@worker/tasks.py#40-332)
- Once finished,
backups.statusupdates toINDEXED, and artifact tabs in the UI become available.
To reindex, simply enqueue another job. The worker truncates previous artifacts before ingesting new data. (@worker/tasks.py#72-90)
Purging Data¶
- Delete a backup via SQL (
DELETE FROM backups WHERE ios_identifier='...') or add API support if needed. Cascades clean the related artifacts automatically because ofON DELETE CASCADE. - Clean Redis queues with
rq empty default. - Remove temp folders under
backup_paths.temp_pathwhenever the backend or worker crashes mid-download.
Automation Ideas¶
- Cron refresh –
docker exec backend-1 curl -s -X POST http://backend:8080/backups/refresh. - Scheduled reindex – dispatch jobs nightly for recently modified backups.
- Webhook integration – watch for new backups landing on the host and immediately call the refresh endpoint.