Skip to content

Add restart.sh for routine server changes - #13

Merged
tschm merged 1 commit into
mainfrom
feat/server-restart-script
Aug 30, 2026
Merged

Add restart.sh for routine server changes#13
tschm merged 1 commit into
mainfrom
feat/server-restart-script

Conversation

@tschm

@tschm tschm commented Aug 30, 2026

Copy link
Copy Markdown
Member

Adds scripts/restart.sh — the everyday counterpart to bootstrap-server.sh.

Why

bootstrap-server.sh is written for a host that has never run the stack: it checks DNS, the public IP and the GitHub token before starting anything. Re-running all that to pick up one new repo in JQ_REPOS is slow, and it reports on questions that were settled the first time.

What it does differently

  • Both compose files, always. Naming only docker-compose.server.yml leaves Caddy unmanaged, and a later down would strand it holding 80 and 443.
  • up -d --build, not --force-recreate. Compose recreates only the containers whose image or environment actually differs, so a .env edit restarts the collector while Grafana and Caddy keep serving.
  • Waits for the first GitHub refresh before the preflight. The collector serves :9109 only once that refresh finishes (~17s for a fleet of nine), and check-public-safe.sh reads that endpoint to see which repos are exported. Run it too early and it reports collector exported no repos — a failure that reads as a safety problem but is a race. This was hit on a live server today.
  • Still runs the preflight. The setting that changes most often is the fleet, and the fleet is what can turn a safe board unsafe.

It deliberately does not git pull — a script that silently moves you to new code is not a restart. The README documents git pull && ./scripts/restart.sh for that.

Testing

Syntax-checked with bash -n; not exercised against a live server, as this checkout has no host. The exec -T collector probe is the part most likely to need adjustment in practice.

🤖 Generated with Claude Code

bootstrap-server.sh is written for a host that has never run the stack: it
checks DNS, the public IP and the token before starting anything. Those
answer "can this host ever work", and re-running them to pick up one new
repo in JQ_REPOS is both slow and misleading about what is being verified.

restart.sh is the everyday path. It brings the stack up with both compose
files - naming only the server file would leave Caddy unmanaged, holding 80
and 443 - and re-runs the preflight at the end, because the setting that
changes most often is the fleet, and the fleet is what can turn a safe board
unsafe.

It also waits for the collector to start serving :9109 before the preflight
runs. The collector publishes metrics only once its first GitHub refresh has
finished, which takes ~17s for a fleet of nine, so bootstrap-server.sh can
report "collector exported no repos" on a stack that is merely still
starting - a failure that reads as a safety problem but is a race.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tschm
tschm merged commit 7b0fbb8 into main Aug 30, 2026
4 checks passed
@tschm
tschm deleted the feat/server-restart-script branch August 30, 2026 09:11
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