Commit graph

1171 commits

Author SHA1 Message Date
Till-JS
7d409465b6 fix(docker): add backend URLs to auth service for GDPR data aggregation
Configure mana-auth with internal Docker network URLs to query
project backends for user data (Chat, Todo, Calendar, Contacts,
Picture, Presi).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:33:33 +01:00
Till-JS
d5e18c9c27 🔧 fix(mac-mini): update health checks and disable missing services
- Disable api-gateway and skilltree-web (no working images/Dockerfiles)
- Fix mana-search Dockerfile healthcheck port and endpoint
- Update health-check.sh to skip disabled services
- Fix search service health endpoint (/api/v1/health)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:28:55 +01:00
Till-JS
177e4eea88 fix(docker): add missing shared packages to manacore-web Dockerfile
Add shared-vite-config and shared-stores packages that were missing
from the Docker build context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:26:45 +01:00
Till-JS
6548d83e18 🐛 fix(mana-search): use pnpm deploy to fix symlink issue in Docker
pnpm creates symlinks in node_modules that point to ../../node_modules/.pnpm/
These symlinks break when only the service node_modules are copied.

Using pnpm deploy creates a standalone version with all dependencies
copied (no symlinks), which works correctly in Docker.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:24:55 +01:00
Till-JS
bc8cd98a27 fix(auth): correct MeController route prefix
Remove duplicate api/v1 prefix - NestJS already adds it globally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:22:58 +01:00
Till-JS
3e3700338b 🔧 fix(docker): build mana-search and skilltree-web locally
- mana-search: GHCR image is broken (missing node_modules)
- skilltree-web: GHCR image doesn't exist
- api-gateway: disabled (no image, no Dockerfile)

All three now build locally on Mac Mini instead of pulling from GHCR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:22:42 +01:00
Till-JS
9881e84ee3 feat(auth): add GDPR self-service endpoints for user data
Add /api/v1/me/data endpoints for users to view, export, and delete
their own data without admin privileges (GDPR compliance).

Backend:
- New MeModule with MeController and MeService
- GET /api/v1/me/data - view own data summary
- GET /api/v1/me/data/export - download as JSON
- DELETE /api/v1/me/data - delete all own data

Frontend:
- New /settings/my-data page with full data overview
- Export button for JSON download
- DeleteConfirmationModal with email verification
- Link from settings page to my-data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:20:08 +01:00
Till-JS
759b227355 🔧 fix(mac-mini): correct user path in LaunchD plist
Server user is 'mana', not 'till'.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 13:15:06 +01:00
Till-JS
2fe7f842c6 🔧 fix(mac-mini): add container recovery and update health check ports
- Add ensure-containers-running.sh to detect and auto-start stuck containers
- Add LaunchD plist for automatic container health checks every 5 minutes
- Update health-check.sh with correct ports (3031/5011 for todo, etc.)
- Update deploy.sh health checks to match docker-compose.macmini.yml
- Fix container name references (mana-infra-postgres instead of manacore-postgres)

This prevents 502 errors when containers get stuck in "Created" status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 12:51:49 +01:00
Till-JS
03c9267a69 🐛 fix(admin): use PostgresJsDatabase instead of NodePgDatabase
All backends use postgres-js driver, not node-postgres. The admin
services incorrectly imported from drizzle-orm/node-postgres which
caused runtime errors: "Cannot find module 'pg'"

Fixed in: chat, todo, calendar, contacts, picture, zitare
2026-02-12 02:34:00 +01:00
Till-JS
ba3d2a121a 🔧 chore(docker): build backends locally on Mac Mini
Switch 5 backends from pulling ghcr.io images to building locally:
- chat-backend
- todo-backend
- calendar-backend
- clock-backend
- contacts-backend

This ensures Dockerfiles with shared-drizzle-config are used directly.
2026-02-12 02:23:52 +01:00
Till-JS
10502b5627 fix(photos): re-enable mana-media dependency
mana-media Dockerfile is now fixed, so photos-backend can depend on it again.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 02:21:39 +01:00
Till-JS
22a6a6496c fix(mana-media): fix Dockerfile pnpm symlinks for production
Keep same directory structure in production stage so pnpm symlinks
resolve correctly. Copy the .pnpm store and app's node_modules
separately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 02:19:19 +01:00
Till-JS
8b6ff0c679 feat(auth): add API key management for STT/TTS services
- Add api_keys schema in mana-core-auth with SHA-256 hashing
- Create NestJS module with CRUD endpoints and validation
- Add external auth module to STT/TTS for sk_live_ key validation
- Create web UI page at /api-keys for key management
- Support rate limiting per key with configurable limits
- Cache validation results for 5 minutes to reduce auth service load

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 02:12:05 +01:00
Till-JS
552dc10f25 🔧 fix(docker): add --ignore-scripts to pnpm install in all backend Dockerfiles
The root package.json postinstall script runs scripts/generate-env.mjs
which doesn't exist in the Docker build context. Using --ignore-scripts
skips this postinstall step since env generation isn't needed in Docker.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 02:10:45 +01:00
Till-JS
3353ceb962 feat(photos): add Cloudflare Tunnel routes for photos app
- photos.mana.how → localhost:5019 (web frontend)
- photos-api.mana.how → localhost:3039 (backend API)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 02:06:56 +01:00
Till-JS
fc2ee7ab76 🐛 fix(photos-backend): correct path to main.js
NestJS outputs to dist/src/ not dist/

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:59:02 +01:00
Till-JS
aa56ec844b 🔧 fix(photos): temporarily disable mana-media dependency
mana-media Dockerfile has a pre-existing bug with pnpm symlinks
that needs to be fixed separately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:58:21 +01:00
Till-JS
4452d371fa 🐛 fix(mana-media): correct path to main.js in Dockerfile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:55:48 +01:00
Till-JS
741c5bc00c 🐛 fix(photos): use valid Svelte 5 event syntax
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:49:11 +01:00
Till-JS
16a7532253 🔧 chore: update lockfile after removing nestjs-integration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:45:26 +01:00
Till-JS
898f5d2112 🔧 chore(stt,tts): update launchd plists to load .env files
Source .env file before starting uvicorn to enable API key auth
and other environment-based configuration.

Removes hardcoded PORT values in favor of .env configuration.
2026-02-12 01:44:46 +01:00
Till-JS
36563f4459 🔧 fix(photos): remove unused nestjs-integration dependency
Photos doesn't use credits, so ManaCoreModule is not needed.
Use shared-nestjs-auth directly instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 01:43:44 +01:00
Till-JS
5ce4e42c20 🚀 feat(photos): add Docker deployment configuration
- Add Dockerfile for photos-backend (port 3039)
- Add Dockerfile for photos-web (port 5019)
- Add docker-entrypoint.sh for database migrations
- Add health endpoint for photos-web
- Add photos services to docker-compose.macmini.yml
- Update CORS_ORIGINS for mana-auth and mana-media
- Update CLAUDE.md with production URLs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:21:19 +01:00
Till-JS
91f175c8f6 🐛 fix(deps): add missing shared-stores dependency to web apps
storage-web and manacore-web both use shared-stores but it wasn't declared
as a dependency in their package.json files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:19:38 +01:00
Till-JS
4130823281 🔧 fix(docker): add shared-stores and shared-types to storage-web
shared-stores is used for navigation stores, shared-types is needed by
shared-auth at build time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:09:40 +01:00
Till-JS
8ddc4eb907 🔧 fix(docker): build shared-vite-config in storage-web Dockerfile
The vite config package exports from dist/ and needs to be built before
the web app can be built.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:05:07 +01:00
Till-JS
aab304fc95 🔒️ feat(stt,tts): add API key authentication with rate limiting
Add auth.py module to both STT and TTS services with:
- API key validation via X-API-Key header
- Rate limiting with sliding window (requests per minute)
- Internal API key option for unlimited access
- Environment variable configuration

All protected endpoints now require authentication.
Public endpoints (/health, /docs) remain accessible.
2026-02-11 18:04:22 +01:00
Till-JS
4f9d992263 🔧 fix(docker): add missing shared packages to storage-web Dockerfile
Added shared-vite-config and shared-api-client, removed unused shared-types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 18:00:51 +01:00
Till-JS
90c2f8573e feat(photos): add Photos app with mana-media EXIF integration
- Add Photos NestJS backend (port 3019) with albums, favorites, tags
- Add Photos SvelteKit web app (port 5189) with gallery, upload, filters
- Extend mana-media with EXIF extraction service using exifr
- Add cross-app photo listing endpoint to mana-media
- Add photo stats endpoint to mana-media
- Add photos to setup-databases.sh

