dingoandClaude Sonnet 5 5df2f1b681 Merge control portal work from RPGTheory/aeternalis-portal
RPGTheory/aeternalis-portal had diverged from this repo (the git/CI/CD
copy) with an in-progress control portal feature that was never synced
back here, so none of it had gone through CI or been deployed:

- New site/game/control routing split: index.html becomes a world
  directory landing page (site.ts), game.html is the renamed former
  index.html (main.ts), control.html is a new admin panel
  (control.ts, portal-shared.ts, portal.css).
- Server: new internal/store/portal.go (character/world registry,
  command queue, admin grants) and internal/transport/control.go
  (portal API routes), plus a new internal/gitops package that lets
  the portal provision new worlds via a GitOps repo commit.
- game.World gains BornAt/DiedAt/DeathReason and an operator Control()
  path (close/open admissions, awaken boss, end world, per-character
  rename/heal/unstuck/retire); death no longer reuses the same
  character id on rejoin, matching the "new life" permadeath model in
  Plan.md rather than the old bypass-prevention test's expectations.
- deploy/: new control-egress network policy and portal/control
  values (admin role, GitOps repo/branch/values file/CIDRs).
- New e2e coverage: tests/portal.spec.ts, tools/capture-world.mjs.

Verified this repo's own independent commits (800ms movement-staleness
window, 20s boss-attack poll, SRS/TLS deploy values, ubuntu-22.04
runner pin, DOCKER_HOST fix) were already present in the portal copy
before merging, so nothing here regresses them. `tsc --noEmit`, the
vite client build, and the protocol contract check all pass; no go.mod
changes. Could not run `go build`/`go test` locally (no Go toolchain
on PATH, Docker daemon not running) — every new/changed Go symbol was
manually cross-referenced and resolves, but this should still be built
and tested in CI before merging to master.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 11:08:44 -04:00

Aeternalis

A playable browser survival RPG foundation: an authoritative Go world server, Three.js terrain and GLB models, persistent one-life characters, and weekly worlds.

Status: local prototype, not a production MMO or a verified 2,000-player server. The review, architecture, deployment instructions, and remaining work are in docs/ARCHITECTURE.md, docs/DEPLOYMENT.md, and docs/ROADMAP.md.

Run locally

Requirements: Node.js 24 and Go 1.26+ (tested with Go 1.27.1). On Windows without Go, powershell -File tools/bootstrap-go.ps1 downloads a checksum-verified, project-local toolchain.

npm ci
npm run build
node tools/dev-server.mjs

Open http://127.0.0.1:18080. Guest authentication is available only in development, on an explicit loopback listen address. Production fails closed without PostgreSQL and an HTTPS OIDC configuration.

The delivered Windows build can also be started without installing Go:

powershell -File tools/start-local.ps1 -UseExisting

That command starts a hidden background process and prints its PID. Stop your specific local process with Stop-Process -Id <printed-pid>. Local state lives in .local/aeternalis.db; restarting preserves characters, world age, and death. Deleting this development database is an explicit reset, not part of startup.

Play

  • Move with WASD/arrows, click the terrain, or use touch direction controls.
  • Click resources/enemies to approach and gather/attack. The toolbar also chooses the nearest suitable target. E gathers, Space attacks, I opens inventory.
  • Gather wood, ore, and herbs. Craft a spear or bandages in inventory.
  • The Harbinger appears after seven days. In loopback development, Display settings includes Awaken Harbinger for testing the event immediately.
  • During the boss event the safe world radius shrinks toward the center. The boundary deals damage; complete collapse kills remaining characters, including offline and daily-capped characters. Killing the boss freezes survivor eligibility.
  • Survivors sign into a different configured world with the same identity, then choose Continue as .... An atomic passage redemption preserves identity, inventory, skills, kills, and daily play-time usage.

PvP, damage-priority corpse looting, body-part damage, full skills/stats, leaderboards, and an admin center are not implemented. Corpse looting currently has no priority lock because PvP is not enabled.

Multiple local worlds

Start independent worlds against the same SQLite database. Every process needs a unique world ID and port. A completed world ID must never be recycled for a new season. Seeds and balance are stored when a world is first created.

$env:WORLD_DIRECTORY = '[{"id":"world-001","url":"http://127.0.0.1:18080"},{"id":"world-002","url":"http://127.0.0.1:18081"}]'
powershell -File tools/start-local.ps1 -WorldId world-001 -Port 18080
powershell -File tools/start-local.ps1 -WorldId world-002 -Port 18081 -Seed 829312

Loopback cookies are shared across these two ports, so the same local guest can redeem a passage. Production worlds use OIDC issuer + subject for stable identity and separate secure host cookies. Never use dev identity for public servers.

Validate

npm run test:contracts
npm run check
npm run build
# In server/:
go test ./...
go vet ./...
# At the repository root:
npx playwright install chromium
npm run test:e2e
helm lint deploy/chart
helm template aeternalis deploy/chart

When Go is local, use .tools/go/bin/go.exe from the root or ../.tools/go/bin/go.exe from server/. Go tests use a temporary SQLite database. Set TEST_DATABASE_URL to an expendable PostgreSQL test database to run the same storage suite on PostgreSQL; CI provides one. Linux CI also runs go test -race. The browser suite starts and stops its own server on port 18089 with a fresh DB. On Windows, PLAYWRIGHT_CHANNEL=msedge can use installed Edge without downloading Chromium. Screenshots and traces are written to test-results/.

For client hot reload, run the server with PUBLIC_URL=http://127.0.0.1:5175, then run npm run dev and open port 5175. Origin checking intentionally rejects requests from other origins.

Layout

Path Responsibility
planning/VISION.md Original user vision; new boss rule in IMPLEMENTATION-NOTES.md
server/internal/game Terrain, authoritative simulation, lifecycle
server/internal/store World ownership, snapshots, sessions, atomic passages
server/internal/transport HTTP, OIDC, origin checks, WebSocket intent validation
schemas/protocol.json Generated Go/TypeScript wire contracts
server/content/balance.yaml Validated balance and recipe data
client/ Full-screen browser game and mobile controls
tools/create-models.py Original temporary Blender models
deploy/chart/ Five independent world deployments, services, TLS ingress
.gitea/workflows/build.yaml Tests, Harbor image publication, optional GitOps promotion
S
Description
No description provided
Readme
1.4 MiB