From b1eaa88e6eadeaf50a3eeaa844181c783822eab3 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Sat, 14 Feb 2026 12:35:15 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(stats-bot):=20add=20Redis?= =?UTF-8?q?=20and=20Matrix-SSO-Link=20environment=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.5 --- services/matrix-stats-bot/CLAUDE.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/services/matrix-stats-bot/CLAUDE.md b/services/matrix-stats-bot/CLAUDE.md index 504b06646..39830873d 100644 --- a/services/matrix-stats-bot/CLAUDE.md +++ b/services/matrix-stats-bot/CLAUDE.md @@ -22,13 +22,15 @@ pnpm type-check # TypeScript check ## Matrix Commands -### Personal Stats (requires login) +### Personal Stats (auto-login via Matrix-SSO-Link) | Command | Description | |---------|-------------| | `!stats` | Your personal statistics across all ManaCore apps | | `!status` | Account status and credit balance | +**Note:** If you logged in via another Matrix bot or via OIDC, you're automatically authenticated. + ### Global Analytics (Umami) | Command | Description | @@ -66,7 +68,7 @@ pnpm type-check # TypeScript check ## Environment Variables ```env -PORT=3312 +PORT=4012 TZ=Europe/Berlin # Matrix @@ -74,18 +76,33 @@ MATRIX_HOMESERVER_URL=http://localhost:8008 MATRIX_ACCESS_TOKEN=syt_xxx MATRIX_REPORT_ROOM_ID=!roomid:mana.how +# Redis (for session storage & Matrix-SSO-Link) +REDIS_HOST=redis +REDIS_PASSWORD=xxx + +# Mana Core Auth (for Matrix-SSO-Link auto-login) +MANA_CORE_AUTH_URL=http://mana-auth:3001 +MANA_CORE_SERVICE_KEY=xxx + # Umami UMAMI_API_URL=http://umami:3000 UMAMI_USERNAME=admin UMAMI_PASSWORD=xxx # Prometheus / VictoriaMetrics -PROMETHEUS_URL=http://victoriametrics:8428 +PROMETHEUS_URL=http://victoriametrics:9090 # Database (for user counts) DATABASE_URL=postgresql://... ``` +## Authentication + +The bot uses **Matrix-SSO-Link** for automatic authentication: +- Sessions are stored in Redis (shared across all bots) +- If a user logged in via another bot or OIDC, they're automatically authenticated +- Manual login via `!login email password` creates a persistent link + ## Health Check ```bash