Skip to content

Architecture

SharpMUSH separates the game engine from the process that holds players’ connections and from the worker that formats output. That lets routine engine and renderer updates keep telnet and browser connections open. The supplied production setup is a single machine with an embedded LMDB database and NATS; it is not built to spread one game across several machines.

SharpMUSH deployment services, protocols, state, and backup flow

How the pieces connect:

  • Browsers reach the portal, its REST API and its live updates over HTTPS, and the terminal over wss://…/ws, through Caddy or a Cloudflare Tunnel. The proxy sends ordinary web traffic to the game server (SharpMUSH.Server, port 8080) and /ws to the connection server (SharpMUSH.SocketServer, port 4202).
  • MU* clients connect straight to the connection server on telnet port 4201 (plaintext), or 4203 over TLS when the TLS overlay is enabled.
  • The connection server formats output through the rendering worker (SharpMUSH.RenderingWorker) over HTTP/2 on a private Unix socket.
  • The connection server and game server exchange commands and output through NATS.
  • The game server alone reads and writes the world (LMDB) and the uploaded wiki files, and makes the point-in-time world copies that backups read.
  • The restic backup container reads the finished copies, the wiki files, the key ring and the installed plugins, and sends encrypted snapshots off the machine.
  • Prometheus scrapes the private /metrics endpoints of the game and connection servers, and Compose health checks watch every service.
ComponentOwnsWhen it restartsHow to tell it is healthyWhat protects it
Caddy or Cloudflare TunnelThe public web entrance and HTTPSThe portal, its live updates and the browser terminal pause; telnet is separateThe proxy or tunnel’s status, plus loading the portal and /ws over HTTPSConfiguration and secrets management; it holds no world data
SharpMUSH.ServerThe engine, REST API, live updates, the portal’s files, login and session decisions, the world, wiki filesThe portal and its live updates restart; the connection server keeps players connected and catches up when the engine returnsReadiness and health checks, logs, server metrics, a test login and commandPoint-in-time world copies, the wiki files, deployment settings
SharpMUSH.SocketServerEvery public telnet and browser terminal connectionEvery connection closes; a logged-in browser can recover within a limited window, telnet reconnectsService health, connecting over telnet and /ws, connection metricsNATS’s stored data can bring back a browser session, never the closed connection itself
SharpMUSH.RenderingWorkerFormatting output for each kind of client, behind a private Unix socketConnections stay open; output waits and retries until it is backThe connection server checks its health over the Unix socketImage and settings only; it holds no game data
NATS with JetStreamMessages between the parts of the game, and what browsers need to recoverCoordination and recovery suffer; the world itself is untouchedNATS health, logs, storage limits and its volumeIts persistent volume, if browser recovery across restarts matters to you
LMDB worldThe game world, in the game server’s app-data volumeThe game server cannot run without it@storage, storage metrics, server readiness, database errors in the logsOnly finished @backup copies; never a read of the live file
Key ring and installed pluginsThe keys that decrypt stored secrets, and plugins installed from packages, in app-data beside the worldThe game server starts without them, but stored secrets can’t be read and installed plugins are missing@secret, the portal’s Plugins tabA restic snapshot of both folders
Wiki filesUploaded files, kept outside the worldPages can still exist while their files are missingFetching files in the portalA direct restic snapshot of the folder
Restic and off-machine storageEncrypted recovery copies away from the machineNo effect until you need to recoverThe nightly result, repository checks, restore drillsHolds the chosen world copies, wiki files, plugins and settings, not running processes