Repository navigation
fix: mount target secret files as typed read-only binds - #34
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
passwordFileandcredentialsFilewere 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 withbind source path does not existinstead. The local repo stays a legacy bind on purpose, since the daemon creating it is relied on.The docs recommended pointing
passwordFileat 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
:. Dockerpath.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/pware rejected at startup.Verified against a real Docker 29.9 daemon (dind): a legacy bind of a container-only
/run/secrets/restic_passwordgives 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 ./..., andgo test ./...pass