Commit Graph

4 Commits

Author SHA1 Message Date
darroyo 5b459c0b2e fix(storage): stream job output in real-time with StdoutPipe/StderrPipe
- Replace blocking outBuf/errBuf capture with StdoutPipe+StderrPipe + goroutines
- scanAndEmit runs in parallel for stdout and stderr, emitting each line
  via SSE broadcast and DB append immediately (not after cmd.Run completes)
- Custom scanner split: bytes.TrimRight strips trailing \r so snapraid
  progress lines (e.g. '2%, 57396 MB\r') are stored as clean lines
- scanner.Buffer increased to 128KB max to handle large outputs
- Use sync.WaitGroup to ensure both scanners finish before MarkJobFinished
- Fix PID capture: cmd.Process is nil before cmd.Start(), pass 0 instead
2026-07-07 09:07:08 -04:00
darroyo d42a0ab412 fix(storage): correct exit_code=0 treated as failed for successful jobs 2026-07-07 01:34:46 -04:00
darroyo 599af5a828 feat(storage): rename snapraid_content to snapraid_conf; clarify conf vs content file; add auto-detect and conf viewer 2026-07-07 01:17:55 -04:00
darroyo 27a52d2986 feat: add mergerfs mover and snapraid integration
New 'Almacenamiento' page with:
- Auto-detection of rsync, mergerfs, snapraid binaries and mergerfs mount
- Configurable pool settings (source/dest, macOS cleanup, rsync flags)
- Mergerfs mover with dry-run preview and live SSE output streaming
- SnapRAID diff/sync/scrub/check with live SSE output
- Async job system (1 concurrent job) with SSE streaming
- Job history table

Backend:
- internal/storage/ package with capabilities, mergerfs, snapraid, jobs
- storage_config and storage_jobs DB tables (migration 0008)
- GET/PUT /api/storage/config, GET /api/storage/capabilities
- POST/GET /api/storage/jobs, GET /api/storage/jobs/{id}/stream
- Storage operations disabled when NASCTL_EXEC_SYSTEM=false

Closes #new-feature
2026-07-06 23:23:22 -04:00