mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 18:34:13 +00:00
Tests: - Update frontend.e2e.spec.ts with locale testing - Add search.e2e.spec.ts for search functionality - Add i18n.int.spec.ts for localization tests - Add search.int.spec.ts for search integration - Update playwright.config.ts Documentation: - Add CLAUDE.md with project instructions - Add docs/ directory with detailed documentation - Add scripts/ for utility scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
173 lines
4.9 KiB
Markdown
173 lines
4.9 KiB
Markdown
# Payload CMS Multi-Tenant - Projektstatus
|
|
|
|
**Stand:** 26. November 2025, 21:00 Uhr
|
|
|
|
## Zusammenfassung
|
|
|
|
Das Payload CMS Multi-Tenant-System ist funktionsfähig installiert und läuft. Das Admin-Panel ist erreichbar unter https://pl.c2sgmbh.de/admin
|
|
|
|
## ✅ Abgeschlossen
|
|
|
|
### Infrastruktur
|
|
- [x] LXC Container 700 (sv-payload) erstellt und konfiguriert
|
|
- [x] LXC Container 701 (sv-postgres) erstellt und konfiguriert
|
|
- [x] Netzwerk VLAN 181 eingerichtet
|
|
- [x] NAT-Regel für öffentliche IP 37.24.237.181 konfiguriert
|
|
- [x] DNS pl.c2sgmbh.de → 37.24.237.181 (ohne Cloudflare)
|
|
|
|
### PostgreSQL 17
|
|
- [x] Installation auf sv-postgres
|
|
- [x] Datenbank payload_db erstellt
|
|
- [x] User payload mit Passwort konfiguriert
|
|
- [x] Remote-Zugriff nur von 10.10.181.100 erlaubt
|
|
- [x] Firewall konfiguriert
|
|
|
|
### Payload CMS
|
|
- [x] Node.js 22 LTS installiert
|
|
- [x] pnpm installiert
|
|
- [x] Payload CMS 3.x mit blank Template erstellt
|
|
- [x] PostgreSQL-Adapter konfiguriert
|
|
- [x] Umgebungsvariablen gesetzt
|
|
- [x] Datenbank-Migrationen ausgeführt
|
|
- [x] Production Build erstellt
|
|
|
|
### Caddy Reverse Proxy
|
|
- [x] Caddy 2.10.2 installiert
|
|
- [x] Let's Encrypt SSL-Zertifikat automatisch geholt
|
|
- [x] Reverse Proxy zu localhost:3000 konfiguriert
|
|
- [x] Security Headers gesetzt
|
|
- [x] Gzip/Zstd Kompression aktiviert
|
|
|
|
### PM2 Process Management
|
|
- [x] PM2 installiert
|
|
- [x] ecosystem.config.cjs konfiguriert (als CommonJS wegen ES Module)
|
|
- [x] Autostart bei Systemboot eingerichtet
|
|
- [x] Logging konfiguriert
|
|
|
|
### Multi-Tenant Plugin
|
|
- [x] @payloadcms/plugin-multi-tenant 3.65.0 installiert
|
|
- [x] Plugin in payload.config.ts konfiguriert
|
|
- [x] Tenants Collection erstellt
|
|
- [x] ImportMap generiert
|
|
- [x] Build mit Plugin erfolgreich
|
|
|
|
## 📊 Aktuelle Daten
|
|
|
|
### Tenants
|
|
|
|
| ID | Name | Slug | Status |
|
|
|----|------|------|--------|
|
|
| 1 | porwoll.de | porwoll | ✅ Angelegt |
|
|
| 4 | Complex Care Solutions GmbH | c2s | ✅ Angelegt |
|
|
| 5 | Gunshin | gunshin | ✅ Angelegt |
|
|
| - | Zweitmeinung | zweitmeinung | ⏳ Noch anzulegen |
|
|
|
|
### Users
|
|
|
|
| ID | Email | Tenants |
|
|
|----|-------|---------|
|
|
| 1 | martin.porwoll@complexcaresolutions.de | porwoll, c2s, gunshin |
|
|
|
|
### Datenbank-Status
|
|
|
|
```sql
|
|
-- Tenants
|
|
SELECT id, name, slug FROM tenants;
|
|
-- Ergebnis: 3 Tenants (IDs 1, 4, 5)
|
|
|
|
-- User-Tenant-Zuordnung
|
|
SELECT * FROM users_tenants;
|
|
-- Ergebnis: User 1 ist Tenants 1, 4, 5 zugeordnet
|
|
```
|
|
|
|
## ⚠️ Bekannte Probleme
|
|
|
|
### 1. Tenant-Anzeige im Admin
|
|
**Problem:** In der Tenants-Übersicht wird nur der erste Tenant (porwoll.de) angezeigt, obwohl alle drei in der Datenbank existieren und dem User zugeordnet sind.
|
|
|
|
**Mögliche Ursachen:**
|
|
- Session/Cache-Problem
|
|
- Plugin-Filter-Logik
|
|
|
|
**Workaround:** Ausloggen und neu einloggen, Hard-Refresh (Ctrl+Shift+R)
|
|
|
|
### 2. Manuelle User-Tenant-Zuweisung
|
|
**Problem:** Bei der initialen Installation musste die User-Tenant-Beziehung manuell per SQL erstellt werden.
|
|
|
|
**Lösung für neue User:** Im Admin unter Users → [User] → Tenants-Feld sollte die Zuweisung möglich sein.
|
|
|
|
## 🔜 Nächste Schritte
|
|
|
|
### Kurzfristig
|
|
1. [ ] Vierten Tenant "Zweitmeinung" anlegen (slug: zweitmeinung)
|
|
2. [ ] Tenant-Anzeige-Problem debuggen
|
|
3. [ ] Domains zu Tenants hinzufügen
|
|
4. [ ] Claude Code CLI auf sv-payload installieren
|
|
|
|
### Mittelfristig
|
|
5. [ ] Content Collections erstellen (Pages, Posts, etc.)
|
|
6. [ ] Frontend Next.js Apps für jede Domain aufsetzen
|
|
7. [ ] Media Upload testen
|
|
8. [ ] Backup-Strategie implementieren
|
|
|
|
### Langfristig
|
|
9. [ ] Email-Adapter konfigurieren (aktuell: Console-Output)
|
|
10. [ ] Weitere Redakteur-Accounts anlegen
|
|
11. [ ] Monitoring einrichten
|
|
12. [ ] CI/CD Pipeline aufsetzen
|
|
|
|
## 📁 Wichtige Dateien
|
|
|
|
```
|
|
/home/payload/payload-cms/
|
|
├── src/payload.config.ts # Haupt-Konfiguration
|
|
├── src/collections/
|
|
│ ├── Users.ts
|
|
│ ├── Media.ts
|
|
│ └── Tenants.ts
|
|
├── .env # Umgebungsvariablen
|
|
└── ecosystem.config.cjs # PM2 Config
|
|
|
|
/etc/caddy/Caddyfile # Reverse Proxy Config
|
|
/var/log/caddy/ # Caddy Logs
|
|
/home/payload/logs/ # PM2/Payload Logs
|
|
```
|
|
|
|
## 🔧 Schnellbefehle
|
|
|
|
```bash
|
|
# Status prüfen
|
|
pm2 status
|
|
pm2 logs payload --lines 20
|
|
|
|
# Neustart nach Änderungen
|
|
cd /home/payload/payload-cms
|
|
pnpm build
|
|
pm2 restart payload
|
|
|
|
# Datenbank prüfen
|
|
PGPASSWORD=Finden55 psql -h 10.10.181.101 -U payload -d payload_db -c "SELECT * FROM tenants;"
|
|
|
|
# Caddy neu laden
|
|
sudo systemctl reload caddy
|
|
```
|
|
|
|
## 📞 Zugangsdaten
|
|
|
|
| Service | URL/Host | Credentials |
|
|
|---------|----------|-------------|
|
|
| Admin Panel | https://pl.c2sgmbh.de/admin | martin.porwoll@complexcaresolutions.de |
|
|
| PostgreSQL | 10.10.181.101:5432 | payload / Finden55 |
|
|
| SSH sv-payload | 10.10.181.100 | root |
|
|
| SSH sv-postgres | 10.10.181.101 | root |
|
|
|
|
## 📝 Änderungsprotokoll
|
|
|
|
### 26.11.2025
|
|
- Initial Setup komplett
|
|
- PostgreSQL 17 auf separatem LXC
|
|
- Payload CMS 3.x mit Multi-Tenant Plugin
|
|
- Caddy mit Let's Encrypt SSL
|
|
- PM2 Process Management
|
|
- 3 von 4 Tenants angelegt
|
|
- User-Tenant-Zuweisung manuell per SQL
|