karma-web: online status, user counts, join links, rising/chart/most-debated/milestones/reasons, filter+sort, expandable history, OG tags, JSON API
All checks were successful
ci / check (push) Successful in 46s

This commit is contained in:
Jean Chevronnet 2026-07-30 01:27:39 +00:00
parent 26496b5147
commit 6af92c1217
No known key found for this signature in database
GPG key ID: 439666D63A9477E4
7 changed files with 714 additions and 101 deletions

View file

@ -79,17 +79,24 @@ lists them at runtime and `help <command>` describes one.
## Karma web page
The live karma board is published at **<https://karma.devtronic.pro>** — a hero
with live stats, a top-3 podium, a ranked ledger with per-thing trend
sparklines, a recent-activity feed, and a top-givers board. Each network's board
shows where its karma comes from — server, channels, and each channel's IRC
topic (e.g. `#argentina`). A second binary, `karma-web`, reads the per-network
`karma.*.json` totals, the append-only `karma.*.events.jsonl` history the bot
writes on every bump, and a `karma.*.meta.json` source sidecar (server +
channels + topics, which the bot refreshes as it joins and as topics change),
and renders one self-contained HTML page (no CSS/JS/font dependencies,
all IRC-supplied text HTML-escaped). A systemd timer regenerates it every minute
and nginx serves it over TLS.
The live karma board is published at **<https://karma.devtronic.pro>**. It has a
hero with live stats, a top-3 podium, a ranked ledger (filter + sort, click a
row to expand its full history), per-thing trend sparklines, a "rising this
week" strip, a karma-over-time chart, a recent-activity feed, top givers, most
debated, and a milestones timeline. Each network's board shows where its karma
comes from — an online/offline dot, server, joinable channel links, live user
counts, and each channel's IRC topic (URLs linkified). The page carries Open
Graph tags for rich link previews, and the same data is exposed as JSON at
`/karma.json`.
A second binary, `karma-web`, reads the per-network `karma.*.json` totals, the
append-only `karma.*.events.jsonl` history the bot writes on every bump, and a
`karma.*.meta.json` source sidecar (server, webchat base, a liveness heartbeat,
and per-channel topic + user count, which the bot refreshes as it joins, on
topic/NAMES changes, and on each server PING). It renders one self-contained
HTML page (no CSS/JS/font dependencies, all IRC-supplied text HTML-escaped) plus
`karma.json`. A systemd timer regenerates them every minute and nginx serves
over TLS.
```sh
cargo build --release --bin karma-web
@ -127,7 +134,9 @@ RUSTBOT_CONFIG=/etc/rustbot.conf cargo run
Config file keys: `server`, `port`, `tls`, `nick`, `user`, `realname`,
`channels` (comma/space-separated), `prefix`, `verbose` (wire logging, default
on), `password`, `sasl_user`, `sasl_pass`, `name` (a network's log label), and
`locale` (`en`/`es`/`fr`, default `en`), and `karma_url` (public web board —
`locale` (`en`/`es`/`fr`, default `en`), `webchat` (per-network webchat base
for the board's channel "join" links, e.g. `https://web.libera.chat/`), and
`karma_url` (public web board —
enables the `karmaweb` command and a link on the `karma`/`karmabottom` top
lists; empty disables both). Whole-line `#`/`;` comments only —
inline comments would clash with channel `#`s.