Skip to content

fix: mount target secret files as typed read-only binds - #34

Merged
davidborzek merged 1 commit into
mainfrom
fix/target-secret-file-mounts
Oct 13, 2026
Merged

davidborzek merged 1 commit into
mainfrom
fix/target-secret-file-mounts

Conversation

@davidborzek

Copy link
Copy Markdown
Owner

Summary

passwordFile and credentialsFile were passed to the mover as legacy binds (HostConfig.Binds). When the host path doesn't exist, the Docker daemon silently creates it as an empty directory and mounts that, so restic fails reading a directory as its password file, and the directory is left behind on the host. Both files are now typed read-only bind mounts, which fail the mover start with bind source path does not exist instead. The local repo stays a legacy bind on purpose, since the daemon creating it is relied on.

The docs recommended pointing passwordFile at a Docker secret. That can't work: the secret only exists inside the orchestrator under /run/secrets/…, not on the host where the daemon resolves the bind. The hint is replaced by a host-file recommendation.

Both fields must now be clean absolute paths without :. Docker path.Cleans bind sources, so with a symlink before .. sabon's pre-run check and the actual mount could hit different files. Configs with unclean paths such as /etc//sabon/pw are rejected at startup.

Verified against a real Docker 29.9 daemon (dind): a legacy bind of a container-only /run/secrets/restic_password gives the mover an empty directory (cat: read error: Is a directory) and creates the path on the host; the typed mount fails cleanly. Swarm already converted binds to typed mounts, so its behaviour only changes in that the read-only flag is now carried by the typed mount.

Checklist

  • gofmt, go vet ./..., and go test ./... pass
  • Tests added/updated for behavioural changes
  • Docs updated if behaviour or configuration changed
  • Conventional Commit style used for the title

A missing host file was silently mounted as an empty directory; it now fails the mover start. Unclean paths are rejected and the Docker-secret hint is dropped, as such secrets don't exist on the host.
@davidborzek
davidborzek merged commit d0d48a2 into main Oct 13, 2026
5 checks passed
@davidborzek
davidborzek deleted the fix/target-secret-file-mounts branch October 13, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant