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:
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/darroyo/nasctl/internal/modules/nfs"
|
||||
"github.com/darroyo/nasctl/internal/modules/samba"
|
||||
"github.com/darroyo/nasctl/internal/modules/users"
|
||||
"github.com/darroyo/nasctl/internal/storage"
|
||||
"github.com/darroyo/nasctl/internal/web"
|
||||
)
|
||||
|
||||
@@ -46,6 +47,11 @@ func main() {
|
||||
log.Fatalf("migrate db: %v", err)
|
||||
}
|
||||
|
||||
jm := storage.NewJobManager(database, *execSystem)
|
||||
if err := jm.ResetOrphans(); err != nil {
|
||||
log.Printf("reset orphaned storage jobs: %v", err)
|
||||
}
|
||||
|
||||
auth, err := web.NewAuthService(database)
|
||||
if err != nil {
|
||||
log.Fatalf("init auth: %v", err)
|
||||
@@ -93,6 +99,7 @@ func main() {
|
||||
AdminUsername: *adminUser,
|
||||
UploadMaxBytes: *uploadMaxBytes,
|
||||
PreviewMaxBytes: *previewMaxBytes,
|
||||
JobManager: jm,
|
||||
})
|
||||
|
||||
log.Printf("nasctl %s (commit %s) listening on %s (db=%s exec-system=%v)", web.Version, web.Commit, *addr, *dbPath, *execSystem)
|
||||
|
||||
Reference in New Issue
Block a user