garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.57k stars 41 forks source link

Repo policy allows invalid negative values #435

Open mitchplze opened 2 months ago

mitchplze commented 2 months ago
error: forget: get snapshots for repo xxx: command "/bin/restic-0.17.0 forget --json --keep-hourly -15 --keep-daily 90 -o sftp.args=-oBatchMode=yes --ta..." failed: exit status 1
Output:
invalid argument "-15" for "-H, --keep-hourly" flag: negative values not allowed, use 'unlimited' instead

When I scrolled down on the repo settings page, my scroll wheel accidentally scrolled the counter down to a negative value and I didn't notice. This causes forget's to break, as it's a negative number.

Suggest that this field and probably others, should not allow negative values at all.

image
garethgeorge commented 1 month ago

Good point, Backrest should probably be limiting the ranges of these fields.