The public copy
Serve a copy of the tracked public files, not a working checkout. A checkout has untracked files and records the copy leaves out.
node tools/online.js --check # nothing that ships needs a file that stays behind
node tools/online.js --export ../esolang-site
cd ../esolang-site
node tools/cli/shib.js build # the pages, built once
node museum/server/server.js 4173 example.org --online
The server
node museum/server/server.js <port> [names...] [--online]
- It listens on loopback only, and answers only to its own loopback names and the names after the port. A request with any other
Hostgets403. - A name with a path, such as
example.org/esolang, has the site under that path. --onlineleaves out whatonline.jsonkeeps internal, writes nothing, fetches nothing, and limits each visitor to 60 runs a minute. Training runs in each visitor's browser.- In a container,
LISTEN=0.0.0.0listens on every address andTRUST_PROXY=1reads the visitor fromX-Forwarded-For.
It serves every page of esolang.dev, from the front page to these Docs. The routes a script can call are on the HTTP API page, and the files worth downloading on Data.
Before a release, the smoke test makes a fresh public copy, starts it with --online and checks it route by route.
node tools/smoke.js
A proxy
Caddy gets the certificate and passes everything on.
example.org {
reverse_proxy 127.0.0.1:4173 {
transport http {
response_header_timeout 90s
}
}
}
The server sets its own security headers, compresses its answers and streams /events, so the proxy needs nothing else. A run may take up to a minute, hence the timeout.
A container
Read-only, no capabilities, the copy mounted from the host.
services:
esolang:
image: node:24-alpine
restart: unless-stopped
user: "1000:1000"
working_dir: /app
command: ["node", "museum/server/server.js", "4173", "example.org", "--online"]
environment:
LISTEN: 0.0.0.0
TRUST_PROXY: "1"
volumes:
- ./app:/app:ro
- ./scratch:/app/museum/server/scratch
read_only: true
tmpfs: [/tmp]
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
mem_limit: 384m
./app is the public copy with its pages built; ./scratch is the one folder the server may keep a cache in. It idles at about 80 MB.