feat(monitoring): add stats counters API and public status page

Add GET /api/stats exposing cumulative counters (feeds created/deleted,
emails received/rejected, recent date-times) plus live values (active
feeds, active WebSub subscriptions). Counters persist in a stats:counters
KV singleton and are incremented at the email-processing chokepoint and
feed create/delete paths. Replace the / → /admin redirect with a public
status page rendering these figures with a link to the admin.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-23 09:50:51 +02:00
parent f4d5edda0e
commit b534ce5bf8
15 changed files with 484 additions and 6 deletions
+3 -2
View File
@@ -8,10 +8,11 @@ const designSystem = [variablesCss, layoutCss, componentsCss, utilitiesCss].join
type LayoutProps = {
title: string;
label?: string;
children: import("hono/jsx").Child;
};
export const Layout = ({ title, children }: LayoutProps) => {
export const Layout = ({ title, label = "admin", children }: LayoutProps) => {
return (
<html>
<head>
@@ -38,7 +39,7 @@ export const Layout = ({ title, children }: LayoutProps) => {
<a href="https://kill-the.news/" class="site-header-logo" target="_blank" rel="noopener">
kill-the-news
</a>
<span class="site-header-label">admin</span>
<span class="site-header-label">{label}</span>
</header>
{children}
<footer class="site-footer">