Skip to content

feat(apply): add guarded single-file remote apply - #46

Merged
jamiesun merged 1 commit into
mainfrom
feat/guarded-file-apply
Aug 16, 2026
Merged

feat(apply): add guarded single-file remote apply#46
jamiesun merged 1 commit into
mainfrom
feat/guarded-file-apply

Conversation

@jamiesun

Copy link
Copy Markdown
Contributor

Summary

Add sshx apply as the file-side mutation primitive next to sshx sql.

One invocation replaces a single remote regular file:

  1. Refuse non-absolute paths, symlinks, directories, and critical identity files
  2. Optional --expect-sha256 compare-and-swap
  3. Owner-only backup under ~/.sshx/file-backups/
  4. Same-directory temp file + atomic rename, preserving mode/owner
  5. Structured JSON: changed, completion, hashes, rollback_available

--sudo stages the payload over SFTP and installs with a privileged stdin script. Reload/restart stays a separate sshx run.

This is the v0.6.0 release.

Test plan

  • go test ./...
  • pre-commit + pre-push hooks
  • E2E: create, hash mismatch (no write), backup restore, idempotent changed=false, symlink block, reader write deny, --sudo install, dry-run does not connect

After merge: tag v0.6.0 so GitHub Actions publishes the release.

Replace one remote regular file with an optional hash precondition,
owner-only backup, and atomic rename. Privileged paths stage over SFTP
and install through a sudo stdin script. Reload stays outside the
command. This is the v0.6.0 release.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jamiesun
jamiesun merged commit 05144c9 into main Aug 16, 2026
7 checks passed
@jamiesun
jamiesun deleted the feat/guarded-file-apply branch August 16, 2026 03:29
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