Zum Hauptinhalt springen

Zurück zum Devlog

Montag, 02. Februar 2026

Feature

40 Commits

15 min Lesezeit

Cross-Domain SSO, mana-media Integration & Matrix Bots Page

Cross-Subdomain SSO für alle .mana.how Apps, mana-media NutriPhi Integration, neue Bots-Übersichtsseite in Manalink, und mana-llm Production Deployment

T

Till Schneider

Autor

Produktiver Tag mit 40 Commits und Fokus auf nahtlose Authentifizierung über alle Apps:

  • Cross-Domain SSO - Single Sign-On für alle .mana.how Subdomains
  • mana-media Integration - NutriPhi mit zentraler Medienverarbeitung
  • Matrix Bots Page - Übersicht aller 19 Bots in Manalink
  • mana-llm Production - LLM Gateway auf Mac Mini deployed
  • i18n für Matrix Bots - Mehrsprachige Bot-Antworten
  • Calendar UX - Tasks versteckt, automatischer Scroll zu Mittag

Cross-Domain SSO

Single Sign-On über alle ManaCore Web Apps.

Architektur

┌─────────────────────────────────────────────────────────────────┐
│                    Cross-Domain SSO Flow                         │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  User besucht         Session Check          Bereits eingeloggt  │
│  calendar.mana.how ─────────────────────> auth.mana.how         │
│         │                                        │               │
│         │              Cookie gefunden           │               │
│         │<──────────────────────────────────────│               │
│         │              auf .mana.how             │               │
│         │                                        │               │
│         ▼                                                        │
│  Automatisch eingeloggt                                          │
│  (kein Login-Redirect)                                           │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘
// mana-core-auth: Cookie Settings
{
  name: 'manacore_session',
  domain: '.mana.how',  // Shared across subdomains
  secure: true,
  sameSite: 'lax',
  httpOnly: true,
  path: '/',
}

Betroffene Apps

AppURLSSO Status
Calendarcalendar.mana.how
Chatchat.mana.how
Clockclock.mana.how
Contactscontacts.mana.how
NutriPhinutriphi.mana.how
Picturepicture.mana.how
Plantaplanta.mana.how
Questionsquestions.mana.how
SkillTreeskilltree.mana.how
Storagestorage.mana.how
Todotodo.mana.how
Zitarezitare.mana.how
Manalinkmanalink.mana.how
Playgroundplayground.mana.how

get-session Endpoint

Neuer Endpoint für Session-Validierung:

// GET /api/auth/get-session
// Returns: { user, session } or null

const response = await fetch('https://auth.mana.how/api/auth/get-session', {
	credentials: 'include', // Wichtig für Cross-Domain Cookies
});
const { user } = await response.json();

mana-media Integration

Zentrale Medienverarbeitung mit NutriPhi als erster Integration.

NutriPhi Integration

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   NutriPhi      │────>│   mana-media    │────>│    MinIO        │
│   (Upload)      │     │   (Process)     │     │   (Storage)     │
└─────────────────┘     └─────────────────┘     └─────────────────┘
         │                      │
         │                      │ EXIF Extraction
         │                      │ Thumbnail Generation
         │                      │ Resize/Compress
         │                      ▼
         │              ┌─────────────────┐
         │              │   PostgreSQL    │
         │              │   (Metadata)    │
         │              └─────────────────┘

Änderungen

ÄnderungBeschreibung
userId TypeUUID → TEXT (für Matrix User IDs)
Body Size Limit10mb → 50mb (Bilder)
DockerfileVereinfacht auf Single Build Stage

API

// POST /api/v1/media/upload
const formData = new FormData();
formData.append('file', imageFile);
formData.append('context', 'meal');

const response = await fetch('https://media.mana.how/api/v1/media/upload', {
	method: 'POST',
	body: formData,
	headers: { Authorization: `Bearer ${token}` },
});

Matrix Bots Page

Neue Übersichtsseite mit allen 19 Matrix Bots in Manalink.

UI

┌─────────────────────────────────────────────────────────────────┐
│  Manalink - Bots                                                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │ 🤖 mana-mana-bot                                            ││
│  │ Der zentrale AI-Assistent mit Voice Support                 ││
│  │ Commands: !help, !model, Voice Messages                     ││
│  └─────────────────────────────────────────────────────────────┘│
│                                                                  │
│  ┌─────────────────────────────────────────────────────────────┐│
│  │ ✅ matrix-todo-bot                                          ││
│  │ Task-Management mit natürlicher Sprache                     ││
│  │ Commands: todo, liste, erledigt                             ││
│  └─────────────────────────────────────────────────────────────┘│
│                                                                  │
│  ... (17 weitere Bots)                                          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Bot-Liste