Backend features:
- Albums CRUD with cover image and items management
- Favorites toggle with status check
- Tags CRUD with photo-tag associations
- Photo proxy to mana-media with local data enrichment

Web features:
- Photo grid with infinite scroll
- Photo detail modal with EXIF display
- Album grid and detail views
- Upload dropzone with progress tracking
- Filter bar (app, date range, location, sort)
- i18n support (de/en)
- Svelte 5 runes mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:58:44 +01:00
Till-JS
d3392f69a9 🔧 fix(ci): disable ARM64 for storage-backend due to QEMU issues
Storage-backend build was failing on ARM64 due to QEMU emulation
"Illegal instruction" crash when building native dependencies.
Same approach used for matrix-mana-bot and matrix-tts-bot.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:51:26 +01:00
Till-JS
5cd8b63862 🐛 fix(infra): correct TTS API port to 3022 2026-02-11 17:41:27 +01:00
Till-JS
99a23d04d2 🚀 feat(infra): expose STT and TTS APIs externally
- Add stt-api.mana.how -> localhost:3020
- Add tts-api.mana.how -> localhost:3021

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 17:39:59 +01:00
Till-JS
e7e6281d54 🔧 fix(docker): add missing shared packages to all backend Dockerfiles
All backend Dockerfiles were missing required shared package dependencies,
causing CI builds to fail with TypeScript compilation errors.

Fixed Dockerfiles:
- chat: added credit-operations, nestjs-integration, health, metrics, setup, tsconfig
- todo: added credit-operations, nestjs-integration, health, metrics, tsconfig
- contacts: added health, metrics, setup, tsconfig
- calendar: added credit-operations, nestjs-integration, health, metrics, setup, tsconfig
- presi: added health, setup, tsconfig
- picture: added credit-operations, nestjs-integration, health, storage, tsconfig
- clock: added health, metrics, setup, tsconfig
- storage: added health, tsconfig
- manadeck: added credit-operations, tsconfig
- skilltree: added health, metrics, tsconfig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 16:47:00 +01:00
Till-JS
21d50d1e0b 📝 docs(mana-stt): document Whisper + Mistral API architecture
- Disable vLLM by default (has issues on macOS CPU)
- Use Mistral API for Voxtral transcription (cloud-based)
- Keep Whisper-MLX for local transcription
- Update README with architecture diagram

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 16:34:03 +01:00
Till-JS
7c9c2645e3 🐛 fix(mana-stt): adjust vLLM config for CPU mode
- Reduce max-model-len to 4096 for CPU compatibility
- Add max-num-batched-tokens matching the context size
- Add enforce-eager for stable CPU inference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 16:14:14 +01:00
Till-JS
60394076e5 feat(mana-stt): add vLLM integration for Voxtral transcription
- Add vllm_service.py as proxy to vLLM server for Voxtral 3B/4B
- Add voxtral_api_service.py for Mistral API fallback
- Update main.py with /transcribe/voxtral endpoint using vLLM
- Add /transcribe/auto endpoint with automatic fallback chain
- Create setup-vllm.sh and start-vllm-voxtral.sh scripts
- Add launchd plist files for Mac Mini deployment
- Add install-services.sh for automated service installation

Architecture:
- vLLM server runs Voxtral models on port 8100
- mana-stt proxies to vLLM with Mistral API fallback
- Fallback chain: vLLM -> Mistral API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 16:10:00 +01:00
Till-JS
a2e2a5b73c feat(admin): add user data dashboard for cross-project data visualization
Add comprehensive admin dashboard to view and manage user data across all projects:

Backend:
- Add admin endpoints to Chat, Todo, Contacts, Calendar, Picture, Zitare, Presi
- Each backend exposes GET/DELETE /api/v1/admin/user-data/:userId
- Service-to-service auth via X-Service-Key header

Aggregation (mana-core-auth):
- GET /api/v1/admin/users - Paginated user list with search
- GET /api/v1/admin/users/:userId/data - Aggregated data from all backends
- DELETE /api/v1/admin/users/:userId/data - GDPR deletion across all projects

Frontend (ManaCore web):
- New User Data tab in admin navigation
- User search page at /admin/user-data
- User detail page with ProjectDataCard components
- GDPR deletion dialog with email confirmation

