diff --git a/README.md b/README.md index e7b4125a..2a04af65 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,12 @@ services: ports: - "9898:9898" restart: unless-stopped + # Optional, these are required for fast repo browsing mode using FUSE + # but are not required for the default repo browsing mode using `restic ls` + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse:/dev/fuse ``` ## Running on Linux diff --git a/pkg/restic/restic.go b/pkg/restic/restic.go index 45fbc6e1..1de61f42 100644 --- a/pkg/restic/restic.go +++ b/pkg/restic/restic.go @@ -480,9 +480,11 @@ func (r *Repo) Mount(ctx context.Context, dir string, mountTimeout time.Duration } // Start the mount command in background + errorCollector := errorMessageCollector{} cmd := r.commandWithContext(ctx, []string{"mount", dir}, opts...) + r.handleOutput(cmd, withAllTo(&errorCollector), withLogWriterFromContext(ctx)) if err := cmd.Start(); err != nil { - return newCmdError(ctx, cmd, err) + return errorCollector.AddCmdOutputToError(cmd, err) } // Wait for mount to become available @@ -508,7 +510,7 @@ func (r *Repo) Mount(ctx context.Context, dir string, mountTimeout time.Duration } if cmd.ProcessState != nil && cmd.ProcessState.Exited() { - return newCmdError(ctx, cmd, fmt.Errorf("restic mount process exited with code %d", cmd.ProcessState.ExitCode())) + return errorCollector.AddCmdOutputToError(cmd, fmt.Errorf("restic mount process exited with code %d", cmd.ProcessState.ExitCode())) } } }