diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4ce44028..be30ec61 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,7 +7,7 @@ assignees: '' --- -Note: if you have a question or need support please post in the [discussions area](https://github.com/garethgeorge/backrest/wiki). +Note: if you have a question or need support please post in the [discussions area](https://github.com/garethgeorge/backrest/discussions). **Describe the bug** A clear and concise description of what the bug is. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 8d70f943..f3194856 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,7 +7,7 @@ assignees: '' --- -Note: if you have a question or want discussion please post in the [discussions area](https://github.com/garethgeorge/backrest/wiki). +Note: if you have a question or want discussion please post in the [discussions area](https://github.com/garethgeorge/backrest/discussions). **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. diff --git a/internal/api/backresthandler_test.go b/internal/api/backresthandler_test.go index 3a028b46..4ee8f085 100644 --- a/internal/api/backresthandler_test.go +++ b/internal/api/backresthandler_test.go @@ -51,17 +51,20 @@ func TestUpdateConfig(t *testing.T) { { name: "good modno", req: &v1.Config{ - Modno: 1234, + Modno: 1234, + Instance: "test", }, wantErr: false, res: &v1.Config{ - Modno: 1235, + Modno: 1235, + Instance: "test", }, }, { name: "reject when validation fails", req: &v1.Config{ - Modno: 1235, + Modno: 1235, + Instance: "test", Repos: []*v1.Repo{ {}, }, @@ -332,7 +335,8 @@ func TestCancelBackup(t *testing.T) { sut := createSystemUnderTest(t, &config.MemoryStore{ Config: &v1.Config{ - Modno: 1234, + Modno: 1234, + Instance: "test", Repos: []*v1.Repo{ { Id: "local", diff --git a/internal/orchestrator/repo/repo.go b/internal/orchestrator/repo/repo.go index 4c845ed7..188865e7 100644 --- a/internal/orchestrator/repo/repo.go +++ b/internal/orchestrator/repo/repo.go @@ -36,6 +36,10 @@ func NewRepoOrchestrator(config *v1.Config, repoConfig *v1.Repo, resticPath stri } var opts []restic.GenericOption + if p := repoConfig.GetPassword(); p != "" { + opts = append(opts, restic.WithEnv("RESTIC_PASSWORD="+p)) + } + opts = append(opts, restic.WithEnviron()) opts = append(opts, restic.WithEnv("RESTIC_PROGRESS_FPS=2")) @@ -45,10 +49,6 @@ func NewRepoOrchestrator(config *v1.Config, repoConfig *v1.Repo, resticPath stri } } - if p := repoConfig.GetPassword(); p != "" { - opts = append(opts, restic.WithEnv("RESTIC_PASSWORD="+p)) - } - for _, f := range repoConfig.GetFlags() { args, err := shlex.Split(f) if err != nil { @@ -97,7 +97,7 @@ func (r *RepoOrchestrator) SnapshotsForPlan(ctx context.Context, plan *v1.Plan) ctx, flush := forwardResticLogs(ctx) defer flush() - snapshots, err := r.repo.Snapshots(ctx, restic.WithFlags("--tag", TagForPlan(plan.Id), "--tag", TagForInstance(r.config.Instance))) + snapshots, err := r.repo.Snapshots(ctx, restic.WithFlags("--tag", TagForPlan(plan.Id)+","+TagForInstance(r.config.Instance))) if err != nil { return nil, fmt.Errorf("get snapshots for plan %q: %w", plan.Id, err) } diff --git a/internal/orchestrator/repo/repo_test.go b/internal/orchestrator/repo/repo_test.go index ae49c8ba..c8d0259a 100644 --- a/internal/orchestrator/repo/repo_test.go +++ b/internal/orchestrator/repo/repo_test.go @@ -128,8 +128,8 @@ func TestSnapshotParenting(t *testing.T) { t.Errorf("expected snapshot %s to have parent %s, got %s", curr.Id, prev.Id, curr.Parent) } - if !slices.Contains(curr.Tags, tagForPlan(plan)) { - t.Errorf("expected snapshot %s to have tag %s", curr.Id, tagForPlan(plan)) + if !slices.Contains(curr.Tags, TagForPlan(plan.Id)) { + t.Errorf("expected snapshot %s to have tag %s", curr.Id, TagForPlan(plan.Id)) } } } diff --git a/pkg/restic/restic.go b/pkg/restic/restic.go index fbc6cf50..ef93f332 100644 --- a/pkg/restic/restic.go +++ b/pkg/restic/restic.go @@ -79,8 +79,10 @@ func (r *Repo) pipeCmdOutputToWriter(cmd *exec.Cmd, handlers ...io.Writer) { handlers = append(stderrHandlers, cmd.Stderr) } - cmd.Stdout = io.MultiWriter(handlers...) - cmd.Stderr = io.MultiWriter(handlers...) + mw := io.MultiWriter(handlers...) + mw = &ioutil.SynchronizedWriter{W: mw} + cmd.Stdout = mw + cmd.Stderr = mw } // init initializes the repo, the command will be cancelled with the context. diff --git a/webui/src/views/GettingStartedGuide.tsx b/webui/src/views/GettingStartedGuide.tsx index 8c7c2c8c..7ca852de 100644 --- a/webui/src/views/GettingStartedGuide.tsx +++ b/webui/src/views/GettingStartedGuide.tsx @@ -31,7 +31,7 @@ export const GettingStartedGuide = () => { for details about available repository types and how they can be configured. -
  • See the Backrest wiki for instructions on how to configure Backrest.
  • +
  • See the Backrest wiki for instructions on how to configure Backrest.
  • Tips