Presi:
- Migrate user_id from UUID to TEXT for Better Auth compatibility
- Add SQL migration script
2026-02-11 14:59:18 +01:00
Till-JS
5b6f231e1a 🐛 fix(todo,matrix): improve click targets and type safety
- todo: Make task-content button fill full height for better click target
- matrix: Fix TypeScript errors by using Boolean() for template expressions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 14:53:49 +01:00
Till-JS
bf0e788cba ♻️ refactor(todo,contacts): remove sidebar mode from PillNavigation
Simplify navigation by removing unused sidebar mode from both apps:

Todo App:
- Remove isSidebarMode state, handlers, and localStorage persistence
- Remove sidebar-related CSS classes and styles
- Simplify TodoToolbar to pure wrapper component

Contacts App:
- Remove isSidebarMode state, handlers, and localStorage persistence
- Remove sidebar-related CSS from ContactsToolbar and ContactAlphabetView
- Always show view-mode-pill (no longer conditional on sidebar mode)

This removes ~250 lines of unused code across 5 files.
2026-02-02 19:16:56 +01:00
Till-JS
12a900346c ♻️ refactor(calendar): remove sidebar mode from PillNavigation
Simplify the bottom bars by removing the unused sidebar mode:
- Remove isSidebarMode prop from all components
- Remove sidebar-related CSS classes and styles
- Simplify CalendarToolbar to pure wrapper component
- Remove localStorage persistence for sidebar mode

This removes ~230 lines of unused code across 8 files.
2026-02-02 19:06:32 +01:00
Till-JS
c475923864 fix(mana-media): simplify Dockerfile to single build stage
Use simpler approach that handles pnpm install failures gracefully.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:03:05 +01:00
Till-JS
b3dd3c51d3 fix(mana-media): fix Dockerfile build and health check paths
- Use --ignore-scripts to skip postinstall builds during install
- Remove unnecessary shared-builder stage
- Fix health check URL to /api/v1/health

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:57:50 +01:00
Till-JS
c965f7e440 fix(mana-media): simplify Dockerfile for pnpm hoisted dependencies
pnpm hoists dependencies to root node_modules, so we don't need to copy
service-level node_modules that don't exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:55:49 +01:00
Till-JS
bd9bd556f4 🚸 feat(calendar): hide tasks by default and scroll to midday on load
- Add showTasksInCalendar setting (default: false) to hide task blocks
- Auto-scroll time-grid views to 12:00 on initial load for better UX
- Tasks can be re-enabled via settings toggle
2026-02-02 18:54:05 +01:00
Till-JS
5c19500748 fix(mana-media): change userId from UUID to TEXT for Matrix user IDs
Matrix user IDs like @user:matrix.org are not UUIDs, so the schema
needs to accept text strings for the userId field in media_references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:45:40 +01:00
Till-JS
cee30ff7ed feat(matrix-todo-bot): improve UX with German commands without ! prefix
- heute command now shows both today's tasks AND inbox tasks
- All commands work without ! prefix (e.g., 'heute' instead of '!heute')
- Updated all help text and messages to show German commands
- Added direct command recognition for: neu, heute, erledigt, löschen, etc.
- Commands still work with ! prefix for backwards compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:32:00 +01:00
Till-JS
d4663b5643 feat(mana-media): add centralized media storage with NutriPhi integration
- Implement mana-media service with PostgreSQL/Drizzle ORM persistence
- Add content-addressable storage (SHA-256) for automatic deduplication
- Add Matrix MXC URL import endpoint to copy images from Matrix
- Create @manacore/media-client package for service consumption
- Integrate mana-media into NutriPhi bot for persistent image storage
- Update pnpm-workspace.yaml to include nested service packages
- Add mana-media to docker-compose with port 3015

Images sent to NutriPhi bot are now stored in mana-media after analysis,
providing persistent storage with deduplication across all apps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:30:14 +01:00
Till-JS
171cf7a854 fix(contacts-web): use runtime URLs instead of build-time baked values
- user-settings.svelte.ts: use getAuthUrl() for settings API
- contacts.ts: use getAuthUrl() for tags API client
- feedback.ts: use getAuthUrl() for feedback service

This fixes Mixed Content errors where the app was trying to reach
internal Docker URLs (http://mana-auth:3001) instead of production
URLs (https://auth.mana.how).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:22:59 +01:00
Till-JS
30f0dbef5d feat(contacts-web): add hooks.server.ts for runtime URL injection
Fixes contacts-web using localhost URLs instead of production URLs.
SvelteKit bakes environment variables at build time, so we need to
inject runtime URLs via hooks.server.ts for Docker deployments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:14:03 +01:00