diff --git a/internal/orchestrator/taskprune.go b/internal/orchestrator/taskprune.go index 7cdaf36a..adad1690 100644 --- a/internal/orchestrator/taskprune.go +++ b/internal/orchestrator/taskprune.go @@ -57,7 +57,7 @@ func (t *PruneTask) Next(now time.Time) *time.Time { SnapshotId: t.linkSnapshot, UnixTimeStartMs: timeToUnixMillis(*ret), Status: v1.OperationStatus_STATUS_PENDING, - Op: &v1.Operation_OperationForget{}, + Op: &v1.Operation_OperationPrune{}, }); err != nil { zap.S().Errorf("task %v failed to add operation to oplog: %v", t.Name(), err) return nil diff --git a/proto/v1/config.proto b/proto/v1/config.proto index 06e4255f..551b8ab3 100644 --- a/proto/v1/config.proto +++ b/proto/v1/config.proto @@ -6,7 +6,7 @@ option go_package = "github.com/garethgeorge/backrest/gen/go/v1"; // Config is the top level config object for restic UI. message Config { - // modification number, used for read-modify-write consistency in the UI. Incremented on every write. + // modification number, used for read-modify-write consistency in the UI. Incremented on every write. int32 modno = 1 [json_name="modno"]; // override the hostname tagged on backups. If provided it will be used in addition to tags to group backups. @@ -49,9 +49,9 @@ message RetentionPolicy { } message PrunePolicy { - int32 max_frequency_days = 1; // max frequency of prune runs in days. If 0, prune will be run on every backup. - int32 max_unused_percent = 100; // max percentage of repo size that can be unused before prune is run. - int32 max_unused_bytes = 101; // max number of bytes that can be unused before prune is run. + int32 max_frequency_days = 1 [json_name="maxFrequencyDays"]; // max frequency of prune runs in days. If 0, prune will be run on every backup. + int32 max_unused_percent = 100 [json_name="maxUnusedPercent"]; // max percentage of repo size that can be unused before prune is run. + int32 max_unused_bytes = 101 [json_name="maxUnusedBytes"]; // max number of bytes that can be unused before prune is run. } message User { diff --git a/scripts/latest-restic-version.sh b/scripts/latest-restic-version.sh index e11a6eca..ad5a4717 100755 --- a/scripts/latest-restic-version.sh +++ b/scripts/latest-restic-version.sh @@ -1,6 +1,5 @@ #!/bin/bash curl -s https://api.github.com/repos/restic/restic/releases/latest \ -| grep "https://api.github.com/repos/restic/restic/tarball/" \ -| sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/ - + | grep "https://api.github.com/repos/restic/restic/tarball/" \ + | sed -E 's/.*v([0-9]+\.[0-9]+\.[0-9]+).*/\1/' # extract just the version number diff --git a/scripts/update-restic-version.sh b/scripts/update-restic-version.sh new file mode 100755 index 00000000..8de9ecc9 --- /dev/null +++ b/scripts/update-restic-version.sh @@ -0,0 +1,12 @@ +#! /bin/bash + +latest_restic_version=$(./scripts/latest-restic-version.sh) + +if [ -z "$latest_restic_version" ]; then + echo "Failed to get latest restic version" + exit 1 +fi + +echo "Latest restic version: $latest_restic_version" + +sed -i -E "s/^.*RequiredResticVersion\ =\ .*$/ RequiredResticVersion\ =\ \"$latest_restic_version\"/g" internal/resticinstaller/resticinstaller.go \ No newline at end of file diff --git a/webui/src/views/AddRepoModal.tsx b/webui/src/views/AddRepoModal.tsx index 825c81c5..d804a718 100644 --- a/webui/src/views/AddRepoModal.tsx +++ b/webui/src/views/AddRepoModal.tsx @@ -8,6 +8,8 @@ import { Button, Row, Col, + Card, + InputNumber, } from "antd"; import React, { useState } from "react"; import { useShowModal } from "../components/ModalManager"; @@ -396,6 +398,37 @@ export const AddRepoModal = ({ )} + {/* Repo.prunePolicy */} +