Information: Minecraft Server: I started working on my old Minecraft server called Terona. Join our discord if you want :D Join

How this site is built

kori.my is a small Rust program that serves every page from memory, with a private dashboard that publishes changes to it.

KORI NetworkChecked

On this page

kori.my is two Rust programs built from one repository. kori-site is the public site. kori-dash is a private dashboard where the content is edited. There is no Node.js and no client-side framework. This page explains how they work, so the site can be maintained and checked.

Why a Rust server#

Two designs were compared: a Rust program that generates static files for a separate web server, and a Rust server that serves the pages itself. They cost the same per request, because in both cases a request ends in sending bytes that were prepared in advance. The server design won because it needs one runtime component instead of two, and because search can run on the server, which makes it work without JavaScript.

Where the content comes from#

The public site builds its pages from one of two sources:

  • The built-in content. The Markdown docs, updates and pages in content/, the assets in assets/ and the project data in src/data.rs are compiled into the binary. This is the seed, used when nothing has been published yet.
  • A published snapshot. When KORI_PUBLISHED points to a folder, the site serves the snapshot the dashboard last wrote there instead. It checks the folder every two seconds and swaps in the new version without a restart. If a new snapshot is broken, the site logs it and keeps serving the previous one.

Startup#

When kori-site starts, it:

  1. loads the published snapshot, or the built-in content when there is none;
  2. renders every page through Askama templates, which are type-checked at compile time;
  3. compresses each response once with gzip and computes its ETag;
  4. builds the search index;
  5. starts listening.

After that, nothing is rendered or parsed for normal page requests. Every page is served from memory.

Requests#

PathHandled by
Any page or assetA lookup in an in-memory table, then the prepared bytes
/search/?q=Rendered per request from the in-memory index
/healthzA fixed ok response for the platform's health check
Old addressesPermanent redirects to their new location
Anything elseThe 404 page with a real 404 status

Only GET and HEAD are accepted. Responses carry a strict Content Security Policy, HSTS and other security headers. Hashed CSS and JavaScript are cached for a year; pages are cached for five minutes and revalidated with ETags.

The dashboard#

kori-dash is the private editing side. It is not part of the public site and only accepts connections from allowed networks.

  • Content is edited in the browser and stored in a SQLite database, together with the published revisions.
  • Publish writes the snapshot into KORI_PUBLISHED, where the public site picks it up within two seconds.
  • Project data from GitHub, such as the repository description, the latest release and contributors, is synced on a schedule, every 15 minutes by default. When a check finds changes, the dashboard publishes them automatically.
  • It can make encrypted backups of its database on a schedule.

Markdown#

  • Documentation lives in content/docs/<section>/<page>.md with a short front matter block. See Write a docs page.
  • Updates live in content/updates/<date>-<name>.md.

Markdown is rendered with pulldown-cmark. Raw HTML in Markdown is shown as text rather than rendered, and javascript: links are dropped, so content cannot inject markup or script.

Deployment#

The production image is built in two stages. The first compiles the binary with Cargo. The second contains only that binary on a minimal base image, runs as a non-root user with a read-only filesystem and no extra capabilities, and exposes one port. Coolify routes traffic to it and uses the binary's own --healthcheck mode, so the image needs no shell or curl.

kori-site reads these environment variables:

VariableDefaultWhat it does
PORT8080Port to listen on
BIND0.0.0.0Address to listen on
KORI_PUBLISHEDnot setFolder with the dashboard's published snapshot. Without it, the built-in content is served.

To build and run the public site locally:

bash
cargo run --release --bin kori-site

Then open http://localhost:8080. kori-site --check builds the site and exits, which CI uses as a smoke test.

Source: src/main.rs, src/publish.rs, src/bin/kori-dash.rs, src/dash/server.rs and build.rs in this repository, checked 2 November 2026.

Your likes

Only what this browser did. Your data on this device