Repository navigation
fix(host): host scripts in the repo; previews as tfmc; init in compose - #248
Conversation
Copied unchanged from /usr/local/sbin and /etc/systemd/system on the TF server, so the next commit shows what changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Preview containers run as tfmc (1001) with init, so tfmc owns every file in a preview folder: the Alpine container that deleted root-owned files and the chmod of copied data are gone. - The www and Dev compose files run both services with init, which reaps the renderer's Chromium processes (they piled up as zombies). - Each host script now says where it is installed and who runs it. - portainer is reserved as a preview name, matching the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed by Muse (muse-wonder-full) over two rounds; round 2 returned VERDICT: OK. CodeRabbit was rate-limited. The host install and the one-off previews chown follow. |
Why
The preview, compose and image-prune scripts and their timers lived only on the TF server, edited in place. Previews ran as container root, so
ps-previewneeded an Alpine container to delete root-owned preview files and a chmod to share copied data. The site containers had no init, so the renderer's Chromium processes were left as zombies. Items 7, 8 and 13 from the 2026-10-16 host clean-up.What changes
ps-preview,ps-preview-ssh,ps-compose,ps-image-prune, the reap and prune units and timers, and the router's Caddyfile, copied unchanged, so the second commit shows the real diff. The copy includes another session's 15:04 change today, which reservedportainer.1001:1001(tfmc) and both preview containers underinit: true;remove_diris a plainrm -rf, and the copied data is no longer chmodded.docker-compose.ymlanddocker-compose.staging.ymlrun both services withinit: true.preview_slug.pyreservesportainerto match the host.Tested on the host
This branch's preview was taken down with the old script, then brought up, down and up again with a test copy of the new one (
/usr/local/sbin/ps-preview-test). The backend runs as1001:1001and the frontend asappuser, both withinit=true. Every file in the preview folder is tfmc's,downremoved the folder with no helper container,/and/api/maps/accessibleanswer 200, and the log shows no permission errors.After merge
One-off transition: in the same step as installing
ps-preview, runsudo chown -R tfmc:tfmc /home/tfmc/previews, so previews made by the old script (with root-owned folders) can still be stopped and reaped, and their kept data stays writable by the new tfmc backend. Install the scripts from the merge commit (commands in Docs) and removeps-preview-test. The composeinitchange rebuilds both sites on their next deploy (docker-compose*changed).Docs: TF-Minecraft/Docs#284
🤖 Generated with Claude Code