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:
@@ -17,6 +17,7 @@ import (
|
||||
|
||||
"github.com/darroyo/nasctl/internal/db"
|
||||
"github.com/darroyo/nasctl/internal/engine"
|
||||
"github.com/darroyo/nasctl/internal/storage"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -199,6 +200,7 @@ type Server struct {
|
||||
AdminUsername string
|
||||
UploadMaxBytes int64
|
||||
PreviewMaxBytes int64
|
||||
JM *storage.JobManager
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
@@ -209,6 +211,7 @@ type Options struct {
|
||||
AdminUsername string
|
||||
UploadMaxBytes int64
|
||||
PreviewMaxBytes int64
|
||||
JobManager *storage.JobManager
|
||||
}
|
||||
|
||||
func NewServer(database *db.DB, eng *engine.Engine, opts Options) *Server {
|
||||
@@ -228,6 +231,7 @@ func NewServer(database *db.DB, eng *engine.Engine, opts Options) *Server {
|
||||
AdminUsername: opts.AdminUsername,
|
||||
UploadMaxBytes: opts.UploadMaxBytes,
|
||||
PreviewMaxBytes: opts.PreviewMaxBytes,
|
||||
JM: opts.JobManager,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user