BotKategorieBeschreibung
mana-mana-botAIZentraler AI-Assistent
matrix-todo-botProductivityTask-Management
matrix-calendar-botProductivityTermine & Erinnerungen
matrix-clock-botUtilityTimer & Weltzeit
matrix-contacts-botProductivityKontaktverwaltung
matrix-nutriphi-botHealthErnährungs-Tracking
matrix-picture-botAIBildgenerierung
matrix-zitare-botInspirationTägliche Zitate
matrix-skilltree-botGamificationSkill-Tracking
matrix-planta-botLifestylePflanzenpflege
matrix-manadeck-botLearningLernkarten
matrix-presi-botProductivityPräsentationen
matrix-questions-botResearchQ&A Management
matrix-chat-botAIAI-Chat
matrix-ollama-botAILLM Direct Access
matrix-tts-botMediaText-to-Speech
matrix-stt-botMediaSpeech-to-Text
matrix-storage-botUtilityDateiverwaltung
matrix-voice-botAIVoice-to-Voice

Layout

Single Column Layout für bessere Lesbarkeit auf allen Geräten.


mana-llm Production

LLM Gateway auf Mac Mini deployed.

Docker Compose

mana-llm:
  image: ghcr.io/manacore/mana-llm:latest
  ports:
    - '3025:3025'
  environment:
    - OLLAMA_URL=http://host.docker.internal:11434
    - OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
  restart: unless-stopped

SSE Fix

Double-Data-Prefix Problem behoben:

# Vorher (falsch)
yield f"data: data: {json.dumps(chunk)}\n\n"

# Nachher (korrekt)
yield f"data: {json.dumps(chunk)}\n\n"

i18n für Matrix Bots

Mehrsprachige Bot-Antworten basierend auf User-Präferenzen.

Unterstützte Sprachen

SpracheCode
Deutschde
Englishen

Implementierung

// bot-services/i18n/index.ts
export function t(key: string, locale: string = 'de'): string {
	return translations[locale]?.[key] || translations['de'][key] || key;
}

// Verwendung
const response = t('todo.created', userLocale);
// DE: "Aufgabe erstellt!"
// EN: "Task created!"

Direct Message Fallback

Bots antworten jetzt auch in DMs statt nur in Rooms:

if (event.sender !== this.client.getUserId()) {
	// Auch Direct Messages beantworten
	await this.handleCommand(event);
}

Cross-Bot SSO via Redis

Single Sign-On über verschiedene Matrix Bots.

Architektur

┌─────────────────┐     ┌─────────────────┐
│  matrix-todo-   │     │  matrix-cal-    │
│     bot         │     │  endar-bot      │
│                 │     │                 │
└────────┬────────┘     └────────┬────────┘
         │                       │
         │      Redis Sessions   │
         │           │           │
         │           ▼           │
         │    ┌─────────────┐    │
         └───>│    Redis    │<───┘
              │   Sessions  │
              └─────────────┘

Session Sharing

// SessionService mit Redis
class SessionService {
	async getSession(userId: string): Promise<BotSession | null> {
		const session = await this.redis.get(`bot:session:${userId}`);
		return session ? JSON.parse(session) : null;
	}

	async setSession(userId: string, session: BotSession): Promise<void> {
		await this.redis.set(`bot:session:${userId}`, JSON.stringify(session), 'EX', 86400);
	}
}

Calendar UX Verbesserungen

Verbesserte User Experience für die Calendar App.

Änderungen

ÄnderungBeschreibung
Tasks verstecktStandardmäßig ausgeblendet
Auto-ScrollScrollt zu 12:00 beim Laden
PillNavigationSidebar Mode entfernt

Auto-Scroll

onMount(() => {
	// Scroll to midday (12:00)
	const hourElement = document.querySelector('[data-hour="12"]');
	hourElement?.scrollIntoView({ block: 'center' });
});

Automatische Verknüpfung von ManaCore-Accounts mit Matrix-Users bei OIDC Login.

Flow

1. User loggt sich via OIDC in Matrix ein
2. mana-core-auth erhält OIDC Callback
3. Matrix User ID wird mit ManaCore Account verknüpft
4. Alle Bots erkennen den User automatisch

Database Schema

ALTER TABLE users ADD COLUMN matrix_user_id TEXT;

-- Index für schnelle Lookups
CREATE INDEX idx_users_matrix_user_id ON users(matrix_user_id);

Bugfixes

FixBeschreibung
mana-llm SSEDouble data prefix
contacts-webRuntime URLs statt Build-time
shared-uicalculateFadeOpacity Export
nutriphi DockerfileFehlende shared packages
SessionServiceAsync Methods
JWT IssuerAligned mit Better Auth

Zusammenfassung

BereichCommitsHighlights
Cross-Domain SSO514 Apps mit SSO
mana-media4NutriPhi Integration
Matrix Bots Page219 Bots Übersicht
mana-llm2Production + SSE Fix
i18n Bots2DE/EN Support
Cross-Bot SSO3Redis Sessions
Calendar UX3Tasks, Auto-Scroll
Auth Fixes8JWT, Sessions, OIDC
Bugfixes11Docker, UI, Types

Nächste Schritte

  1. Photos App mit mana-media Integration
  2. Admin Dashboard für User-Übersicht
  3. STT/TTS APIs extern verfügbar machen
  4. Matrix E2EE aktivieren

Tags

#sso #cross-domain #mana-media #matrix #bots #mana-llm #production #nutriphi #calendar #ux