From 62d9eb1f2b2ed3bb0c0e5f047a36c9d75c25f56a Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 3 Apr 2026 14:59:15 +0200 Subject: [PATCH] fix(infra): update status page, prometheus, and cloudflared for unified app All web app subdomains (chat.mana.how, todo.mana.how, etc.) were removed when the unified app launched, but monitoring configs still referenced them. Update blackbox targets to use mana.how/route URLs, remove stale API backend routes from cloudflared, clean up CORS origins, and fix status page generator to handle route-based URLs. Co-Authored-By: Claude Opus 4.6 (1M context) --- cloudflared-config.yml | 47 +----- docker/prometheus/prometheus.yml | 136 +++++++----------- scripts/generate-status-page.sh | 46 ++++-- scripts/mac-mini/README.md | 17 +-- scripts/mac-mini/deploy.sh | 10 +- .../launchd/com.manacore.image-gen.plist | 2 +- scripts/mac-mini/setup-image-gen.sh | 2 +- scripts/mac-mini/setup-stt.sh | 2 +- scripts/mac-mini/setup-tts.sh | 2 +- 9 files changed, 106 insertions(+), 158 deletions(-) diff --git a/cloudflared-config.yml b/cloudflared-config.yml index b4bc6ae72..4ece3d2ad 100644 --- a/cloudflared-config.yml +++ b/cloudflared-config.yml @@ -22,49 +22,10 @@ ingress: - hostname: git.mana.how service: http://localhost:3041 - # ────────────────────────────────────────────────────────── - # Backend APIs (Hono/Bun compute servers — stay separate) - # ────────────────────────────────────────────────────────── - - hostname: chat-api.mana.how - service: http://localhost:3030 - - hostname: todo-api.mana.how - service: http://localhost:3031 - - hostname: calendar-api.mana.how - service: http://localhost:3032 - - hostname: clock-api.mana.how - service: http://localhost:3033 - - hostname: contacts-api.mana.how - service: http://localhost:3034 - - hostname: zitare-api.mana.how - service: http://localhost:3007 - - hostname: skilltree-api.mana.how - service: http://localhost:3038 - - hostname: cards-api.mana.how - service: http://localhost:3009 - - hostname: storage-api.mana.how - service: http://localhost:3035 - - hostname: presi-api.mana.how - service: http://localhost:3036 - - hostname: nutriphi-api.mana.how - service: http://localhost:3037 - - hostname: photos-api.mana.how - service: http://localhost:3039 - - hostname: mukke-api.mana.how - service: http://localhost:3010 - - hostname: picture-api.mana.how - service: http://localhost:3040 - - hostname: clock-bot.mana.how - service: http://localhost:4018 - - # NOTE: All web app subdomains (chat.mana.how, todo.mana.how, etc.) - # are removed — they now run as routes under the unified app at mana.how - # (e.g., mana.how/chat, mana.how/todo, etc.) - - # AI Voice Services (local STT/TTS, läuft über mana-service-llm) - - hostname: stt-api.mana.how - service: http://localhost:3020 - - hostname: tts-api.mana.how - service: http://localhost:3022 + # NOTE: Individual app backends (chat, todo, calendar, contacts, storage, + # nutriphi, mukke, planta, picture, etc.) have been REMOVED — all migrated + # to local-first architecture. Web apps run as routes under mana.how. + # Only uload-server and memoro-server remain as app-specific backends. # Games - hostname: whopxl.mana.how diff --git a/docker/prometheus/prometheus.yml b/docker/prometheus/prometheus.yml index dcc2a2d89..26567c3d2 100644 --- a/docker/prometheus/prometheus.yml +++ b/docker/prometheus/prometheus.yml @@ -46,7 +46,7 @@ scrape_configs: - targets: ['redis-exporter:9121'] # ============================================ - # Application Backends (after /metrics added) + # Core Services (Hono/Bun + Go) # ============================================ # Auth Service @@ -56,84 +56,51 @@ scrape_configs: metrics_path: '/metrics' scrape_interval: 30s - # Chat Backend - - job_name: 'chat-backend' + # Credits Service + - job_name: 'mana-credits' static_configs: - - targets: ['chat-backend:3030'] + - targets: ['mana-credits:3002'] metrics_path: '/metrics' scrape_interval: 30s - # Todo Backend - - job_name: 'todo-backend' + # User Service + - job_name: 'mana-user' static_configs: - - targets: ['todo-backend:3031'] + - targets: ['mana-user:3062'] metrics_path: '/metrics' scrape_interval: 30s - # Calendar Backend - - job_name: 'calendar-backend' + # Subscriptions Service + - job_name: 'mana-subscriptions' static_configs: - - targets: ['calendar-backend:3032'] + - targets: ['mana-subscriptions:3063'] metrics_path: '/metrics' scrape_interval: 30s - # Clock Backend: REMOVED — migrated to local-first - - # Contacts Backend - - job_name: 'contacts-backend' + # Analytics Service + - job_name: 'mana-analytics' static_configs: - - targets: ['contacts-backend:3033'] + - targets: ['mana-analytics:3064'] metrics_path: '/metrics' scrape_interval: 30s - # Storage Backend - - job_name: 'storage-backend' + # ULoad Server + - job_name: 'uload-server' static_configs: - - targets: ['storage-backend:3034'] + - targets: ['mana-app-uload-server:3070'] metrics_path: '/metrics' scrape_interval: 30s - # Presi Backend: REMOVED — replaced by Hono server - - # Nutriphi Backend - - job_name: 'nutriphi-backend' + # Memoro Server + - job_name: 'memoro-server' static_configs: - - targets: ['nutriphi-backend:3038'] + - targets: ['mana-app-memoro-server:3015'] metrics_path: '/metrics' scrape_interval: 30s - # SkillTree Backend: REMOVED — migrated to local-first - - # Photos Backend: REMOVED — migrated to local-first + direct mana-media - - # CityCorners Backend: REMOVED — migrated to local-first - - # Zitare Backend: REMOVED — migrated to local-first - - # Mukke Backend - - job_name: 'mukke-backend' - static_configs: - - targets: ['mukke-backend:3037'] - metrics_path: '/metrics' - scrape_interval: 30s - - # Planta Backend - - job_name: 'planta-backend' - static_configs: - - targets: ['planta-backend:3039'] - metrics_path: '/metrics' - scrape_interval: 30s - - # Picture Backend - - job_name: 'picture-backend' - static_configs: - - targets: ['picture-backend:3035'] - metrics_path: '/metrics' - scrape_interval: 30s - - # ============================================ - # Core Services - # ============================================ + # NOTE: Individual app backends (chat, todo, calendar, contacts, storage, + # nutriphi, mukke, planta, picture) have been REMOVED — all migrated to + # local-first architecture. Only uload-server and memoro-server remain. # Mana LLM Gateway (Ollama + Google Fallback) - job_name: 'mana-llm' @@ -255,32 +222,43 @@ scrape_configs: # Blackbox Exporter — HTTP Uptime Probes # ============================================ - # Web Apps (SvelteKit frontends) + # Web Apps (Unified ManaCore app at mana.how + standalone games) - job_name: 'blackbox-web' metrics_path: /probe params: module: [http_2xx] static_configs: - targets: + # Unified ManaCore app (all modules as routes) - https://mana.how - - https://chat.mana.how - - https://todo.mana.how - - https://calendar.mana.how - - https://contacts.mana.how - - https://clock.mana.how - - https://photos.mana.how - - https://picture.mana.how - - https://storage.mana.how - - https://presi.mana.how - - https://nutriphi.mana.how - - https://planta.mana.how - - https://calc.mana.how - - https://zitare.mana.how - - https://cards.mana.how - - https://skilltree.mana.how - - https://mukke.mana.how - - https://citycorners.mana.how - - https://playground.mana.how + - https://mana.how/chat + - https://mana.how/todo + - https://mana.how/calendar + - https://mana.how/contacts + - https://mana.how/times + - https://mana.how/photos + - https://mana.how/picture + - https://mana.how/storage + - https://mana.how/presi + - https://mana.how/nutriphi + - https://mana.how/planta + - https://mana.how/calc + - https://mana.how/zitare + - https://mana.how/cards + - https://mana.how/skilltree + - https://mana.how/mukke + - https://mana.how/citycorners + - https://mana.how/memoro + - https://mana.how/moodlit + - https://mana.how/context + - https://mana.how/questions + - https://mana.how/uload + - https://mana.how/notes + - https://mana.how/habits + - https://mana.how/guides + - https://mana.how/inventar + - https://mana.how/playground + # Standalone games (separate containers) - https://whopxl.mana.how - https://arcade.mana.how relabel_configs: @@ -291,7 +269,7 @@ scrape_configs: - target_label: __address__ replacement: blackbox-exporter:9115 - # API Health Endpoints + # API Health Endpoints (only services with running containers) - job_name: 'blackbox-api' metrics_path: /probe params: @@ -300,14 +278,6 @@ scrape_configs: - targets: - https://auth.mana.how/health - https://api.mana.how/health - - https://chat-api.mana.how/health - - https://todo-api.mana.how/health - - https://calendar-api.mana.how/health - - https://contacts-api.mana.how/health - - https://storage-api.mana.how/health - - https://nutriphi-api.mana.how/health - - https://planta-api.mana.how/health - - https://picture-api.mana.how/health relabel_configs: - source_labels: [__address__] target_label: __param_target diff --git a/scripts/generate-status-page.sh b/scripts/generate-status-page.sh index 8cfab9b7e..7e154eb42 100755 --- a/scripts/generate-status-page.sh +++ b/scripts/generate-status-page.sh @@ -59,11 +59,22 @@ get_instances() { # Freundlicher Name aus URL friendly_name() { url="$1" - # Entferne https:// und .mana.how + # Entferne https:// name="${url#https://}" - name="${name%.mana.how}" + # Route-basierte URLs: mana.how/chat → Chat + case "$name" in + mana.how/*) + name="${name#mana.how/}" + ;; + *) + # Subdomain-basiert: chat.mana.how → Chat + name="${name%.mana.how}" + ;; + esac # Entferne /health suffix name="${name%/health}" + # mana.how (ohne Route) → ManaCore + [ "$name" = "mana.how" ] && name="ManaCore" # Erster Buchstabe groß (POSIX-kompatibel) printf '%s' "$name" | awk '{print toupper(substr($0,1,1)) substr($0,2)}' } @@ -170,21 +181,29 @@ fi # Gibt Tier-Badge-HTML für eine Blackbox-URL zurück (leer wenn kein Match) get_tier_badge() { url="$1" - # Subdomain extrahieren: https://todo.mana.how → todo, https://todo-api.mana.how/health → todo-api - subdomain="${url#https://}" - subdomain="${subdomain%.mana.how*}" - subdomain="${subdomain%/health}" + raw="${url#https://}" + # Route-basierte URLs: mana.how/chat → chat + case "$raw" in + mana.how/*) + appid="${raw#mana.how/}" + ;; + *) + # Subdomain-basiert: todo.mana.how → todo + appid="${raw%.mana.how*}" + appid="${appid%/health}" + ;; + esac # API-Subdomains skippen (z.B. todo-api, chat-api) - case "$subdomain" in *-api) return ;; esac - # Subdomain-Aliase (Sonderfälle + alte Subdomains → aktuelle App-IDs) - case "$subdomain" in - mana.how) subdomain="manacore" ;; - manadeck) subdomain="cards" ;; - inventar) subdomain="inventory" ;; + case "$appid" in *-api) return ;; esac + # Aliase (Sonderfälle → aktuelle App-IDs) + case "$appid" in + mana.how) appid="manacore" ;; + manadeck) appid="cards" ;; + inventar) appid="inventory" ;; esac echo "$TIER_APPS" | while IFS='|' read -r id name tier st; do - [ "$id" = "$subdomain" ] || continue + [ "$id" = "$appid" ] || continue printf '%s' "$tier" "$tier" break done @@ -461,6 +480,7 @@ echo "$SUCCESS_JSON" | jq \ | rtrimstr("/health") | rtrimstr("/") | if . == "mana.how" then "manacore" + elif startswith("mana.how/") then ltrimstr("mana.how/") else rtrimstr(".mana.how") end ), diff --git a/scripts/mac-mini/README.md b/scripts/mac-mini/README.md index 79839a030..fa218ef52 100644 --- a/scripts/mac-mini/README.md +++ b/scripts/mac-mini/README.md @@ -230,17 +230,14 @@ Once running, services are available at: | Service | URL | |---------|-----| -| Dashboard | https://mana.how | +| Unified App | https://mana.how | | Auth API | https://auth.mana.how | -| Chat | https://chat.mana.how | -| Chat API | https://chat-api.mana.how | -| Todo | https://todo.mana.how | -| Todo API | https://todo-api.mana.how | -| Calendar | https://calendar.mana.how | -| Calendar API | https://calendar-api.mana.how | -| Clock | https://clock.mana.how | -| Clock API | https://clock-api.mana.how | -| STT API | http://localhost:3020 (internal only) | +| API Gateway | https://api.mana.how | +| Forgejo (Git) | https://git.mana.how | +| Grafana | https://grafana.mana.how | +| Status Page | https://status.mana.how | +| GlitchTip | https://glitchtip.mana.how | +| Umami | https://stats.mana.how | | SSH | ssh mac-mini (via cloudflared) | ## Native Services (non-Docker) diff --git a/scripts/mac-mini/deploy.sh b/scripts/mac-mini/deploy.sh index 4185f95d9..37e4c2be9 100755 --- a/scripts/mac-mini/deploy.sh +++ b/scripts/mac-mini/deploy.sh @@ -109,10 +109,10 @@ echo "" echo "=== Deployment Complete ===" echo "" echo "URLs via Cloudflare Tunnel:" -echo " https://mana.how - Dashboard" +echo " https://mana.how - Unified App (all modules)" echo " https://auth.mana.how - Auth API" -echo " https://chat.mana.how - Chat" -echo " https://todo.mana.how - Todo" -echo " https://calendar.mana.how - Calendar" -echo " https://clock.mana.how - Clock" +echo " https://api.mana.how - API Gateway" +echo " https://git.mana.how - Forgejo" +echo " https://grafana.mana.how - Grafana" +echo " https://status.mana.how - Status Page" echo "" diff --git a/scripts/mac-mini/launchd/com.manacore.image-gen.plist b/scripts/mac-mini/launchd/com.manacore.image-gen.plist index 15a06d090..f54dbaf2b 100644 --- a/scripts/mac-mini/launchd/com.manacore.image-gen.plist +++ b/scripts/mac-mini/launchd/com.manacore.image-gen.plist @@ -34,7 +34,7 @@ GENERATION_TIMEOUT 300 CORS_ORIGINS - https://mana.how,https://picture.mana.how,https://chat.mana.how + https://mana.how RunAtLoad diff --git a/scripts/mac-mini/setup-image-gen.sh b/scripts/mac-mini/setup-image-gen.sh index fa8dc6537..602136cd4 100755 --- a/scripts/mac-mini/setup-image-gen.sh +++ b/scripts/mac-mini/setup-image-gen.sh @@ -102,7 +102,7 @@ cat > "$PLIST_PATH" << EOF GENERATION_TIMEOUT 120 CORS_ORIGINS - https://mana.how,https://picture.mana.how,https://chat.mana.how,http://localhost:5173 + https://mana.how,http://localhost:5173 RunAtLoad diff --git a/scripts/mac-mini/setup-stt.sh b/scripts/mac-mini/setup-stt.sh index 34277a2e6..2b5dd5258 100755 --- a/scripts/mac-mini/setup-stt.sh +++ b/scripts/mac-mini/setup-stt.sh @@ -68,7 +68,7 @@ cat > "$PLIST_PATH" << EOF PRELOAD_MODELS false CORS_ORIGINS - https://mana.how,https://chat.mana.how,https://todo.mana.how + https://mana.how RunAtLoad diff --git a/scripts/mac-mini/setup-tts.sh b/scripts/mac-mini/setup-tts.sh index 2cb8732ca..d6485b7be 100755 --- a/scripts/mac-mini/setup-tts.sh +++ b/scripts/mac-mini/setup-tts.sh @@ -75,7 +75,7 @@ cat > "$PLIST_PATH" << EOF MAX_TEXT_LENGTH 1000 CORS_ORIGINS - https://mana.how,https://chat.mana.how,https://todo.mana.how,https://zitare.mana.how + https://mana.how RunAtLoad