(feature) queue manual backups from the Django host page

Add a staff-only manual backup form to host detail pages with safe
dry-run defaults and optional retention settings.

Queue manual BackupRun records through the existing worker-backed runner
path instead of executing backups inside the web request.

Validate disabled hosts, missing global config, and invalid methods with
view tests covering the new UI flow.
This commit is contained in:
2026-05-19 13:04:50 +02:00
parent fe8e65e12e
commit 3da877eb8a
5 changed files with 141 additions and 1 deletions

View File

@@ -117,6 +117,23 @@ class GlobalConfigForm(forms.ModelForm):
return instance
class ManualBackupForm(forms.Form):
dry_run = forms.BooleanField(
required=False,
initial=True,
help_text="Queue rsync in dry-run mode without writing a snapshot.",
)
prune = forms.BooleanField(
required=False,
help_text="Apply retention after a successful non-dry-run backup.",
)
prune_max_delete = forms.IntegerField(min_value=0, initial=10)
prune_protect_bases = forms.BooleanField(
required=False,
help_text="Keep snapshots that are used as bases by other snapshots.",
)
class ScheduleConfigForm(forms.ModelForm):
cron_expr = forms.CharField(
label="Cron expression",