diff --git a/.gitignore b/.gitignore index eb88bd7..97de0c4 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,10 @@ pishrink.sh frontends/web/temp_files/ rpi/config.json -# Pre-built Pi tarballs (too large for git) +# Pre-built Pi tarballs and images (release assets, too large for git) rpi/stegasoo-pi-arm64.tar.zst +rpi/stegasoo-pi-arm64.tar.zst.zip rpi/stegasoo-venv-pi-arm64.tar.zst +rpi/*.img +rpi/*.img.zst +rpi/*.img.zst.zip diff --git a/PLAN-4.1.5.md b/PLAN-4.1.5.md new file mode 100644 index 0000000..eb7ae96 --- /dev/null +++ b/PLAN-4.1.5.md @@ -0,0 +1,106 @@ +# Stegasoo 4.1.5 Plan + +## Decode Progress Bar (Real Progress) + +Mirror the encode async pattern for decode operations. + +### Backend Changes + +**1. Add async mode to `/decode` route (`app.py`)** +- Check for `async=true` form param +- Generate job_id, store job, submit to executor +- Return `{"job_id": ..., "status": "pending"}` immediately + +**2. Add decode status/progress endpoints (`app.py`)** +```python +@app.route("/decode/status/") +def decode_status(job_id): + # Return {"status": "pending|running|complete|error", "result": {...}} + +@app.route("/decode/progress/") +def decode_progress(job_id): + # Read from /tmp/stegasoo_progress_{job_id}.json + # Return {"percent": 0-100, "phase": "..."} +``` + +**3. Add `_run_decode_job()` background worker (`app.py`)** +- Similar to `_run_encode_job()` +- Pass `progress_file` param to decode function +- Store result/error in job dict + +**4. Update decode functions to write progress (`lsb_steganography.py`, `dct_steganography.py`)** + +Phases for decode: +- `"starting"` (0%) +- `"reading"` (10%) - reading stego image +- `"extracting"` (30%) - extracting hidden data +- `"decrypting"` (60%) - Argon2 + AES decryption +- `"verifying"` (80%) - HMAC verification +- `"finalizing"` (95%) - preparing output +- `"complete"` (100%) + +### Frontend Changes + +**5. Update decode form submission (`decode.html`)** +- Add async form handler like encode +- Call `Stegasoo.submitDecodeAsync(form, btn)` + +**6. Add decode async methods (`stegasoo.js`)** +```javascript +submitDecodeAsync(form, btn) // POST with async=true, show modal +pollDecodeProgress(jobId) // Poll /decode/status, /decode/progress +``` + +Reuse existing: +- `showProgressModal('Decoding')` +- `updateProgress(percent, phase)` + +**7. Handle decode result redirect** +- On complete: redirect to `/decode/result/{file_id}` or display inline + +### Files to Modify + +``` +frontends/web/app.py + - Add async handling to /decode route (~line 1300+) + - Add /decode/status/ endpoint + - Add /decode/progress/ endpoint + - Add _run_decode_job() function + +frontends/web/static/js/stegasoo.js + - Add submitDecodeAsync() + - Add pollDecodeProgress() + +frontends/web/templates/decode.html + - Update form submit to use async mode + +src/stegasoo/lsb_steganography.py + - Add progress_file param to decode() + - Write progress at each phase + +src/stegasoo/dct_steganography.py + - Add progress_file param to decode() + - Write progress at each phase +``` + +### Testing Checklist + +- [ ] Decode shows progress modal on submit +- [ ] Progress bar animates through phases +- [ ] Successful decode redirects to result +- [ ] Failed decode shows error in modal +- [ ] Works for both LSB and DCT modes +- [ ] Works for message and file payloads +- [ ] Progress file cleaned up after completion + +--- + +## Other 4.1.5 Ideas (if time) + +- [ ] Role-based permissions: admin / mod / user +- [ ] Better capacity estimates / pre-flight check +- [ ] Stego detection tool + +## Bugs / Nice to Have + +- [ ] **flash-stock-img.sh 16GB resize not working** - partition still full SD size after flash, makes dd pull slow. Investigate resize2fs/parted logic and test fix. diff --git a/rpi/BUILD_IMAGE.md b/rpi/BUILD_IMAGE.md index 45c3d27..9a89a36 100644 --- a/rpi/BUILD_IMAGE.md +++ b/rpi/BUILD_IMAGE.md @@ -1,5 +1,8 @@ # Stegasoo Pi Image Build Workflow +> **Note:** This guide is for developers building custom Pi images. +> **End users:** Just download the pre-built `.img.zst` from [Releases](https://github.com/adlee-was-taken/stegasoo/releases), flash it, and boot. No build process needed. + Quick reference for building a distributable SD card image. ## Step 1: Flash Fresh Raspbian @@ -39,6 +42,9 @@ git clone -b 4.1 https://github.com/adlee-was-taken/stegasoo.git stegasoo ## Step 5: Copy Pre-built Tarball (from host) +> **Dev-only asset:** This tarball is for building Pi images, not for end users. +> It's available on [Releases](https://github.com/adlee-was-taken/stegasoo/releases) for image builders. + ```bash # On your host machine: scp rpi/stegasoo-pi-arm64.tar.zst admin@stegasoo.local:/opt/stegasoo/rpi/