Skip to content

fix(deploy): run site deploys as tfmc through psdeploy - #243

Merged
ryanbarlow97 merged 2 commits into
mainfrom
site-deploy-service-account
Oct 16, 2026
Merged

ryanbarlow97 merged 2 commits into
mainfrom
site-deploy-service-account

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #241.

Why

The Deploy workflow logged in as ryan, and site-deploy reached tfmc's checkouts through ryan's bindfs views in ~/work. Through those views git wrote new files as 660, hence the chmod loop, and deploys depended on one person's home folder and login key. Found in the 2026-10-16 host permissions audit.

What changes

  • deploy.yml: SSH_USER: psdeploy. The same DEPLOY_SSH_KEY moves to psdeploy's authorized_keys, pinned to the new scripts/site-deploy-ssh.sh (/usr/local/sbin/site-deploy-ssh), which runs sudo -u tfmc /usr/local/sbin/site-deploy. The preview key keeps its own forced command, so it still cannot deploy a site.
  • site-deploy.sh: installed root-owned in /usr/local/sbin and run as tfmc. It works on /home/tfmc/... directly, calls ps-compose without sudo, sets umask 022, logs and locks under /home/tfmc, and drops the chmod loop.

Host steps (before merging)

Fix root-owned files in both checkouts (chown -R tfmc) and make tracked files world-readable once. Install both scripts and add sudoers psdeploy → (tfmc) site-deploy and tfmc → (root) tfmc-patchnotes-update. Add the deploy key to psdeploy with the new forced command, keeping ryan's line until a deploy through psdeploy passes.

Docs: TF-Minecraft/Docs#281

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: daf3ed72-917a-4c3e-9dc0-8d72a7371112
📥 Commits

Reviewing files that changed from the base of the PR and between fc3db1f and 20f0720.

📒 Files selected for processing: 4
  • .github/scripts/server_ssh.sh
  • .github/workflows/deploy.yml
  • scripts/site-deploy-ssh.sh
  • scripts/site-deploy.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

ryanbarlow97 and others added 2 commits October 16, 2026 15:36
The Deploy workflow logged in as ryan and site-deploy worked through
ryan's bindfs views of tfmc's checkouts, which made git write files as
660 (hence the chmod loop) and tied deploys to one person's account.

- The deploy key logs in as psdeploy, pinned to site-deploy-ssh, which
  runs a root-owned /usr/local/sbin/site-deploy as tfmc through sudo.
- site-deploy works on /home/tfmc directly, calls ps-compose without
  sudo, sets umask 022 and drops the chmod loop.
- The preview key keeps its own forced command, so it still cannot
  deploy a site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanbarlow97

Copy link
Copy Markdown
Contributor Author

Reviewed by Muse (muse-wonder-full): VERDICT: OK; its small suggestions are applied. CodeRabbit was rate-limited. The host is prepared: the scripts are installed from this head, the sudoers rules are in place, the deploy key is on psdeploy, and a simulated forced command as psdeploy returned 'already deployed'. The frontend test failure was a flaky ProfileCustomItems test and passed on rerun.

@ryanbarlow97
ryanbarlow97 merged commit 48f4ec8 into main Oct 16, 2026
7 of 8 checks passed
@ryanbarlow97
ryanbarlow97 deleted the site-deploy-service-account branch October 16, 2026 15:51

This branch was successfully deployed

1 active deployment
preview — 20f07204 Deployed Oct 16, 2026 by ryanbarlow97 via deploy #495
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