Handle AstroJS rsync - #49
Conversation
There was a problem hiding this comment.
Adds an optional rsync_host override on Project that lets AstroJS (and other non-static-tier) deployments target a specific pinned smbCloud host. rsync_transport now resolves the host via new resolve_rsync_host, which validates the host against known_hosts::is_pinned_host before use. is_pinned_host is a new helper listing the two pinned hosts; strip_project is updated to include the new field.
Reviewers should confirm the pinned-host list in is_pinned_host stays in sync with for_host, and that unpinned runner defaults are still accepted.
Automated review by siGit Code · commit e22401e
There was a problem hiding this comment.
Pull request overview
Adds support for an explicit, server-approved rsync host override on a per-project basis, while ensuring the CLI only connects to hosts with pinned SSH keys (to preserve the deploy security model).
Changes:
- Added
rsync_hostto the sharedProjectmodel so config/server data can carry an override host. - Updated CLI rsync transport construction to resolve an override host (or fall back to the runner default) and reject unpinned hosts.
- Added an allow-list helper in
smbcloud-deployand adjusted Vite SPA deploy docs to reflect the configurable host.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/smbcloud-model/src/project.rs | Adds rsync_host to the project data model for carrying an approved override. |
| crates/smbcloud-deploy/src/known_hosts.rs | Introduces is_pinned_host to support validating host overrides against pinned keys. |
| crates/cli/src/cloud-deploy/process_migrate.rs | Updates project stripping to include the new field. |
| crates/cli/src/cloud-deploy/process_deploy_vite_spa.rs | Updates documentation/comments to reflect “configured host” rsync behavior. |
| crates/cli/src/cloud-deploy/mod.rs | Implements resolve_rsync_host and uses it when building RsyncTransport. |
Suppressed comments (1)
crates/cli/src/cloud-deploy/mod.rs:81
resolve_rsync_hosthas tests for override and rejection, but it doesn’t test the default (no configured host) path. Adding a test forNonehelps prevent regressions when the runner-to-host mapping changes.
#[test]
fn unpinned_rsync_host_is_rejected() {
let result = resolve_rsync_host(Some("example.com"), &Runner::NodeJs);
assert!(result.is_err());
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
This PR adds an optional rsync_host field to Project that lets AstroJS (and future) deployments override the default runner-derived rsync host. A new resolve_rsync_host helper validates the override against a hard-coded allowlist (is_pinned_host) before accepting it. The for_host function already does a similar lookup; is_pinned_host duplicates that list as a separate matches! pattern. strip_project is updated to include the new field, and comment copy in the Vite SPA deploy path is refreshed.
Automated review by siGit Code Review · commit 901b182
Related Issue
Fixes #
Description
Type of Change
How Has This Been Tested?
cargo test --all-featuressmb <command>)Checklist
cargo check --workspacepassescargo clippy --workspace --tests -- -D warningspassescargo fmt --all -- --checkpassesunwrap()orexpect()calls in production codemod.rsfiles introducedCargo.tomland inherited with{ workspace = true }Release Notes
AstroJSapp deployment.