fix(ci): send rsync to "." not "/", which rrsync 3.4.4 rejects #2
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/rrsync-destination"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The deploy now builds successfully and reaches the publish step, where it dies:
Why
/is wrongrrsync confines this login to
/var/www/kvartsiand rewrites paths under it, so the destination is already relative to the web root — which makes/look like the way to name that root. It isn't.validated_arg()strips leading slashes before prepending the root:The empty path then
realpaths back to the root itself, which fails the containment test because it does not start withdir + "/". Hence the error, with the empty string visible in the diagnostic..is exempt from that check by name (arg != '.'guards the whole block) and is the form rrsync's own documentation uses.On the earlier verification
I checked this before and it passed, because I tested the wrong version.
nixpkgs#rrsyncfrom a local registry resolves to 3.4.1, which accepts/; nas runs 3.4.4 from this flake, which does not. Rebuilt with--inputs-fromto match the host and tested all three forms against it::/:.--deletestill removes stale files:The comment on that line now explains why
.and not/, since a bare relative destination is otherwise a thing someone would "fix" back. It also answers the question raised on #1 about this line.The deploy reached the publish step and died there: rrsync error: unsafe arg: / ['', '/var/www/kvartsi'] rsync error: error in rsync protocol data stream (code 12) rrsync confines this login to /var/www/kvartsi and rewrites paths under it, so the destination is already relative to the web root and "/" reads like the way to name that root. It is not. validated_arg() lstrips leading slashes *before* prepending the root, so "/" becomes "" and the prepend branch never fires; the empty path then realpaths back to the root itself, which fails the containment test because it does not start with dir + "/". "." is exempt from that check by name, and is the form rrsync's own docs use. This was verified against the wrong version first. rrsync 3.4.1 accepts "/", and that is what `nixpkgs#rrsync` resolves to from a local registry; nas runs 3.4.4 from this flake, which does not. Rebuilt with --inputs-from and both forms tested against it: "/" reproduces the failure exactly, "." succeeds and --delete still removes files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>