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
This commit is contained in:
2026-07-06 23:23:22 -04:00
parent 319030848f
commit 27a52d2986
21 changed files with 2062 additions and 1 deletions
+36
View File
@@ -87,3 +87,39 @@ type ApplyLogEntry struct {
Success bool `json:"success"`
CreatedAt time.Time `json:"created_at"`
}
type StorageConfig struct {
ID int64 `json:"id"`
MoverSource string `json:"mover_source"`
MoverDest string `json:"mover_dest"`
MoverCleanMacOS bool `json:"mover_clean_macos"`
MoverRemoveSource bool `json:"mover_remove_source"`
MoverInplace bool `json:"mover_inplace"`
MoverRsyncOptions string `json:"mover_rsync_options"`
SnapraidContent string `json:"snapraid_content"`
SnapraidDataDirs string `json:"snapraid_data_dirs"`
SnapraidParityDir string `json:"snapraid_parity_dir"`
SnapraidScrubPlan int `json:"snapraid_scrub_plan"`
UpdatedAt string `json:"updated_at"`
}
type StorageJob struct {
ID int64 `json:"id"`
Kind string `json:"kind"`
Status string `json:"status"`
ArgsJSON string `json:"args_json"`
PID int `json:"pid"`
StartedAt *string `json:"started_at,omitempty"`
FinishedAt *string `json:"finished_at,omitempty"`
ExitCode int `json:"exit_code"`
Output string `json:"output"`
Error string `json:"error"`
CreatedAt string `json:"created_at"`
}
type StorageCapabilities struct {
Rsync bool `json:"rsync"`
MergerfsBin bool `json:"mergerfs"`
MergerfsMounted bool `json:"mergerfs_mounted"`
SnapraidBin bool `json:"snapraid"`
}