From ec53ab27cdd9d4f62117e59e273c8c57282f5068 Mon Sep 17 00:00:00 2001 From: claude-dev Date: Sun, 26 Apr 2026 17:56:29 +0000 Subject: [PATCH] CLAUDE.md: Staging-Umgebung dokumentiert (Service, DB, .env, Workflow) Co-Authored-By: Claude Opus 4.7 (1M context) --- CLAUDE.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index dc82045..2d442a2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -220,3 +220,71 @@ Changelog-Kategorien in TaskMate: - 34 = Changelog Verwaltung - 35 = Changelog Website - 36 = Changelog TaskMate + +## Staging-Umgebung + +```yaml +staging: + url: https://staging.monitor.aegis-sight.de + server: 46.225.141.13 (gleicher Host wie Live) + pfad: /home/claude-dev/AegisSight-Monitor-staging + branch: develop + port: 18891 (Live: 8891) + service: aegis-monitor-staging.service (systemd) + venv: /home/claude-dev/AegisSight-Monitor-staging/venv (eigenes venv) + zugriff: Magic-Link-Login an info@aegis-sight.de (Cookie 30 Tage) + + datenbank: + pfad: ~/AegisSight-Monitor-staging/data/osint.db + initial: einmalige Kopie der Live-DB + drift: gewollt - Aenderungen in Staging beeinflussen Live nicht + reseed_von_live: | + sudo systemctl stop aegis-monitor-staging + cp ~/AegisSight-Monitor/data/osint.db ~/AegisSight-Monitor-staging/data/osint.db + sudo systemctl start aegis-monitor-staging + + besonderheiten_env: + JWT_SECRET: eigener fuer Staging (nicht Live-JWT) + MAGIC_LINK_BASE_URL: https://staging.monitor.aegis-sight.de (sonst leitet App zu Live) + TELEGRAM_API_ID: 0 # deaktiviert - verhindert Doppel-Login mit Live + TELEGRAM_API_HASH: 0 + DB-Pfad: relative aus config.py (nutzt automatisch ~/AegisSight-Monitor-staging/data/) + + auth_service: + pfad: /opt/aegis-staging-auth + service: aegis-monitor-staging-auth.service + port: 127.0.0.1:8095 + cookie_domain: staging.monitor.aegis-sight.de + cookie_name: aegis_monitor_staging_auth + code_quelle: identisch zum Service auf 46.225.225.49 (eigene Konfig) +``` + +### Workflow Staging -> Live + +1. **Aenderung in develop machen** (im Staging-Verzeichnis): + ```bash + cd ~/AegisSight-Monitor-staging + git checkout develop + # Aenderung + git add . && git commit -m ... && git push origin develop + ``` + +2. **Staging aktualisieren** (aktuell manuell): + ```bash + ssh claude-dev@46.225.141.13 'cd ~/AegisSight-Monitor-staging && git pull && sudo systemctl restart aegis-monitor-staging' + ``` + +3. **In https://staging.monitor.aegis-sight.de testen** + +4. **Promote zu Live**: Pull Request develop -> main in Gitea, dann: + ```bash + ssh claude-dev@46.225.141.13 'cd ~/AegisSight-Monitor && git pull' + # Live laeuft als loser uvicorn-Prozess (kein systemd) - manueller Restart + # bei Backend-Aenderungen noetig + ``` + +### Offen (noch nicht implementiert) + +- Auto-Deploy bei Push auf develop (Webhook-Listener) +- Promote-UI mit Ein-Klick-Button +- Live-Monitor auf systemd umstellen (~10s Downtime einmalig)