13 Commits

Author SHA1 Message Date
chahinebrini
b87ec08431 feat(mdm): remove mdm_lock type, derive lockProfileInstalled from nefilter state 2026-06-17 22:32:40 +02:00
chahinebrini
adb686d9a3 ci(deploy-staging): bump Node heap to 4GB for nitro build (fix OOM)
nitro build OOM'd on the runner (exit 134, "ineffective mark-compacts
near heap limit") — Node's default ~2GB heap was exceeded as the build
grew. Runner has 7GB RAM, so raise --max-old-space-size to 4096. This
unblocks the backend deploy (IMAP crash + dm-push fixes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 15:06:34 +02:00
chahinebrini
771af0faf1 ci(magic-win): pnpm-version aus packageManager statt explizit (fix Multiple-versions)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 13:42:53 +02:00
chahinebrini
4b4b9fc63b feat(magic-win): ReBreak Magic Windows-App (Tauri) + CI-Build
Tauri 2 DoH-Schutz für Windows: PowerShell-DoH-Takeover, Tamper-Service
(SYSTEM, windows-service), Browser-Policies (Chromium built-in-DNS + eigenes
DoH aus → OS-Resolver), 24h-Cooldown via bestehende magic/*-Endpoints.
GitHub-Actions baut den x64-NSIS-Installer auf windows-latest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 13:39:52 +02:00
chahinebrini
372aaa43dd fix(ci): pipeline race-condition + health-check retry + maestro secrets
Hauptproblem: Webhook-Deploy (deploy.sh) und GH-Actions-Deploy
(deploy-from-artifact.sh) liefen gleichzeitig → Race auf .output-staging
und doppelter pm2-restart.

Fixes:
- deploy-from-artifact.sh: setzt .deploy-ga.lock (noclobber, mit PID)
  während Deploy läuft; stale locks werden erkannt und überschrieben
- deploy.sh: prüft .deploy-ga.lock bei Start — wenn GH-Actions aktiv,
  sauberes exit 0 statt Kollision
- Health-Check: Retry-Loop (12× × 5s = max 60s) statt einmaligem sleep 5;
  Infisical-Login + Nitro-Start braucht auf gestresstem Server bis 30s
- maestro-cloud.yml: ungültiges `if: secrets.X != ''` entfernt (secrets
  in if-conditions sind in GH-Actions immer leer); stattdessen expliziter
  secrets-check als erster Step mit klarer Fehlermeldung
- pnpm --prefer-offline in deploy-from-artifact.sh: nutzt Store-Cache
- .gitignore: .deploy-ga.lock ergänzt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 09:32:25 +02:00
chahinebrini
d0d12dd3b2 fix(deploy): scp imap-idle mit Punkt-Notation (kein Unterverzeichnis-Bug)
scp -r imap-idle/ target/ erstellt imap-idle/imap-idle/ wenn target existiert.
Fix: imap-idle/. kopiert Inhalt direkt in target ohne extra Subdir.
Plus: rm -rf + mkdir vor scp fuer idempotente Deploys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 20:54:26 +02:00
chahinebrini
062e542519 fix(deploy): mkdir -p imap-idle dir vor scp (first-deploy path fehlt)
scp -r schlaegt fehl wenn Zielverzeichnis nicht existiert.
Loest den GH-Actions-Fehler "realpath /srv/rebreak/backend/imap-idle/: No such file".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 20:50:44 +02:00
chahinebrini
a24a9c783f feat(mail): IDLE-daemon for real-time Legend mail-protection
Standalone ESM-daemon that:
- Connects via ImapFlow IDLE to all active Legend mailboxes
- Triggers /api/mail/scan-internal on new-mail events (real-time)
- Auto-renew IDLE every 25min (RFC 3501 limit), exponential-backoff reconnect
- DB-refresh every 5min for new/removed connections

Plus deploy-pipeline:
- GH-Actions artifact-upload + scp to /srv/rebreak/backend/imap-idle/
- npm install --production on server (imapflow + pg)
- pm2 startOrReload via ecosystem.config.js
- start-idle-staging.sh wrapper for Infisical secret-injection

Replaces 30min-cron polling for Legend tier -- Casino-mails now blocked
within seconds, fulfilling Legend tier marketing promise.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 20:48:33 +02:00
chahinebrini
417191c90a test(maestro): 6 E2E flows + setup-guide + testID-TODO
User-runnable lokal via maestro CLI oder Studio (GUI). Ahmed-agent built.

Neue flows (.maestro/):
- auth/email-signin.yaml (admin@rebreak.org login via env-vars, NOT hardcoded)
- profile/view-and-edit.yaml (avatar tap → edit → save → verify)
- profile/demographics.yaml (accordion → fill 3 fields → verify save)
- settings/dark-theme.yaml (Settings → Theme → Dark → verify)
- urge/sos-flow.yaml (start SOS → atemübung → finish → rating)
- community/create-post.yaml (compose → publish)

SETUP.md ergänzt: install, prerequisites, env-vars, troubleshooting.

TODO_TESTIDS.md (17 missing testIDs, 7 high-prio):
- AppHeader: header-avatar-btn (alle flows betroffen, aktuell coordinate-fallback)
- urge: sos-send-btn (SOS-flow blocked ohne)
- profile/edit: nickname-input, save-btn

GH-Actions template (.github/workflows/maestro-cloud.yml) — NICHT aktiv,
braucht User-OK + EAS-secrets.

User runs:
  maestro test apps/rebreak-native/.maestro/auth/email-signin.yaml \
    --env=E2E_TEST_USER=admin --env=E2E_TEST_PASSWORD=<from Infisical>
  maestro studio  # GUI

Stolperfalle: charioanouar (Google OAuth) funktioniert nicht — admin-account
nutzen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:45:53 +02:00
chahinebrini
d3dfa74cf8 feat(admin): Admin App initial commit + Deploy-Infrastructure
apps/admin/:
- Nuxt 4.1.3 + @nuxt/ui 4 + @nuxtjs/supabase, port 3017 staging
- 7 pages: index (59 LOC dashboard), login (72 LOC), auth/confirm, plus stubs
  für domains/users/stats/moderation (14-17 LOC each, content für separate
  Phase 2 Session)
- composables/useAdminAuth.ts: Supabase login + verifyAdminRole hook
- middleware/admin-auth.ts: route guard (Phase 3 backend-check ready)
- layouts/default.vue, app.vue, README.md
- nuxt.config.ts: SSR=true, port 3017, dark-mode preference, Supabase
  pkce-flow, runtimeConfig.adminSecret für Phase 3 backend-binding

Deploy-Infrastructure:
- .github/workflows/deploy-admin-staging.yml: build admin auf push to main mit
  path-filter apps/admin/**, scp tar zu Server, atomic-mv + pm2 restart
- scripts/deploy-admin-from-artifact.sh: Server-side deploy (extract, atomic mv,
  pm2 reload). Kein prisma-migrate (admin hat kein eigenes DB-Schema).
- apps/admin/start-admin-staging.sh: pm2 start-script mit Infisical-wrapper,
  port 3017, mappt Infisical SUPABASE_URL/KEY auf NUXT_PUBLIC_*
- ecosystem.config.js: rebreak-admin-staging Eintrag (port 3017,
  max_memory_restart 400M)
- ops/nginx/admin-staging.rebreak.org.conf: HTTP→HTTPS redirect, SSL paths,
  proxy auf 127.0.0.1:3017, noindex header

Pending User-Actions für go-live:
1. DNS-A-Record admin.staging.rebreak.org → 49.13.55.22
2. SSL-cert via certbot (oder bestehender wildcard *.staging.rebreak.org)
3. nginx-config auf Server aktivieren (sudo cp + ln + reload)
4. pm2 initial start: pm2 start ecosystem.config.js --only rebreak-admin-staging
5. Infisical-secret ADMIN_SECRET (server-only, Phase 3 binding)

GH-Actions: keine neuen Secrets (nutzt bestehende HETZNER_SSH_KEY/HOST/USER)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 22:17:20 +02:00
chahinebrini
def21a220d refactor(deploy-staging): HETZNER_HOST/USER von secrets zu vars
Hostname (staging.rebreak.org) und User (root) sind keine echten Secrets —
public DNS bzw. in Doku schon erwähnt. Variables sichtbar in Logs erleichtert
Debug (siehe DNS-Fail mit "getaddrinfo ***" — bei vars wäre der konkrete
Wert lesbar gewesen).

Aufteilung jetzt:
- HETZNER_SSH_KEY → secret (sensitive: Server-Root-Zugang)
- HETZNER_HOST    → var (public DNS)
- HETZNER_USER    → var (in Doku)

Plus echo des Host-Werts in Setup-SSH-Step für Debug-Visibility.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:32:34 +02:00
chahinebrini
072efa06e8 fix(deploy-staging): pnpm-version Konflikt mit packageManager-Field
pnpm/action-setup@v4 errored out weil sowohl `version: 10` im Workflow
als auch `packageManager: pnpm@10.23.0` in package.json gesetzt waren.
package.json bleibt source-of-truth, version aus Workflow raus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:20:00 +02:00
chahinebrini
87438ede8e feat(deploy): GitHub-Actions Build+Deploy-Pipeline für rebreak-staging
CX23 (4GB RAM) OOM'd am 2026-05-06 während webhook-getriggertem `pnpm build`
(Heap-Limit 1.5GB überschritten). Build raus aus Server, GitHub-Runner (7GB RAM)
übernimmt — Server deployed nur noch Artifact via scp + atomic-mv + pm2 restart.

- .github/workflows/deploy-staging.yml: 2-Job (build + deploy via SSH-Artifact-Push)
- scripts/deploy-from-artifact.sh: Server-Script mit Migration-Detection + atomic-mv
- ops/GITHUB_ACTIONS_PIPELINE.md: Architektur-Doku + Cheatsheet

Coexistence: alter rebreak-webhook bleibt als Failsafe, wird nach 5+ erfolgreichen
GA-Runs deaktiviert. Erster Run: Webhook temporär gestoppt für sauberen Test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:18:49 +02:00