rust-web-server 18.10.1

Single-binary web server and reverse proxy: automatic HTTPS (Let's Encrypt), HTTP/1.1, HTTP/2 and HTTP/3, load balancing, auth and rate limiting, configured in one TOML file. Also a Rust library: routing, middleware, MCP server, ORM, background jobs. No hyper, no Tower; HTTP/2 and HTTP/3 framing via h2 and quinn.
Documentation
/* rws admin: the rws8.tech theme (site/src/theme.css) plus this app's
   layout. Spacing, type, radii and motion come from the theme's tokens. */
@import "../../site/src/theme.css";

/* Latin subsets only, inlined into this stylesheet by the build. */
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("@fontsource-variable/geist/files/geist-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("@fontsource-variable/geist-mono/files/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --ok: light-dark(#3f6b2a, #9fcf86);
  --warn: light-dark(#8a5a00, #f0c060);
  --bad: var(--md-sys-color-error);
  --muted: var(--md-sys-color-on-surface-variant);
  --line: var(--md-sys-color-outline-variant);
  --panel: var(--md-sys-color-surface-container-low);
}

body { min-height: 100dvh; }

/* ── shell ─────────────────────────────────────────────────────────────── */
/* lit-material-adaptive-navigation shows a drawer from 840px, a rail from
   600px and a bottom bar below that; the grid gives it the matching column. */
.shell { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
.top {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-200);
  padding: var(--space-100) var(--space-300);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--space-75); font-weight: 600; font-size: var(--text-base); line-height: var(--leading-base); }
.brand-mark { width: 24px; height: 24px; border-radius: var(--md-sys-shape-corner-small); background: var(--rws-orange); }
.top .spacer { flex: 1; }
.top .meta { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); font-family: var(--font-mono); }
.nav { border-right: 1px solid var(--line); padding: var(--space-200) var(--space-75); }
main { padding: var(--space-400) var(--space-300) var(--space-700); max-width: 1120px; width: 100%; box-sizing: border-box; min-width: 0; }
main:focus { outline: none; }
@media (min-width: 840px) { .nav { width: 240px; box-sizing: border-box; } }

@media (max-width: 599.98px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .nav { grid-row: 3; position: sticky; bottom: 0; z-index: 5; padding: 0; border: 0; }
  main { grid-row: 2; padding: var(--space-300) var(--space-200) var(--space-400); }
  .top { padding: var(--space-100) var(--space-200); }
  .top .meta { display: none; }
}

[slot="icon"] { width: 24px; height: 24px; }
.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; fill: currentColor; }

/* ── page furniture ────────────────────────────────────────────────────── */
h1 { font-size: var(--text-2xl); line-height: var(--leading-2xl); margin-bottom: var(--space-75); }
h2 { font-size: var(--text-lg); line-height: var(--leading-lg); }
.lede { color: var(--muted); margin: 0 0 var(--space-400); max-width: 680px; }
.section { margin-top: var(--space-500); }
.section > h2 { margin-bottom: var(--space-200); }
.grid { display: grid; gap: var(--space-200); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; align-items: center; gap: var(--space-200); flex-wrap: wrap; }

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--md-sys-shape-corner-large);
  padding: var(--space-200);
}
.tile .label { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); }
.tile .value { font-size: var(--text-2xl); line-height: var(--leading-2xl); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: var(--space-50); overflow-wrap: anywhere; }
.tile .value.mono { font-family: var(--font-mono); font-size: var(--text-base); line-height: var(--leading-base); font-weight: 500; }


.error-text { color: var(--bad); font-size: var(--text-sm); line-height: var(--leading-sm); margin: var(--space-75) 0 0; }

/* ── login ─────────────────────────────────────────────────────────────── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-300) var(--space-200); box-sizing: border-box; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { display: flex; align-items: center; gap: var(--space-75); }
.login-card form { display: grid; gap: var(--space-200); margin-top: var(--space-300); }
.login-card p { color: var(--muted); margin: 0; }


lit-material-stat.mono::part(value) { font-family: var(--font-mono); font-size: var(--text-base); line-height: var(--leading-base); font-weight: 500; }
lit-material-stat { --lit-material-stat-positive-color: var(--ok); }
lit-material-status { --lit-material-status-ok-color: var(--ok); --lit-material-status-warning-color: var(--warn); }
lit-material-log-viewer { --lit-material-log-viewer-height: 60dvh; --lit-material-log-viewer-font: var(--font-mono); }
lit-material-table { --lit-material-table-mono-font: var(--font-mono); }
lit-material-line-chart, lit-material-sparkline {
  --lit-material-chart-series-1: var(--md-sys-color-primary);
}

lit-material-text-field { min-width: 0; }
.filter { width: 100%; max-width: 420px; margin-bottom: var(--space-200); }
lit-material-alert { display: block; margin-bottom: var(--space-300); }
.grid > lit-material-stat { height: 100%; }