Skip to content

feat: add generic read-only file mounts for targets - #33

Merged
davidborzek merged 2 commits into
mainfrom
feat/target-file-mounts
Oct 13, 2026
Merged

davidborzek merged 2 commits into
mainfrom
feat/target-file-mounts

Conversation

@davidborzek

Copy link
Copy Markdown
Owner

Summary

Targets get a new files: [{source, target}] field: each host file is bind-mounted read-only into every mover of that target. Today only the restic password (passwordFile) and AWS credentials (credentialsFile) can reach the mover as files; anything else (CA certificates, SSH keys, known_hosts, rclone config, cloud key files) had to go through env, where it is visible via docker inspect or simply doesn't fit. sabon sets no env for these files; the user references the in-mover path from env or resticArgs. This is the groundwork for SFTP/rclone-based backends.

Validation: source must be a clean absolute path to a regular file (checked before each run; unclean paths are rejected because Docker path.Cleans bind sources, so a symlink before .. would otherwise stat one file and mount another). target must be absolute, unique, without :, and must not overlap sabon's own mounts (/data, /repo, /cache, /restore, /run/secrets/sabon-*) in either direction. A test keeps the reserved list in api in sync with the mount constants in internal/backup.

Existing fields are unchanged. passwordFile/credentialsFile share the unclean-path quirk; that is left for a separate fix.

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

Lets backends that read secrets or config from files (CA certs, SSH keys, rclone config) get them into movers without putting them in env.
@davidborzek
davidborzek force-pushed the feat/target-file-mounts branch from def4a69 to 9a0f102 Compare October 13, 2026 20:28
@davidborzek
davidborzek merged commit 9894c8c into main Oct 13, 2026
5 checks passed
@davidborzek
davidborzek deleted the feat/target-file-mounts branch October 13, 2026 20:30
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