6.1 KiB
6.1 KiB
| id | title | priority | status | scope | owner | updated_at | evidence | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| p1-15 | Deploy dev guide to https://mc.next.black.local | p1 | done | game1 | tourguide | 2026-04-17 |
|
Status — 2026-04-17 (tourguide, closed)
All acceptance bullets verifiable:
- ✓ DNS resolves —
dscacheutil -q host -a name mc.next.black.localon plum returns10.0.0.11via the existing wildcard entry*.next.black.local → 10.0.0.11. No new DNS record needed; the wildcard covers it. - ✓ TLS cert covers
*.next.black.local—black.local:/bigdisk/nginx/ssl/_wildcard.black.local+1.pemre-issued viamkcertwith the original SAN list plus*.next.black.local. Backup kept at*.pem.bak-20260417. Verified from plum:openssl s_client -connect mc.next.black.local:443presents the cert and browsers that trust the mkcert CA (e.g. black-network laptops that ranmkcert -install) validate it. Plum itself has no mkcert root installed, so chromium / curl require-k— tracked separately as a per-contributor trust-store setup, not part of this objective. - ✓ nginx vhost —
black.local:/bigdisk/nginx/nginx.confhas a new server block "Staging: mc.next.black.local" that: (a) returns301from HTTP to HTTPS; (b) terminates TLS with the extended wildcard cert; (c) applies the sameallow 10.0.0.0/24; allow 10.9.0.0/24; allow 127.0.0.1; deny all;LAN/VPN gate used by siblingnext.*.black.localvhosts; (d) serves from/var/www/next/mc/with a Vite-SPAtry_files $uri $uri/ /index.htmlfallback so react-router handles unknown paths client-side; (e) long-caches/assets/*(content-hashed) and no-caches/index.htmlso a fresh deploy is picked up on the next visit; (f) passes through/__sim-cache/for future p2-21 baked frames.docker exec host-nginx nginx -tvalidates before the reload. Gotcha (2026-04-17): the outerhttp {}block must containinclude /etc/nginx/mime.types; default_type application/octet-stream;. Without it nginx serves every file astext/plain, which browsers refuse to execute as ES modules — the guide renders blank with "disallowed MIME type" console errors on every/assets/*.js.cmd_deploy_guide_next's step-5 probe now assertsContent-Type: application/javascripton a hashed JS asset to catch this regression at deploy time. - ✓ Bind mount —
/bigdisk/nginx/docker-compose.ymladds/bigdisk/next/:/var/www/next/:ro. Container recreated viadocker compose up -d;docker exec host-nginx ls /var/www/next/mc/confirms the mount. - ✓ Static root populated —
/bigdisk/next/mc/owned bylilith:lilith, seeded with a placeholder then overwritten by the first rsync. - ✓ Dev-bundle build flag —
VITE_DEV_GUIDE=1 pnpm buildin the guide package renders every<EpisodeGate min={N}>subtree by widening theEpisodeProvidervalue to999via a top-levelACTIVE_EPISODEconstant inpublic/games/age-of-dwarves/guide/src/App.tsx. Default build (no env var) stays atepisode=1. (No subtrees are currently gated in the shipping code — p2-09's scope-narrow pass deleted the Game 2/3 pages — but the flag is the scope-aware escape hatch for future gated content.) - ✓
./run deploy:guide:nextcommand —scripts/run/deploy.sh::cmd_deploy_guide_next. Four-stage pipeline: WASM prerequisite check →VITE_DEV_GUIDE=1 pnpm build→sshreachability probe →rsync -az --delete dist/ → $NEXT_DEPLOY_HOST:$NEXT_DEPLOY_PATH→curl https://mc.next.black.localprobe expectingHTTP 200. HonorsNEXT_DEPLOY_HOST/NEXT_DEPLOY_PATHenv overrides; defaults tolilith@black.local:/bigdisk/next/mc/. Registered in./run's usage under "Deploy". - ✓ End-to-end deploy succeeded — first run produced 12 MB
dist/(67 chunks, largestindex-*.jsat 2.8 MB / 766 KB gzip), rsync landed,curl -sk https://mc.next.black.local/returns the real bundle shell (not the placeholder;<title>Magic Civilization — Player Guide</title>, font preconnects, route-lazy chunks). Six representative routes checked —/,/map/resources,/military/promotions,/climate/ecosystem/populations,/dev/sprites,/this-does-not-exist— all 200 (the last via the SPA fallback intoindex.html→ client-side<Navigate to="/" replace />).
Non-goals (tracked separately)
- CI auto-deploy on push to main — follow-up p1-17. Needs apricot
Forgejo runner's deploy SSH key added to
lilith@black.local's authorized_keys + a.forgejo/workflows/deploy-next.ymlthat runs./run deploy:guide:next. - Pre-computed sim-cache frames baked into
dist/__sim-cache/— p2-21. The vhost already proxies/__sim-cache/throughtry_filesso static-baked frames "just work" when p2-21 lands. Until then,/climate/simulationon the deploy uses the client-WASM worker path (confirmed passing in the plum e2e suite). - Plum's browser trusts the mkcert LAN CA — out of scope; each contributor installs the CA locally. The deploy works; trust is a per-workstation setup.
- Production (non-
.next.) deploy — future scope; this objective targets thenext(staging / dev-preview) tier only.
Operational runbook
Manual deploy from plum:
./run deploy:guide:next
Viewing: https://mc.next.black.local (LAN / VPN only; accept the
mkcert-signed cert or install the mkcert root via
mkcert -CAROOT from any host with mkcert installed).
Infra changes (rare) live on black.local and are edited directly:
/bigdisk/nginx/nginx.conf— vhost config. Validate withdocker exec host-nginx nginx -t, thendocker exec host-nginx nginx -s reload./bigdisk/nginx/docker-compose.yml— bind mounts. Changes requiredocker compose up -d(brief 1-2 s downtime)./bigdisk/nginx/ssl/_wildcard.black.local+1.pem— re-issue withmkcertwhen adding a new subdomain pattern.