Skip to content

Make website deploy.sh work on stock macOS (openrsync has no --chown) - #126

Merged
tonibergholm merged 3 commits into
mainfrom
issue-99-openrsync-chown
Jul 10, 2026
Merged

tonibergholm merged 3 commits into
mainfrom
issue-99-openrsync-chown

Conversation

@tonibergholm

Copy link
Copy Markdown
Member

Closes #99.

Why

macOS ships openrsync, which rejects GNU rsync's --chown, so website/scripts/deploy.sh died right after the build step on any machine without Homebrew rsync (hit during the 2026-07-09 suite-site deploy; the manual recovery sequence is what this PR scripts).

What

deploy.sh now capability-probes the local rsync (rsync --help | grep -- --chown):

  • GNU rsync ≥ 3.1.0: invocation is byte-identical to before — --chown passed, no extra SSH command (acceptance criterion 3).
  • openrsync (or GNU < 3.1.0): the flag is dropped and ownership is fixed server-side with sudo chown -R www-data:www-data after the sync, before the existing nginx test + reload — the exact sequence verified manually on the 2026-07-09 deploy. The fallback announces itself so the operator knows why an extra SSH command ran.

The conditional flag is a scalar with ${CHOWN_FLAG:+"$CHOWN_FLAG"} rather than an array because macOS /bin/bash 3.2 errors on empty-array expansion under set -u.

Also adds the design spec and implementation plan under docs/superpowers/ as execution records.

Verification

  • bash -n and shellcheck clean.
  • Probe verified against real binaries: stock /usr/bin/rsync (openrsync) → fallback branch; the ${CHOWN_FLAG:+…} expansion checked under actual bash 3.2 with set -u (empty → zero args, set → one arg).
  • Final whole-branch review: no Critical/Important findings.

Not yet claimed: acceptance criteria 1–2 (real deploy to "✓ Deployed." with only openrsync on PATH; served files owned www-data:www-data) require a production deploy — operator follow-up after merge.

https://claude.ai/code/session_01V9TtRvFnDS4eGkcxZhnyf9

macOS ships openrsync, which lacks GNU rsync's --chown, so the deploy
died after the build step (issue #99). Probe the local rsync for
--chown support: with GNU rsync the invocation is unchanged; with
openrsync the flag is dropped and ownership is fixed server-side with
sudo chown -R www-data:www-data before the nginx reload — the sequence
verified manually on the 2026-07-09 deploy.
Copilot AI review requested due to automatic review settings July 10, 2026 09:19
@tonibergholm
tonibergholm merged commit 1256894 into main Jul 10, 2026
10 of 11 checks passed
@tonibergholm
tonibergholm deleted the issue-99-openrsync-chown branch July 10, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the website deployment script to work on stock macOS where the bundled rsync is openrsync (which lacks GNU rsync’s --chown), while keeping behavior unchanged on systems that have a compatible GNU rsync. It also adds written execution records (spec + plan) for the change.

Changes:

  • Add an rsync --help capability probe for --chown and conditionally include the flag.
  • For non-supporting rsync implementations (openrsync / older GNU), run a server-side sudo chown -R www-data:www-data after sync and before nginx reload.
  • Add design and implementation-plan docs under docs/superpowers/.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
website/scripts/deploy.sh Capability-probes local rsync for --chown and adds a server-side ownership-fix fallback.
docs/superpowers/specs/2026-07-10-issue-99-openrsync-chown-design.md Documents the rationale and chosen approach for openrsync compatibility.
docs/superpowers/plans/2026-07-10-issue-99-openrsync-chown.md Step-by-step implementation plan and verification steps for the change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/scripts/deploy.sh
Comment on lines +55 to +58
if [[ -z "$CHOWN_FLAG" ]]; then
echo "→ Local rsync lacks --chown (openrsync); fixing ownership server-side..."
ssh -p "$SSH_PORT" "$SSH_TARGET" "sudo chown -R www-data:www-data $DOCROOT"
fi
Comment on lines +126 to +128
**Files:**
- Modify: `/Users/tonibergholm/Developer/github/git.agentic/.wolf/buglog.json` (bug-123 `fix` field — NOTE: main checkout path; `.wolf/` is untracked/gitignored, so this is not a worktree write and is not committed)

Comment on lines +136 to +140
python3 - <<'EOF'
import json
p = '/Users/tonibergholm/Developer/github/git.agentic/.wolf/buglog.json'
data = json.load(open(p))
bugs = data if isinstance(data, list) else data.get('bugs', data)
Comment on lines +160 to +162
```bash
printf '| %s | Implemented issue #99 fix: conditional --chown in deploy.sh | website/scripts/deploy.sh | committed on issue-99-openrsync-chown | ~2k |\n' "$(date +%H:%M)" >> /Users/tonibergholm/Developer/github/git.agentic/.wolf/memory.md
```
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.

Make website deploy.sh work on stock macOS (openrsync has no --chown)

2 participants