The kit sets games up on the shared hall host

setup-droplet.sh prepares a host several games share and adds this game
to it: its own Caddy site file, port, user, trees and access log, with
/etc/caddy/Caddyfile only importing sites/*.caddy. setup-server.sh is
folded in. A slug that is already a system group stops the setup with a
clear word. new-game.sh now stamps .py files too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
Eric Wagoner
2026-09-25 16:49:03 -04:00
co-authored by Claude Opus 5.5
parent cd9d14ec35
commit bc5f93c2fa
7 changed files with 131 additions and 118 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# Stamp out a new game from the template.
# ./new-game.sh <slug> "<Name>" [port] [domain]
# e.g. ./new-game.sh tumbleweed "Tumbleweed" 8789 tumbleweed.kestrelsnest.social
# Ports so far: wizwar 8787, waving-hands 8788. Each game is its own droplet,
# so the port only has to be unique on your machine for running two locally.
# e.g. ./new-game.sh tumbleweed "Tumbleweed" 8791 tumbleweed.kestrelsnest.social
# Ports so far: wizwar 8787, waving-hands 8788, hnefatafl 8789, dip 8790. The
# games share one host (deploy/README.md), so a new game takes the next free port.
set -euo pipefail
SLUG="${1:?usage: new-game.sh <slug> \"<Name>\" [port] [domain]}"
NAME="${2:?usage: new-game.sh <slug> \"<Name>\" [port] [domain]}"
@@ -20,7 +20,7 @@ find "$DEST" -depth -name '*__SLUG__*' | while read -r f; do
mv "$f" "$(dirname "$f")/$(basename "$f" | sed "s/__SLUG__/$SLUG/g")"
done
# Then the placeholders inside. __IP__ and the Sentry ids stay until they exist.
find "$DEST" -type f \( -name '*.ts' -o -name '*.svelte' -o -name '*.json' -o -name '*.md' -o -name '*.sh' -o -name '*.tmpl' -o -name '*.service' -o -name '*.cron' -o -name '*.html' -o -name '*.css' -o -name '.gitignore' \) -print0 \
find "$DEST" -type f \( -name '*.ts' -o -name '*.svelte' -o -name '*.json' -o -name '*.md' -o -name '*.sh' -o -name '*.py' -o -name '*.tmpl' -o -name '*.service' -o -name '*.cron' -o -name '*.html' -o -name '*.css' -o -name '.gitignore' \) -print0 \
| xargs -0 sed -i '' -e "s/__SLUG__/$SLUG/g" -e "s/__NAME__/$NAME/g" -e "s/__PORT__/$PORT/g" -e "s/__DOMAIN__/$DOMAIN/g"
cp "$KIT/CONVENTIONS.md" "$DEST/docs-conventions.md" 2>/dev/null || true
mkdir -p "$DEST/docs" && mv "$DEST/docs-conventions.md" "$DEST/docs/conventions.md"
@@ -42,8 +42,8 @@ Next:
Add static/og.png (1200 by 630) and static/apple-touch-icon.png (180 by 180):
app.html already points at them, and the static fallback serves the hall's
HTML for a missing file, so a share card without the image breaks quietly.
3. Create the droplet (deploy/README.md), then replace __IP__ everywhere:
grep -rl __IP__ . --exclude-dir=node_modules | xargs sed -i '' 's/__IP__/<ip>/g'
3. Add the game to the shared host (deploy/README.md), after replacing __IP__ with its address:
grep -rl __IP__ . --exclude-dir=node_modules | xargs sed -i '' 's/__IP__/159.203.115.252/g'
4. Create a Sentry project (the Sentry MCP can) and put its DSN and project id
in deploy/$SLUG.service and deploy/sentry-slack-alert.sh.
5. deploy/deploy.sh <ip>