diff --git a/dist/urbm-2026.06.22.r002-x86_64-1.txz.sha256 b/dist/urbm-2026.06.22.r002-x86_64-1.txz.sha256 deleted file mode 100644 index b3830c6..0000000 --- a/dist/urbm-2026.06.22.r002-x86_64-1.txz.sha256 +++ /dev/null @@ -1 +0,0 @@ -1fda0986918fa5838cbd8f56ce013e1c5a2add51c41fb5cee14fe77c0e33c0b4 urbm-2026.06.22.r002-x86_64-1.txz diff --git a/dist/urbm-2026.06.22.r002-x86_64-1.txz b/dist/urbm-2026.06.22.r003-x86_64-1.txz similarity index 55% rename from dist/urbm-2026.06.22.r002-x86_64-1.txz rename to dist/urbm-2026.06.22.r003-x86_64-1.txz index 1b1b38f..d10d725 100644 Binary files a/dist/urbm-2026.06.22.r002-x86_64-1.txz and b/dist/urbm-2026.06.22.r003-x86_64-1.txz differ diff --git a/dist/urbm-2026.06.22.r003-x86_64-1.txz.sha256 b/dist/urbm-2026.06.22.r003-x86_64-1.txz.sha256 new file mode 100644 index 0000000..1aa95c3 --- /dev/null +++ b/dist/urbm-2026.06.22.r003-x86_64-1.txz.sha256 @@ -0,0 +1 @@ +3459126382e7099035ffbdd3d39ca419e2531d0602d2eaac1ae0621d67ae5c91 urbm-2026.06.22.r003-x86_64-1.txz diff --git a/dist/urbm.plg b/dist/urbm.plg index 4c2f9c4..25846f9 100644 --- a/dist/urbm.plg +++ b/dist/urbm.plg @@ -2,13 +2,17 @@ - + - + ]> +### 2026.06.22.r003 +- Send Unraid and Gotify notifications after scheduled or manual repository prune tasks finish. +- Use task-specific notification summary headings for backup, rsync, restore, prune, and check messages. + ### 2026.06.22.r002 - Preserve page and tree-container scroll positions after expanding deeply nested folders in source, target, settings, repository, and snapshot trees. - Restore scroll positions after the browser has processed focus/layout changes to prevent jumps back to the root. diff --git a/internal/service/notification_test.go b/internal/service/notification_test.go index 88a7656..d5a83ab 100644 --- a/internal/service/notification_test.go +++ b/internal/service/notification_test.go @@ -27,3 +27,18 @@ func TestNotificationTitleIncludesRepositoryAndStatus(t *testing.T) { t.Fatalf("title = %q", title) } } + +func TestNotificationMessageIncludesPruneSummary(t *testing.T) { + started := time.Date(2026, 6, 22, 3, 0, 0, 0, time.UTC) + finished := started.Add(42 * time.Second) + run := model.Run{TaskType: "prune", Status: "success", StartedAt: &started, FinishedAt: &finished, Message: "prune completed"} + message := notificationMessage("Repository-Bereinigung", "LV-426", run, finished) + for _, expected := range []string{"🧹 Prune-Zusammenfassung", "📦 Repository: LV-426", "🗂️ Job: Repository-Bereinigung", "⏱️ Dauer: 42 Sekunden", "🔐 Ziel: Restic Repository", "✅ Status: Erfolgreich"} { + if !strings.Contains(message, expected) { + t.Errorf("message %q does not contain %q", message, expected) + } + } + if strings.Contains(message, "⚠️ Details: prune completed") { + t.Fatalf("message contains redundant prune completion details: %q", message) + } +} diff --git a/internal/service/service.go b/internal/service/service.go index 65b10e4..635eab2 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -427,8 +427,14 @@ func (s *Service) ForceUnlockRepository(ctx context.Context, repoID string) erro return s.restic.ForceUnlock(ctx, mounted.Repository) } -func (s *Service) execute(ctx context.Context, run model.Run) model.Run { +func (s *Service) execute(ctx context.Context, run model.Run) (result model.Run) { ctx = restic.WithRunID(ctx, run.ID) + maintenanceRepoName := "" + defer func() { + if result.TaskType == "prune" && (result.Status == "success" || result.Status == "warning" || result.Status == "failed") { + go s.notify("Repository-Bereinigung", maintenanceRepoName, result) + } + }() if run.TaskType == "backup" { return s.executeBackup(ctx, run) } @@ -442,6 +448,7 @@ func (s *Service) execute(ctx context.Context, run model.Run) model.Run { if !ok { return failed(run, "validation", "repository no longer exists") } + maintenanceRepoName = repo.Name live := run appendLiveLog(&live, strings.ToUpper(run.TaskType)+" wird vorbereitet") s.updateActive(live) @@ -817,7 +824,11 @@ func notificationMessage(name, repository string, run model.Run, now time.Time) if status == "" { status = run.Status } - lines := []string{"📊 Backup-Zusammenfassung", ""} + summaryTitle := map[string]string{"backup": "📊 Backup-Zusammenfassung", "rsync": "📊 Rsync-Zusammenfassung", "restore": "📊 Restore-Zusammenfassung", "prune": "🧹 Prune-Zusammenfassung", "check": "🔎 Prüfungs-Zusammenfassung"}[run.TaskType] + if summaryTitle == "" { + summaryTitle = "📊 URBM-Zusammenfassung" + } + lines := []string{summaryTitle, ""} if repository != "" { lines = append(lines, "📦 Repository: "+repository) } @@ -852,7 +863,7 @@ func notificationMessage(name, repository string, run model.Run, now time.Time) } } lines = append(lines, "", "🔐 Ziel: "+notificationTargetLabel(run.TaskType), statusIcon(run.Status)+" Status: "+status) - if run.Message != "" && run.Message != "backup completed" && run.Message != "rsync completed" { + if run.Message != "" && run.Message != run.TaskType+" completed" { lines = append(lines, "⚠️ Details: "+run.Message) } return strings.Join(lines, "\n") diff --git a/plugin/urbm.plg b/plugin/urbm.plg index 75b56ae..aae58c8 100644 --- a/plugin/urbm.plg +++ b/plugin/urbm.plg @@ -2,13 +2,17 @@ - + ]> +### 2026.06.22.r003 +- Send Unraid and Gotify notifications after scheduled or manual repository prune tasks finish. +- Use task-specific notification summary headings for backup, rsync, restore, prune, and check messages. + ### 2026.06.22.r002 - Preserve page and tree-container scroll positions after expanding deeply nested folders in source, target, settings, repository, and snapshot trees. - Restore scroll positions after the browser has processed focus/layout changes to prevent jumps back to the root. diff --git a/webgui/URBM.page b/webgui/URBM.page index 31d3ed9..f457d7e 100644 --- a/webgui/URBM.page +++ b/webgui/URBM.page @@ -9,12 +9,12 @@ Tag="URBM Unraid Restic Backup Manager backup snapshots restore" - +
- -

URBM 2026.06.22.r002

Restic Backup Manager für Unraid

+ +

URBM 2026.06.22.r003

Restic Backup Manager für Unraid

Verbindung wird hergestellt...
@@ -32,4 +32,4 @@ $pluginRoot = '/plugins/urbm';
- +