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:
@@ -86,6 +86,21 @@ func NewRouter(s *Server) chi.Router {
|
||||
files.Get("/preview", s.handlePreview)
|
||||
files.Get("/search", s.handleSearch)
|
||||
})
|
||||
|
||||
protected.Route("/storage", func(storageRouter chi.Router) {
|
||||
storageRouter.Get("/capabilities", s.handleStorageCapabilities)
|
||||
storageRouter.Get("/config", s.handleStorageGetConfig)
|
||||
storageRouter.Put("/config", s.handleStorageUpdateConfig)
|
||||
storageRouter.Route("/jobs", func(j chi.Router) {
|
||||
j.Get("/", s.handleStorageListJobs)
|
||||
j.Post("/", s.handleStorageStartJob)
|
||||
j.Route("/{id}", func(item chi.Router) {
|
||||
item.Get("/", s.handleStorageGetJob)
|
||||
item.Post("/cancel", s.handleStorageCancelJob)
|
||||
item.Get("/stream", s.handleStorageJobStream)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user