No description
  • Elixir 97.1%
  • Dockerfile 1.9%
  • Shell 1%
Find a file
Paragrimm 45b455dbe7 docs: usage walkthrough and Godot authoring-addon guide
Add docs/USAGE.md (install → start → configure via admin API → auth → connect,
end to end) and docs/AUTHORING_ADDON.md (building the Godot EditorPlugin that
authors the manifest and configures the server via the admin API). Refresh the
README status to reflect all phases (0–7) complete and add a documentation
index.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 11:52:53 +02:00
config Phase 7: Hardening & extension hooks (Presence, rate limiting, filter stage, serializer seam) 2026-06-08 11:29:21 +02:00
docs docs: usage walkthrough and Godot authoring-addon guide 2026-06-08 11:52:53 +02:00
lib Phase 7: Hardening & extension hooks (Presence, rate limiting, filter stage, serializer seam) 2026-06-08 11:29:21 +02:00
priv Phase 6: State & persistence (StateStore ETS hot-cache + Postgres flush) 2026-06-08 09:52:40 +02:00
test Phase 7: Hardening & extension hooks (Presence, rate limiting, filter stage, serializer seam) 2026-06-08 11:29:21 +02:00
.containerignore Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
.dockerignore Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
.env.example Phase 7: Hardening & extension hooks (Presence, rate limiting, filter stage, serializer seam) 2026-06-08 11:29:21 +02:00
.formatter.exs Phase 0: Projekt-Setup & Toolchain 2026-06-08 01:32:07 +02:00
.gitignore Phase 0: Projekt-Setup & Toolchain 2026-06-08 01:32:07 +02:00
AGENTS.md Phase 0: Projekt-Setup & Toolchain 2026-06-08 01:32:07 +02:00
compose.yaml Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
Containerfile Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
docker-entrypoint.sh Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
mix.exs Phase 1: Fundament mit wss/TLS, Postgres, Container & Health-Endpoint 2026-06-08 01:47:56 +02:00
mix.lock Phase 0: Projekt-Setup & Toolchain 2026-06-08 01:32:07 +02:00
README.md docs: usage walkthrough and Godot authoring-addon guide 2026-06-08 11:52:53 +02:00

WsServer

A generic, schema-driven realtime WebSocket server in Elixir/Phoenix for Godot clients. The server is configured per game through a JSON manifest (schemas, channels, routing, persistence) rather than being reprogrammed; it speaks the Phoenix Channels protocol over wss and runs as a container. There is no GUI.

Documentation

Status

All phases of the kickoff plan are complete

  • Phase 0 — project & toolchain setup
  • Phase 1 — foundation: HTTPS/wss from the start, Postgres, container & compose, .env config, health endpoint
  • Phase 2 — config layer: JSON manifest loaded into ETS via the config registry, admin-secretguarded push/reload API — see docs/MANIFEST.md
  • Phase 3 — schema registry & validation: ex_json_schema payload validation against named schemas, x-secret field handling (Argon2 hashing / redaction, never echoed)
  • Phase 4 — generic manifest-driven channel & routing (broadcast_all / broadcast_others / direct / filtered)
  • Phase 5 — player auth: accounts (Argon2), Phoenix.Token, connect-time token verification, requires_auth enforcement
  • Phase 6 — state & persistence: ETS hot-cache + throttled Postgres flush, join-time state sync, crash recovery
  • Phase 7 — hardening & extension hooks: Phoenix.Presence, per-connection rate limiting, pluggable routing filter stage, binary-serializer seam

TLS / wss from the start

The server exposes an HTTPS-only listener (no plain HTTP) — Godot clients connect exclusively over wss and the health check is served over https too. Listener port and certificate paths are configurable via the HTTPS_PORT, TLS_CERT_PATH and TLS_KEY_PATH environment variables, so the self-signed dev certificate can be swapped for a real one in production without a rebuild.

Local development

Prerequisites: Elixir/OTP and a reachable PostgreSQL (e.g. the db service from compose.yaml, or a local container).

cp .env.example .env          # then edit secrets (SECRET_KEY_BASE, ADMIN_SECRET)
mix setup                     # deps, dev TLS cert (mix cert.setup), DB create/migrate
mix phx.server                # serves https/wss on https://localhost:4001
curl -k https://localhost:4001/health

mix setup generates a self-signed development certificate via mix cert.setup (a wrapper around mix phx.gen.cert). Certificates and .env are git-ignored.

Running with containers

cp .env.example .env          # set SECRET_KEY_BASE and ADMIN_SECRET
podman compose up --build     # or: docker compose up --build

The entrypoint provisions a self-signed certificate (if none is mounted), runs database migrations, then starts the release. See docs/DEPLOYMENT.md.

Tests & quality gates

A running PostgreSQL is required. Each phase must pass all gates:

mix format --check-formatted
mix credo --strict
mix test                      # includes wss end-to-end tests via slipstream
# or all at once:
mix precommit

End-to-end tests use slipstream to drive simulated Godot clients over real wss connections (WsServer.TestClient).