Repository navigation
Deploy config: Caddy site block, systemd timer and publish script - #73
Merged
Merged
Conversation
… timer site/deploy/ holds the Caddy site block (automatic TLS, www redirect, /install.sh 302 to the latest installer), a pull-only publish script that swaps a copy of site/ into the web root atomically and records the commit, systemd units that run it every five minutes, and the install README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A commit that only touched site/deploy/ left the deploy checkout on the old commit, so reinstalling the units or Caddy block from it would have installed stale files. The checkout now always follows main; only the copy and swap is skipped. The web root's copies live in copies/ rather than releases/, which already means GitHub releases here, and the tests keep the machine's git config out and check the adapted Caddy routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deploy config for thirdshift.app, in
site/deploy/(never served). Installing it on the server stays a human step (#70).The deployed commit is served at
/commit.txt, for the Prompts and skills page's label (#68).Evidence
tests/site_deploy.rsruns against a local bare origin and a temp web root (Linux only, because ofmv -T):cargo test --test site_deploy→ 7 failed (nosite/deploy/)After: 7 passed; full
cargo test,cargo fmt --check,cargo clippy -- -D warningsgreenThe Caddy and systemd checks skip with a message when the tool is missing, so on CI only
systemd-analyzeruns. Local runs:I also ran the block live on local ports:
Merge Danger
Door: two-way
Nothing runs until a human installs it (#70). The binary and the crate are untouched:
site/stays out of the package, and the packaging test now asserts it.Blast Radius: none
Once installed, the timer runs whatever
publish.shis onmainasthirdshift-site. It can write only to/var/lib/thirdshift-siteand/srv/thirdshift.app.Unaddressed findings
Standards
/var/lib/thirdshift-site/checkoutand/srv/thirdshift.apprepeat across the service, Caddyfile and README. Static config files can't share a variable. Parameterising them would add indirection to files a human copies by hand.Spec
caddy validate. Adding Caddy to CI is out of scope for this issue. I verified locally (see Evidence), andsystemd-analyzedoes run on the Ubuntu runner.respond /deploy/* 404, pruning old copies, SELinux notes in the README, and service hardening. Each is small and serves a stated goal: the deploy directory is never served, the disk doesn't fill, and the service runs unprivileged.flockis util-linux, and the spec limits the script to git and coreutils. systemd already stops the timer overlapping itself.mv -Tfails ifcurrentis a real directory.currentis only ever created as a symlink by this script. A fresh install never has a directory there./commit.txt. The path is documented in the script and the deploy README, which is where Prompts and skills page, generated from the source #68 will look.Closes #63
🤖 Generated with Claude Code