separate wiki from site
This commit is contained in:
@@ -1,87 +0,0 @@
|
|||||||
# Debug-Anleitung für Wiki-Setup
|
|
||||||
|
|
||||||
## Problem behoben: Node.js Version
|
|
||||||
|
|
||||||
**Problem**: Quartz 4.5.2 benötigt Node.js >= 22, wir hatten Node 20.
|
|
||||||
|
|
||||||
**Lösung**: Dockerfile wurde aktualisiert auf `node:22-alpine`
|
|
||||||
|
|
||||||
## Build-Anweisungen
|
|
||||||
|
|
||||||
### 1. Wiki-Service neu bauen (nach Node.js Update)
|
|
||||||
```powershell
|
|
||||||
docker-compose build --no-cache wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Alle Services bauen
|
|
||||||
```powershell
|
|
||||||
docker-compose build
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Services starten
|
|
||||||
```powershell
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Logs prüfen
|
|
||||||
```powershell
|
|
||||||
# Alle Logs
|
|
||||||
docker-compose logs
|
|
||||||
|
|
||||||
# Nur Wiki-Logs
|
|
||||||
docker-compose logs wiki
|
|
||||||
|
|
||||||
# Live-Logs folgen
|
|
||||||
docker-compose logs -f wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Container-Status prüfen
|
|
||||||
```powershell
|
|
||||||
docker-compose ps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Erwartete Ausgabe beim Build
|
|
||||||
|
|
||||||
Beim erfolgreichen Build sollten Sie sehen:
|
|
||||||
- ✅ Git wird installiert
|
|
||||||
- ✅ npm wird aktualisiert
|
|
||||||
- ✅ Quartz Repository wird geklont
|
|
||||||
- ✅ npm install läuft durch (kann einige Minuten dauern)
|
|
||||||
- ✅ serve wird installiert
|
|
||||||
|
|
||||||
## Wenn der Build immer noch fehlschlägt
|
|
||||||
|
|
||||||
### Option 1: Container-Status prüfen
|
|
||||||
```powershell
|
|
||||||
docker ps -a
|
|
||||||
docker-compose logs wiki --tail=100
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 2: In Container einsteigen und manuell testen
|
|
||||||
```powershell
|
|
||||||
# Container starten (auch wenn Build fehlschlägt)
|
|
||||||
docker-compose run --rm wiki sh
|
|
||||||
|
|
||||||
# Dann im Container:
|
|
||||||
cd /app/quartz-repo
|
|
||||||
npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Option 3: Cache leeren und neu bauen
|
|
||||||
```powershell
|
|
||||||
docker-compose down
|
|
||||||
docker system prune -f
|
|
||||||
docker-compose build --no-cache wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
## Erwartete Ports
|
|
||||||
|
|
||||||
- **Web (Next.js)**: http://localhost:3001
|
|
||||||
- **Wiki (Quartz)**: http://localhost:8080
|
|
||||||
|
|
||||||
## Nächste Schritte nach erfolgreichem Build
|
|
||||||
|
|
||||||
1. Services starten: `docker-compose up -d`
|
|
||||||
2. Wiki aufrufen: http://localhost:8080
|
|
||||||
3. Wiki-Seite testen: http://localhost:3001/wiki
|
|
||||||
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
# Wiki Deployment Checklist
|
|
||||||
|
|
||||||
## ✅ Vor dem Deployment
|
|
||||||
|
|
||||||
- [ ] Alle Änderungen committed
|
|
||||||
- [ ] API-Route `app/api/wiki/route.ts` vorhanden
|
|
||||||
- [ ] API-Route `app/api/wiki/[...path]/route.ts` vorhanden
|
|
||||||
- [ ] Wiki-Seite `app/wiki/page.tsx` vorhanden
|
|
||||||
- [ ] Docker-Compose mit beiden Services konfiguriert
|
|
||||||
|
|
||||||
## 🔧 Deployment-Schritte
|
|
||||||
|
|
||||||
### 1. Services neu starten
|
|
||||||
```bash
|
|
||||||
docker-compose down
|
|
||||||
docker-compose up -d --build
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Services prüfen
|
|
||||||
```bash
|
|
||||||
docker-compose ps
|
|
||||||
```
|
|
||||||
**Erwartet:** Beide Services (web, wiki) sollten "Up" zeigen
|
|
||||||
|
|
||||||
### 3. Wiki-Service-Logs prüfen
|
|
||||||
```bash
|
|
||||||
docker-compose logs wiki --tail=50
|
|
||||||
```
|
|
||||||
**Erwartet:** "Build complete. Starting server on port 8080..."
|
|
||||||
|
|
||||||
### 4. API-Route testen
|
|
||||||
```bash
|
|
||||||
curl https://doing-it.de/api/wiki/
|
|
||||||
```
|
|
||||||
**Erwartet:** HTML-Inhalt des Wikis, nicht 404
|
|
||||||
|
|
||||||
### 5. Wiki-Seite testen
|
|
||||||
Browser: `https://doing-it.de/wiki`
|
|
||||||
**Erwartet:** Wiki wird im iframe angezeigt
|
|
||||||
|
|
||||||
## 🐛 Troubleshooting
|
|
||||||
|
|
||||||
### Problem: 404 auf /wiki
|
|
||||||
|
|
||||||
**Schritt 1:** Prüfe ob Wiki-Service läuft
|
|
||||||
```bash
|
|
||||||
docker-compose ps wiki
|
|
||||||
docker-compose logs wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
**Schritt 2:** Prüfe ob API-Route erreichbar ist
|
|
||||||
```bash
|
|
||||||
curl https://doing-it.de/api/wiki/
|
|
||||||
```
|
|
||||||
|
|
||||||
**Schritt 3:** Prüfe interne Kommunikation
|
|
||||||
```bash
|
|
||||||
docker-compose exec web curl http://wiki:8080/
|
|
||||||
```
|
|
||||||
|
|
||||||
**Schritt 4:** Prüfe Environment-Variable
|
|
||||||
```bash
|
|
||||||
docker-compose exec web printenv WIKI_SERVICE_URL
|
|
||||||
```
|
|
||||||
Sollte sein: `http://wiki:8080`
|
|
||||||
|
|
||||||
**Schritt 5:** Prüfe Next.js Logs
|
|
||||||
```bash
|
|
||||||
docker-compose logs web | grep -i wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### Problem: Wiki lädt nicht im iframe
|
|
||||||
|
|
||||||
**Lösung 1:** Prüfe Browser-Konsole (F12) auf Fehler
|
|
||||||
|
|
||||||
**Lösung 2:** Prüfe ob API-Route HTML zurückgibt
|
|
||||||
```bash
|
|
||||||
curl -I https://doing-it.de/api/wiki/
|
|
||||||
```
|
|
||||||
|
|
||||||
**Lösung 3:** Prüfe CORS-Header (sollte bereits gesetzt sein)
|
|
||||||
|
|
||||||
## 📝 Wichtige Konfiguration
|
|
||||||
|
|
||||||
### docker-compose.yml sollte enthalten:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
web:
|
|
||||||
environment:
|
|
||||||
- WIKI_SERVICE_URL=http://wiki:8080
|
|
||||||
depends_on:
|
|
||||||
- wiki
|
|
||||||
|
|
||||||
wiki:
|
|
||||||
expose:
|
|
||||||
- "8080"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Environment-Variable
|
|
||||||
|
|
||||||
Die `WIKI_SERVICE_URL` muss auf `http://wiki:8080` gesetzt sein (Docker-Service-Name, nicht localhost!).
|
|
||||||
|
|
||||||
## ✅ Nach erfolgreichem Deployment
|
|
||||||
|
|
||||||
- [ ] Wiki ist unter https://doing-it.de/wiki erreichbar
|
|
||||||
- [ ] Navigation-Link funktioniert
|
|
||||||
- [ ] Wiki-Inhalte werden angezeigt
|
|
||||||
- [ ] Keine 404-Fehler
|
|
||||||
- [ ] Keine Fehler in Browser-Konsole
|
|
||||||
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
# Quartz Setup auf dem Server
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Diese Anleitung beschreibt, wie Sie Quartz als separate Instanz auf Port 3033 auf Ihrem Server einrichten.
|
|
||||||
|
|
||||||
## Optionen für Quartz-Instanz
|
|
||||||
|
|
||||||
### Option 1: Quartz direkt auf dem Host (Empfohlen)
|
|
||||||
|
|
||||||
Quartz läuft direkt auf dem Server-Host auf Port 3033:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Quartz starten
|
|
||||||
cd /path/to/quartz
|
|
||||||
npx quartz build
|
|
||||||
npx serve -s public -l 3033
|
|
||||||
```
|
|
||||||
|
|
||||||
**Konfiguration:** `NEXT_PUBLIC_WIKI_URL=http://localhost:3033`
|
|
||||||
|
|
||||||
### Option 2: Quartz in separatem Docker-Container
|
|
||||||
|
|
||||||
Quartz läuft in einem eigenen Container:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
# docker-compose.wiki.yml
|
|
||||||
services:
|
|
||||||
quartz:
|
|
||||||
image: your-quartz-image
|
|
||||||
ports:
|
|
||||||
- "3033:3033"
|
|
||||||
volumes:
|
|
||||||
- ./wiki-vault:/app/content
|
|
||||||
- ./wiki-public:/app/public
|
|
||||||
```
|
|
||||||
|
|
||||||
**Konfiguration:**
|
|
||||||
- Für Browser (iframe): `NEXT_PUBLIC_WIKI_URL=http://localhost:3033`
|
|
||||||
- Falls Next.js-Container zugreift: `NEXT_PUBLIC_WIKI_URL=http://host.docker.internal:3033`
|
|
||||||
|
|
||||||
### Option 3: Quartz im Docker-Netzwerk
|
|
||||||
|
|
||||||
Beide Container im gleichen Netzwerk:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Netzwerk erstellen
|
|
||||||
docker network create wiki-network
|
|
||||||
|
|
||||||
# Next.js Container
|
|
||||||
docker-compose up -d
|
|
||||||
docker network connect wiki-network doing-it-web-1
|
|
||||||
|
|
||||||
# Quartz Container
|
|
||||||
docker run -d --name quartz --network wiki-network -p 3033:3033 your-quartz-image
|
|
||||||
```
|
|
||||||
|
|
||||||
**Konfiguration:** `NEXT_PUBLIC_WIKI_URL=http://quartz:3033`
|
|
||||||
|
|
||||||
## Wichtiger Hinweis
|
|
||||||
|
|
||||||
Da das iframe **client-side** im Browser läuft (nicht im Container), verwendet es die URL so wie sie gesetzt ist:
|
|
||||||
- **`localhost:3033`** funktioniert, wenn Quartz auf dem Host läuft
|
|
||||||
- **`host.docker.internal:3033`** funktioniert nur von einem Container aus, NICHT vom Browser
|
|
||||||
- Für Browser muss die **öffentliche URL** verwendet werden (z.B. `http://doing-it.de:3033` oder über Reverse Proxy)
|
|
||||||
|
|
||||||
## Reverse Proxy Setup (Empfohlen für Produktion)
|
|
||||||
|
|
||||||
### Mit Nginx
|
|
||||||
|
|
||||||
```nginx
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name wiki.doing-it.de;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://localhost:3033;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Dann:** `NEXT_PUBLIC_WIKI_URL=http://wiki.doing-it.de`
|
|
||||||
|
|
||||||
### Oder Subpath
|
|
||||||
|
|
||||||
```nginx
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name doing-it.de;
|
|
||||||
|
|
||||||
location /wiki-content/ {
|
|
||||||
proxy_pass http://localhost:3033/;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Environment-Variable setzen
|
|
||||||
|
|
||||||
### In docker-compose.yml (bereits konfiguriert)
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
environment:
|
|
||||||
- NEXT_PUBLIC_WIKI_URL=${NEXT_PUBLIC_WIKI_URL:-http://localhost:3033}
|
|
||||||
```
|
|
||||||
|
|
||||||
### In .env Datei
|
|
||||||
|
|
||||||
```bash
|
|
||||||
NEXT_PUBLIC_WIKI_URL=http://localhost:3033
|
|
||||||
```
|
|
||||||
|
|
||||||
### Bei Container-Start
|
|
||||||
|
|
||||||
```bash
|
|
||||||
NEXT_PUBLIC_WIKI_URL=http://localhost:3033 docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
1. Quartz starten auf Port 3033
|
|
||||||
2. Prüfen: `curl http://localhost:3033`
|
|
||||||
3. Next.js starten
|
|
||||||
4. Wiki-Seite öffnen: `http://localhost:3001/wiki`
|
|
||||||
5. Browser-Entwicklertools (F12) öffnen und prüfen, ob iframe geladen wird
|
|
||||||
|
|
||||||
159
WIKI-404-FIX.md
159
WIKI-404-FIX.md
@@ -1,159 +0,0 @@
|
|||||||
# Wiki 404 Error - Fix Dokumentation
|
|
||||||
|
|
||||||
## Problem
|
|
||||||
Beim Klick auf den Wiki-Link in der Navbar erscheint ein 404-Fehler auf https://doing-it.de/wiki
|
|
||||||
|
|
||||||
## Implementierte Fixes
|
|
||||||
|
|
||||||
### 1. Root-API-Route hinzugefügt
|
|
||||||
- **Datei**: `app/api/wiki/route.ts`
|
|
||||||
- Behandelt direkte Aufrufe zu `/api/wiki` ohne weiteren Pfad
|
|
||||||
- Wichtig für das iframe, das `/api/wiki/` lädt
|
|
||||||
|
|
||||||
### 2. Verbessertes Error-Handling
|
|
||||||
- Logging für alle Requests
|
|
||||||
- 10 Sekunden Timeout für Wiki-Service-Requests
|
|
||||||
- Bessere Fehlermeldungen mit Status-Codes
|
|
||||||
|
|
||||||
### 3. URL-Handling verbessert
|
|
||||||
- Keine doppelten Slashes mehr
|
|
||||||
- Korrekte Query-Parameter-Weiterleitung
|
|
||||||
|
|
||||||
### 4. Next.js 15 Compatibility
|
|
||||||
- Async params in Catch-All-Route
|
|
||||||
- Verbesserte Type-Sicherheit
|
|
||||||
|
|
||||||
### 5. Fehleranzeige in Wiki-Seite
|
|
||||||
- Zeigt Fehlermeldung, falls Wiki nicht lädt
|
|
||||||
- Button zum Neuladen der Seite
|
|
||||||
|
|
||||||
## Mögliche Ursachen des 404-Fehlers
|
|
||||||
|
|
||||||
### 1. Wiki-Service läuft nicht
|
|
||||||
**Prüfung:**
|
|
||||||
```bash
|
|
||||||
docker-compose ps
|
|
||||||
docker-compose logs wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
**Lösung:**
|
|
||||||
```bash
|
|
||||||
docker-compose up -d wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Wiki-Service nicht erreichbar über Docker-Netzwerk
|
|
||||||
**Prüfung:**
|
|
||||||
```bash
|
|
||||||
docker-compose exec web curl http://wiki:8080/
|
|
||||||
```
|
|
||||||
|
|
||||||
**Lösung:**
|
|
||||||
- Stelle sicher, dass beide Services im gleichen Docker-Netzwerk sind
|
|
||||||
- Prüfe `docker-compose.yml` - beide Services sollten dort definiert sein
|
|
||||||
|
|
||||||
### 3. Environment-Variable falsch gesetzt
|
|
||||||
**Prüfung:**
|
|
||||||
```bash
|
|
||||||
docker-compose exec web printenv WIKI_SERVICE_URL
|
|
||||||
```
|
|
||||||
|
|
||||||
**Sollte sein:** `http://wiki:8080`
|
|
||||||
|
|
||||||
**Lösung:** In `docker-compose.yml` hinzufügen:
|
|
||||||
```yaml
|
|
||||||
web:
|
|
||||||
environment:
|
|
||||||
- WIKI_SERVICE_URL=http://wiki:8080
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. API-Route nicht deployed
|
|
||||||
**Prüfung:**
|
|
||||||
- Prüfe, ob `app/api/wiki/route.ts` im Deployment vorhanden ist
|
|
||||||
- Prüfe Next.js Build-Logs
|
|
||||||
|
|
||||||
**Lösung:**
|
|
||||||
- Stelle sicher, dass die Datei committed ist
|
|
||||||
- Rebuild des Next.js Images: `docker-compose build web`
|
|
||||||
|
|
||||||
### 5. Production Dockerfile verwendet
|
|
||||||
**Prüfung:**
|
|
||||||
```bash
|
|
||||||
# Prüfe, welches Dockerfile verwendet wird
|
|
||||||
cat docker-compose.yml | grep dockerfile
|
|
||||||
```
|
|
||||||
|
|
||||||
**Lösung:**
|
|
||||||
- Stelle sicher, dass in Produktion auch die richtige Dockerfile verwendet wird
|
|
||||||
- Oder passe die Production-Dockerfile an
|
|
||||||
|
|
||||||
## Debugging-Schritte
|
|
||||||
|
|
||||||
### Schritt 1: Services prüfen
|
|
||||||
```bash
|
|
||||||
docker-compose ps
|
|
||||||
```
|
|
||||||
Sollte zeigen:
|
|
||||||
- `web` - Status: Up
|
|
||||||
- `wiki` - Status: Up
|
|
||||||
|
|
||||||
### Schritt 2: Wiki-Service-Logs prüfen
|
|
||||||
```bash
|
|
||||||
docker-compose logs wiki --tail=50
|
|
||||||
```
|
|
||||||
Suche nach Fehlermeldungen oder "Build complete"
|
|
||||||
|
|
||||||
### Schritt 3: API-Route direkt testen
|
|
||||||
```bash
|
|
||||||
curl https://doing-it.de/api/wiki/
|
|
||||||
```
|
|
||||||
Oder im Browser: `https://doing-it.de/api/wiki/`
|
|
||||||
|
|
||||||
Sollte HTML zurückgeben, nicht 404.
|
|
||||||
|
|
||||||
### Schritt 4: Internen Service-Zugriff testen
|
|
||||||
```bash
|
|
||||||
docker-compose exec web curl http://wiki:8080/
|
|
||||||
```
|
|
||||||
Sollte HTML zurückgeben.
|
|
||||||
|
|
||||||
### Schritt 5: Next.js Logs prüfen
|
|
||||||
```bash
|
|
||||||
docker-compose logs web --tail=100 | grep -i wiki
|
|
||||||
```
|
|
||||||
Suche nach Fehlermeldungen wie "Wiki proxy error"
|
|
||||||
|
|
||||||
## Quick Fix
|
|
||||||
|
|
||||||
Falls das Problem weiterhin besteht, versuche:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. Alle Services neu starten
|
|
||||||
docker-compose down
|
|
||||||
docker-compose up -d --build
|
|
||||||
|
|
||||||
# 2. Logs beobachten
|
|
||||||
docker-compose logs -f
|
|
||||||
|
|
||||||
# 3. Prüfen ob beide Services laufen
|
|
||||||
docker-compose ps
|
|
||||||
```
|
|
||||||
|
|
||||||
## Wichtig für Produktion
|
|
||||||
|
|
||||||
1. **Stelle sicher, dass beide Services im docker-compose.yml sind**
|
|
||||||
2. **Stelle sicher, dass WIKI_SERVICE_URL gesetzt ist**
|
|
||||||
3. **Stelle sicher, dass die API-Routes im Build enthalten sind**
|
|
||||||
4. **Prüfe die Next.js Build-Logs auf Warnungen**
|
|
||||||
|
|
||||||
## Alternative: Direkter Link (Fallback)
|
|
||||||
|
|
||||||
Falls das iframe weiterhin Probleme macht, kann die Wiki-Seite so geändert werden, dass sie direkt auf `/api/wiki` verlinkt statt ein iframe zu verwenden. Dies erfordert eine Änderung in `app/wiki/page.tsx`.
|
|
||||||
|
|
||||||
## Nächste Schritte nach Deployment
|
|
||||||
|
|
||||||
1. ✅ API-Routes aktualisiert
|
|
||||||
2. ✅ Error-Handling verbessert
|
|
||||||
3. ⏳ Services neu starten
|
|
||||||
4. ⏳ Logs prüfen
|
|
||||||
5. ⏳ Testen auf https://doing-it.de/wiki
|
|
||||||
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
# Wiki Externe Instanz Setup
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Das Wiki läuft jetzt als separate Instanz auf Port 3033 und wird direkt im iframe eingebunden. Dies erfordert keine Docker-Compose-Integration mehr.
|
|
||||||
|
|
||||||
## Konfiguration
|
|
||||||
|
|
||||||
### Umgebungsvariable
|
|
||||||
|
|
||||||
Die Wiki-URL kann über die Umgebungsvariable `NEXT_PUBLIC_WIKI_URL` konfiguriert werden:
|
|
||||||
|
|
||||||
**Standard:** `http://localhost:3033`
|
|
||||||
|
|
||||||
### Lokale Entwicklung
|
|
||||||
|
|
||||||
In der lokalen Entwicklung wird automatisch `http://localhost:3033` verwendet.
|
|
||||||
|
|
||||||
### Produktion
|
|
||||||
|
|
||||||
Für die Produktion kann die URL in `docker-compose.yml` oder über eine `.env`-Datei gesetzt werden:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
environment:
|
|
||||||
- NEXT_PUBLIC_WIKI_URL=http://localhost:3033
|
|
||||||
```
|
|
||||||
|
|
||||||
Oder in einer `.env.local` Datei:
|
|
||||||
```
|
|
||||||
NEXT_PUBLIC_WIKI_URL=http://localhost:3033
|
|
||||||
```
|
|
||||||
|
|
||||||
## Docker-Netzwerk Setup
|
|
||||||
|
|
||||||
### Separate Quartz-Instanz auf dem Server
|
|
||||||
|
|
||||||
1. **Quartz-Instanz starten** auf Port 3033:
|
|
||||||
```bash
|
|
||||||
# Beispiel: Quartz auf Port 3033 starten
|
|
||||||
npx quartz build
|
|
||||||
npx serve -s public -l 3033
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Docker-Netzwerk verbinden** (optional):
|
|
||||||
```bash
|
|
||||||
# Netzwerk erstellen
|
|
||||||
docker network create wiki-network
|
|
||||||
|
|
||||||
# Quartz-Container an Netzwerk anhängen
|
|
||||||
docker network connect wiki-network your-quartz-container
|
|
||||||
|
|
||||||
# Next.js Container an Netzwerk anhängen
|
|
||||||
docker network connect wiki-network doing-it-web-container
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **URL anpassen** falls nötig:
|
|
||||||
- Falls Quartz in einem Container läuft: `http://quartz-container-name:3033`
|
|
||||||
- Falls Quartz direkt auf dem Host läuft: `http://host.docker.internal:3033` (Docker Desktop)
|
|
||||||
- Falls Quartz extern läuft: `http://localhost:3033` oder absolute URL
|
|
||||||
|
|
||||||
## Docker Compose Anpassung
|
|
||||||
|
|
||||||
Der Wiki-Service in `docker-compose.yml` ist jetzt optional. Falls Sie die separate Instanz verwenden:
|
|
||||||
|
|
||||||
1. **Wiki-Service auskommentieren** (bereits erledigt in `depends_on`)
|
|
||||||
2. Oder **Wiki-Service komplett entfernen** aus docker-compose.yml, falls nicht mehr benötigt
|
|
||||||
|
|
||||||
### Optionale Wiki-Service Entfernung
|
|
||||||
|
|
||||||
Falls Sie den Wiki-Service komplett aus docker-compose.yml entfernen möchten:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
web:
|
|
||||||
# ... bleibt gleich
|
|
||||||
# depends_on und WIKI_SERVICE_URL können entfernt werden
|
|
||||||
|
|
||||||
# wiki: Service kann komplett entfernt werden
|
|
||||||
```
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
1. **Quartz-Instanz starten** auf Port 3033
|
|
||||||
2. **Next.js starten**:
|
|
||||||
```bash
|
|
||||||
docker-compose up -d web
|
|
||||||
```
|
|
||||||
3. **Wiki-Seite öffnen**: `http://localhost:3001/wiki`
|
|
||||||
4. **Prüfen**: iframe sollte das Wiki von `http://localhost:3033` laden
|
|
||||||
|
|
||||||
## Vorteile
|
|
||||||
|
|
||||||
✅ **Einfachere Wartung**: Quartz kann separat verwaltet werden
|
|
||||||
✅ **Unabhängige Skalierung**: Wiki und Website können unabhängig skaliert werden
|
|
||||||
✅ **Einfachere Updates**: Quartz kann ohne Neustart der Website aktualisiert werden
|
|
||||||
✅ **Flexibilität**: Wiki kann auch extern gehostet werden
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Problem: iframe lädt nicht
|
|
||||||
|
|
||||||
**Lösung 1:** Prüfen ob Quartz auf Port 3033 läuft
|
|
||||||
```bash
|
|
||||||
curl http://localhost:3033
|
|
||||||
```
|
|
||||||
|
|
||||||
**Lösung 2:** CORS-Header prüfen
|
|
||||||
- Quartz sollte CORS-Header erlauben
|
|
||||||
- Oder Next.js als Proxy verwenden (alte Lösung)
|
|
||||||
|
|
||||||
**Lösung 3:** URL anpassen
|
|
||||||
- Prüfen ob `NEXT_PUBLIC_WIKI_URL` korrekt gesetzt ist
|
|
||||||
- Für Container: `host.docker.internal:3033` verwenden
|
|
||||||
|
|
||||||
### Problem: Wiki nicht erreichbar aus Container
|
|
||||||
|
|
||||||
**Lösung:**
|
|
||||||
- `host.docker.internal:3033` statt `localhost:3033` verwenden
|
|
||||||
- Oder Docker-Netzwerk verwenden
|
|
||||||
|
|
||||||
81
WIKI-FIX.md
81
WIKI-FIX.md
@@ -1,81 +0,0 @@
|
|||||||
# Wiki 404 Error - Fix Dokumentation
|
|
||||||
|
|
||||||
## Problem
|
|
||||||
|
|
||||||
Beim Klick auf den Wiki-Link in der Navbar erscheint ein 404-Fehler auf https://doing-it.de/wiki
|
|
||||||
|
|
||||||
## Mögliche Ursachen
|
|
||||||
|
|
||||||
1. **API-Route nicht gefunden**: Die API-Route `/api/wiki/*` wird möglicherweise nicht korrekt deployed
|
|
||||||
2. **Wiki-Service nicht erreichbar**: Der Wiki-Service läuft möglicherweise nicht oder ist nicht über das Docker-Netzwerk erreichbar
|
|
||||||
3. **Next.js 14/15 Route-Handling**: Probleme mit async params in Next.js 14+
|
|
||||||
|
|
||||||
## Implementierte Fixes
|
|
||||||
|
|
||||||
### 1. Root-Route für `/api/wiki` hinzugefügt
|
|
||||||
- Neue Datei: `app/api/wiki/route.ts`
|
|
||||||
- Behandelt direkte Aufrufe zu `/api/wiki` ohne Pfad
|
|
||||||
|
|
||||||
### 2. Verbessertes Error-Handling
|
|
||||||
- Bessere Fehlermeldungen in den API-Routes
|
|
||||||
- Logging für Debugging
|
|
||||||
- Fehleranzeige in der Wiki-Seite, falls das Wiki nicht lädt
|
|
||||||
|
|
||||||
### 3. Next.js 15 Compatibility
|
|
||||||
- Async params in Catch-All-Route
|
|
||||||
- Verbesserte Type-Definitionen
|
|
||||||
|
|
||||||
### 4. Trailing Slash
|
|
||||||
- Wiki-URL verwendet jetzt `/api/wiki/` mit trailing slash
|
|
||||||
|
|
||||||
## Debugging-Schritte
|
|
||||||
|
|
||||||
### 1. Prüfen ob Wiki-Service läuft
|
|
||||||
```bash
|
|
||||||
docker-compose ps
|
|
||||||
docker-compose logs wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Prüfen ob API-Route erreichbar ist
|
|
||||||
Direkt im Browser oder mit curl:
|
|
||||||
```bash
|
|
||||||
curl https://doing-it.de/api/wiki/
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Prüfen ob Wiki-Service intern erreichbar ist
|
|
||||||
```bash
|
|
||||||
docker-compose exec web curl http://wiki:8080/
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Environment-Variable prüfen
|
|
||||||
Stelle sicher, dass `WIKI_SERVICE_URL` korrekt gesetzt ist:
|
|
||||||
```bash
|
|
||||||
docker-compose exec web printenv WIKI_SERVICE_URL
|
|
||||||
```
|
|
||||||
|
|
||||||
## Alternative Lösung: Next.js Rewrite
|
|
||||||
|
|
||||||
Falls die API-Route weiterhin Probleme macht, kann ein Next.js Rewrite verwendet werden:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// next.config.js
|
|
||||||
async rewrites() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
source: '/api/wiki/:path*',
|
|
||||||
destination: 'http://wiki:8080/:path*',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Dies funktioniert nur server-side und ist möglicherweise zuverlässiger.
|
|
||||||
|
|
||||||
## Nächste Schritte
|
|
||||||
|
|
||||||
1. ✅ Root-Route hinzugefügt
|
|
||||||
2. ✅ Error-Handling verbessert
|
|
||||||
3. ✅ Next.js 15 Compatibility
|
|
||||||
4. ⏳ Testing in Produktion
|
|
||||||
5. ⏳ Bei Bedarf: Rewrite statt API-Route verwenden
|
|
||||||
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
# Wiki Proxy Setup - Dokumentation
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Das Wiki ist jetzt so konfiguriert, dass es über die Domain `doing-it.de/wiki` erreichbar ist, ohne dass Port 8080 nach außen exponiert werden muss. Dies wird durch einen Next.js API-Route-Proxy erreicht.
|
|
||||||
|
|
||||||
## Architektur
|
|
||||||
|
|
||||||
```
|
|
||||||
Browser → doing-it.de/wiki → Next.js (/wiki page) → iframe → /api/wiki/* → Wiki-Service (intern)
|
|
||||||
```
|
|
||||||
|
|
||||||
1. **Browser** greift auf `doing-it.de/wiki` zu
|
|
||||||
2. **Next.js Wiki-Seite** (`app/wiki/page.tsx`) zeigt das Wiki als iframe
|
|
||||||
3. **iframe** lädt `/api/wiki/*` (Next.js API-Route)
|
|
||||||
4. **API-Route** (`app/api/wiki/[...path]/route.ts`) leitet Requests an den internen Wiki-Service weiter
|
|
||||||
5. **Wiki-Service** läuft nur im Docker-Netzwerk, Port 8080 ist nicht nach außen exponiert
|
|
||||||
|
|
||||||
## Änderungen
|
|
||||||
|
|
||||||
### 1. Docker Compose (`docker-compose.yml`)
|
|
||||||
- Wiki-Service verwendet jetzt `expose` statt `ports`
|
|
||||||
- Port 8080 ist nur im Docker-Netzwerk erreichbar, nicht von außen
|
|
||||||
- Kommunikation zwischen Services erfolgt über Service-Namen (`wiki:8080`)
|
|
||||||
|
|
||||||
### 2. Next.js API-Route (`app/api/wiki/[...path]/route.ts`)
|
|
||||||
- Proxied alle Requests an den Wiki-Service
|
|
||||||
- Unterstützt alle HTTP-Methoden (GET, POST, PUT, DELETE)
|
|
||||||
- Weiterleitung von Headers und Query-Parametern
|
|
||||||
|
|
||||||
### 3. Wiki-Seite (`app/wiki/page.tsx`)
|
|
||||||
- Zeigt das Wiki als iframe
|
|
||||||
- Lädt über `/api/wiki` (API-Route)
|
|
||||||
- Enthält Navigation zurück zur Website
|
|
||||||
|
|
||||||
### 4. Navigation
|
|
||||||
- Link zu `/wiki` wurde bereits hinzugefügt
|
|
||||||
- Führt direkt zur Wiki-Seite mit eingebettetem Wiki
|
|
||||||
|
|
||||||
## Vorteile
|
|
||||||
|
|
||||||
✅ **Sicherheit**: Port 8080 ist nicht nach außen exponiert
|
|
||||||
✅ **Einheitliche Domain**: Alles über `doing-it.de`
|
|
||||||
✅ **Einfache Integration**: Wiki ist nahtlos in die Website eingebettet
|
|
||||||
✅ **Proxy-Funktionalität**: Alle Wiki-Ressourcen (CSS, JS, Bilder) werden korrekt weitergeleitet
|
|
||||||
|
|
||||||
## Konfiguration
|
|
||||||
|
|
||||||
### Environment Variables
|
|
||||||
|
|
||||||
Die API-Route verwendet die Umgebungsvariable `WIKI_SERVICE_URL`:
|
|
||||||
- **Standard**: `http://wiki:8080` (Docker-Service-Name)
|
|
||||||
- **Anpassung**: Kann in `docker-compose.yml` gesetzt werden
|
|
||||||
|
|
||||||
### Docker Compose
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
wiki:
|
|
||||||
expose:
|
|
||||||
- "8080" # Nur intern, nicht nach außen
|
|
||||||
```
|
|
||||||
|
|
||||||
Die Services kommunizieren automatisch über das Docker-Netzwerk.
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
### Lokales Testen
|
|
||||||
|
|
||||||
1. Services starten:
|
|
||||||
```powershell
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Wiki-Seite öffnen:
|
|
||||||
```
|
|
||||||
http://localhost:3001/wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
3. API-Route direkt testen:
|
|
||||||
```
|
|
||||||
http://localhost:3001/api/wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### Produktion
|
|
||||||
|
|
||||||
Nach dem Deployment hinter einem Reverse Proxy (z.B. Nginx):
|
|
||||||
- Wiki ist erreichbar über `https://doing-it.de/wiki`
|
|
||||||
- Kein direkter Zugriff auf Port 8080 erforderlich
|
|
||||||
- Alle Requests gehen über die Next.js-Anwendung
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### Problem: Wiki lädt nicht im iframe
|
|
||||||
|
|
||||||
**Lösung**:
|
|
||||||
- Prüfen Sie die Browser-Konsole auf Fehler
|
|
||||||
- Überprüfen Sie, ob der Wiki-Service läuft: `docker-compose ps`
|
|
||||||
- Prüfen Sie die API-Route-Logs: `docker-compose logs web`
|
|
||||||
|
|
||||||
### Problem: CORS-Fehler
|
|
||||||
|
|
||||||
**Lösung**:
|
|
||||||
- Die API-Route setzt bereits `Access-Control-Allow-Origin: *`
|
|
||||||
- Falls weitere CORS-Header benötigt werden, in `route.ts` hinzufügen
|
|
||||||
|
|
||||||
### Problem: Wiki-Service nicht erreichbar
|
|
||||||
|
|
||||||
**Lösung**:
|
|
||||||
- Überprüfen Sie, ob beide Services im gleichen Docker-Netzwerk sind
|
|
||||||
- Prüfen Sie die Service-Namen in `docker-compose.yml`
|
|
||||||
- Testen Sie die interne Kommunikation: `docker-compose exec web ping wiki`
|
|
||||||
|
|
||||||
## Nächste Schritte
|
|
||||||
|
|
||||||
1. ✅ Wiki über Proxy erreichbar
|
|
||||||
2. ✅ Port 8080 nicht mehr exponiert
|
|
||||||
3. ✅ Einheitliche Domain (`doing-it.de/wiki`)
|
|
||||||
4. Optional: Reverse Proxy (Nginx/Traefik) für HTTPS und Domain-Routing konfigurieren
|
|
||||||
|
|
||||||
147
WIKI-SETUP.md
147
WIKI-SETUP.md
@@ -1,147 +0,0 @@
|
|||||||
# Wiki Setup mit Obsidian Quartz
|
|
||||||
|
|
||||||
## Übersicht
|
|
||||||
|
|
||||||
Das Wiki wurde erfolgreich in die doing-it.de Website integriert. Es verwendet Obsidian Quartz als statischen Site-Generator und läuft als Docker-Container.
|
|
||||||
|
|
||||||
## Struktur
|
|
||||||
|
|
||||||
```
|
|
||||||
doing-it.de/
|
|
||||||
├── wiki-vault/ # Obsidian Vault mit Markdown-Dateien
|
|
||||||
│ ├── Home.md
|
|
||||||
│ ├── IT-Grundlagen.md
|
|
||||||
│ ├── Schulungsmethoden.md
|
|
||||||
│ └── Ressourcen.md
|
|
||||||
├── quartz-setup/ # Quartz Docker Setup
|
|
||||||
│ ├── Dockerfile
|
|
||||||
│ ├── entrypoint.sh
|
|
||||||
│ ├── package.json
|
|
||||||
│ └── quartz.config.ts
|
|
||||||
├── app/wiki/ # Next.js Wiki-Seite
|
|
||||||
│ └── page.tsx
|
|
||||||
└── docker-compose.yml # Erweitert um Wiki-Service
|
|
||||||
```
|
|
||||||
|
|
||||||
## Was wurde implementiert
|
|
||||||
|
|
||||||
### 1. Obsidian Vault (`wiki-vault/`)
|
|
||||||
- Enthält Beispiel-Markdown-Dateien
|
|
||||||
- Kann durch eigene Obsidian-Vault-Dateien ersetzt werden
|
|
||||||
|
|
||||||
### 2. Quartz Docker Setup (`quartz-setup/`)
|
|
||||||
- Dockerfile: Klont Quartz Repository und richtet es ein
|
|
||||||
- entrypoint.sh: Baut die Quartz-Site und startet den Server
|
|
||||||
- Fallback: Erstellt einfache statische Site, falls Quartz-Build fehlschlägt
|
|
||||||
|
|
||||||
### 3. Docker Compose Service
|
|
||||||
- Service `wiki` läuft auf Port 8080
|
|
||||||
- Bindet `wiki-vault` als Volume ein
|
|
||||||
- Build-Output in `quartz-setup/public`
|
|
||||||
|
|
||||||
### 4. Next.js Integration
|
|
||||||
- Neue Seite unter `/wiki`
|
|
||||||
- Wiki-Link in Navigation (Desktop & Mobile)
|
|
||||||
- Link zur Quartz-Instanz auf Port 8080
|
|
||||||
|
|
||||||
## Testing & Debugging in PowerShell
|
|
||||||
|
|
||||||
### 1. Docker Compose Validierung
|
|
||||||
```powershell
|
|
||||||
docker-compose config
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Wiki-Service bauen
|
|
||||||
```powershell
|
|
||||||
docker-compose build wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Alle Services starten
|
|
||||||
```powershell
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Logs prüfen
|
|
||||||
```powershell
|
|
||||||
# Alle Logs
|
|
||||||
docker-compose logs
|
|
||||||
|
|
||||||
# Nur Wiki-Logs
|
|
||||||
docker-compose logs wiki
|
|
||||||
|
|
||||||
# Follow Logs (Live)
|
|
||||||
docker-compose logs -f wiki
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Container-Status prüfen
|
|
||||||
```powershell
|
|
||||||
docker-compose ps
|
|
||||||
docker ps -a
|
|
||||||
```
|
|
||||||
|
|
||||||
### 6. In Container einsteigen (falls nötig)
|
|
||||||
```powershell
|
|
||||||
docker-compose exec wiki sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### 7. Services stoppen
|
|
||||||
```powershell
|
|
||||||
docker-compose down
|
|
||||||
```
|
|
||||||
|
|
||||||
### 8. Alles neu bauen
|
|
||||||
```powershell
|
|
||||||
docker-compose down
|
|
||||||
docker-compose build --no-cache
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
## Erwartete Ports
|
|
||||||
|
|
||||||
- **Next.js Web**: http://localhost:3001
|
|
||||||
- **Wiki (Quartz)**: http://localhost:8080
|
|
||||||
|
|
||||||
## Häufige Probleme
|
|
||||||
|
|
||||||
### Problem: Quartz Build schlägt fehl
|
|
||||||
**Lösung**: Der Entrypoint-Script erstellt automatisch einen Fallback mit einfacher HTML-Seite. Die Markdown-Dateien werden trotzdem angezeigt.
|
|
||||||
|
|
||||||
### Problem: Port 8080 bereits belegt
|
|
||||||
**Lösung**: Port in `docker-compose.yml` ändern:
|
|
||||||
```yaml
|
|
||||||
ports:
|
|
||||||
- "8081:8080" # Ändere 8081 zu gewünschtem Port
|
|
||||||
```
|
|
||||||
|
|
||||||
### Problem: Container startet nicht
|
|
||||||
**Lösung**:
|
|
||||||
1. Logs prüfen: `docker-compose logs wiki`
|
|
||||||
2. Container neu bauen: `docker-compose build --no-cache wiki`
|
|
||||||
3. Container-Status: `docker ps -a`
|
|
||||||
|
|
||||||
### Problem: Keine Inhalte im Wiki
|
|
||||||
**Lösung**:
|
|
||||||
1. Prüfen ob `wiki-vault` Dateien enthält
|
|
||||||
2. Volume-Mount prüfen: `docker-compose exec wiki ls -la /app/content`
|
|
||||||
3. Container neu starten: `docker-compose restart wiki`
|
|
||||||
|
|
||||||
## Wiki-Inhalte aktualisieren
|
|
||||||
|
|
||||||
1. Markdown-Dateien in `wiki-vault/` bearbeiten oder hinzufügen
|
|
||||||
2. Container neu starten: `docker-compose restart wiki`
|
|
||||||
3. Oder für kompletten Rebuild: `docker-compose up -d --build wiki`
|
|
||||||
|
|
||||||
## Navigation
|
|
||||||
|
|
||||||
Der Wiki-Link wurde zur Navigation hinzugefügt:
|
|
||||||
- Desktop: Zwischen "Über uns" und "Kontakt"
|
|
||||||
- Mobile: Im Hamburger-Menü
|
|
||||||
|
|
||||||
Die Wiki-Seite (`/wiki`) zeigt einen Link zur Quartz-Instanz, der in einem neuen Tab geöffnet wird.
|
|
||||||
|
|
||||||
## Nächste Schritte
|
|
||||||
|
|
||||||
1. Eigene Obsidian-Vault-Dateien in `wiki-vault/` kopieren
|
|
||||||
2. Quartz-Konfiguration in `quartz-setup/quartz.config.ts` anpassen
|
|
||||||
3. Wiki-Styling an Website-Design anpassen (falls gewünscht)
|
|
||||||
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server'
|
|
||||||
|
|
||||||
const WIKI_SERVICE_URL = process.env.WIKI_SERVICE_URL || 'http://wiki:8080'
|
|
||||||
|
|
||||||
export async function GET(
|
|
||||||
request: NextRequest,
|
|
||||||
{ params }: { params: Promise<{ path?: string[] }> }
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
const resolvedParams = await params
|
|
||||||
const path = resolvedParams.path || []
|
|
||||||
const searchParams = request.nextUrl.searchParams.toString()
|
|
||||||
const queryString = searchParams ? `?${searchParams}` : ''
|
|
||||||
const wikiPath = path.length > 0 ? `/${path.join('/')}` : '/'
|
|
||||||
|
|
||||||
// Ensure no double slashes
|
|
||||||
const baseUrl = WIKI_SERVICE_URL.endsWith('/') ? WIKI_SERVICE_URL.slice(0, -1) : WIKI_SERVICE_URL
|
|
||||||
const wikiUrl = `${baseUrl}${wikiPath}${queryString}`
|
|
||||||
|
|
||||||
console.log(`[Wiki Proxy] Fetching: ${wikiUrl}`)
|
|
||||||
|
|
||||||
const response = await fetch(wikiUrl, {
|
|
||||||
headers: {
|
|
||||||
'User-Agent': request.headers.get('user-agent') || 'Next.js',
|
|
||||||
},
|
|
||||||
// Add timeout
|
|
||||||
signal: AbortSignal.timeout(10000), // 10 second timeout
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
console.error(`Wiki service returned ${response.status}: ${response.statusText} for ${wikiUrl}`)
|
|
||||||
return new NextResponse(`Wiki not found: ${response.status} ${response.statusText}`, {
|
|
||||||
status: response.status
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const contentType = response.headers.get('content-type') || 'text/html'
|
|
||||||
const content = await response.text()
|
|
||||||
|
|
||||||
// Pass through headers
|
|
||||||
const headers = new Headers()
|
|
||||||
headers.set('Content-Type', contentType)
|
|
||||||
|
|
||||||
// Handle CORS if needed
|
|
||||||
headers.set('Access-Control-Allow-Origin', '*')
|
|
||||||
|
|
||||||
// Preserve cache headers
|
|
||||||
const cacheControl = response.headers.get('cache-control')
|
|
||||||
if (cacheControl) {
|
|
||||||
headers.set('Cache-Control', cacheControl)
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NextResponse(content, {
|
|
||||||
status: response.status,
|
|
||||||
headers,
|
|
||||||
})
|
|
||||||
} catch (error: any) {
|
|
||||||
console.error('Wiki proxy error:', error)
|
|
||||||
return new NextResponse(`Error loading wiki: ${error.message || 'Unknown error'}`, {
|
|
||||||
status: 500
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle other HTTP methods
|
|
||||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ path?: string[] }> }) {
|
|
||||||
return GET(request, { params })
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function PUT(request: NextRequest, { params }: { params: Promise<{ path?: string[] }> }) {
|
|
||||||
return GET(request, { params })
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function DELETE(request: NextRequest, { params }: { params: Promise<{ path?: string[] }> }) {
|
|
||||||
return GET(request, { params })
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server'
|
|
||||||
|
|
||||||
const WIKI_SERVICE_URL = process.env.WIKI_SERVICE_URL || 'http://wiki:8080'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const searchParams = request.nextUrl.searchParams.toString()
|
|
||||||
const queryString = searchParams ? `?${searchParams}` : ''
|
|
||||||
// Ensure no double slashes
|
|
||||||
const baseUrl = WIKI_SERVICE_URL.endsWith('/') ? WIKI_SERVICE_URL.slice(0, -1) : WIKI_SERVICE_URL
|
|
||||||
const wikiUrl = `${baseUrl}/${queryString}`
|
|
||||||
|
|
||||||
console.log(`[Wiki Proxy] Fetching: ${wikiUrl}`)
|
|
||||||
|
|
||||||
const response = await fetch(wikiUrl, {
|
|
||||||
headers: {
|
|
||||||
'User-Agent': request.headers.get('user-agent') || 'Next.js',
|
|
||||||
},
|
|
||||||
// Add timeout
|
|
||||||
signal: AbortSignal.timeout(10000), // 10 second timeout
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
console.error(`Wiki service returned ${response.status}: ${response.statusText}`)
|
|
||||||
return new NextResponse(`Wiki service error: ${response.status} ${response.statusText}`, {
|
|
||||||
status: response.status
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const contentType = response.headers.get('content-type') || 'text/html'
|
|
||||||
const content = await response.text()
|
|
||||||
|
|
||||||
// Pass through headers
|
|
||||||
const headers = new Headers()
|
|
||||||
headers.set('Content-Type', contentType)
|
|
||||||
|
|
||||||
// Handle CORS if needed
|
|
||||||
headers.set('Access-Control-Allow-Origin', '*')
|
|
||||||
|
|
||||||
// Preserve cache headers
|
|
||||||
const cacheControl = response.headers.get('cache-control')
|
|
||||||
if (cacheControl) {
|
|
||||||
headers.set('Cache-Control', cacheControl)
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NextResponse(content, {
|
|
||||||
status: response.status,
|
|
||||||
headers,
|
|
||||||
})
|
|
||||||
} catch (error: any) {
|
|
||||||
console.error('Wiki proxy error:', error)
|
|
||||||
return new NextResponse(`Error loading wiki: ${error.message || 'Unknown error'}`, {
|
|
||||||
status: 500
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle other HTTP methods
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
return GET(request)
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function PUT(request: NextRequest) {
|
|
||||||
return GET(request)
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function DELETE(request: NextRequest) {
|
|
||||||
return GET(request)
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,204 +1,26 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { motion } from 'framer-motion'
|
import { useEffect } from 'react'
|
||||||
import Navigation from '@/components/Navigation'
|
|
||||||
import Footer from '@/components/Footer'
|
export default function Wiki() {
|
||||||
import { useState, useEffect } from 'react'
|
useEffect(() => {
|
||||||
|
// Redirect to external wiki
|
||||||
export default function Wiki() {
|
window.location.href = 'https://wiki.doing-it.de'
|
||||||
const [showFullPage, setShowFullPage] = useState(true)
|
}, [])
|
||||||
const [iframeError, setIframeError] = useState(false)
|
|
||||||
|
return (
|
||||||
// Wiki URL - konfigurierbar über Umgebungsvariable, Standard: localhost:3033
|
<div style={{
|
||||||
const wikiUrl = process.env.NEXT_PUBLIC_WIKI_URL || 'http://localhost:3033'
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
useEffect(() => {
|
alignItems: 'center',
|
||||||
// Reset error when URL changes
|
height: '100vh',
|
||||||
setIframeError(false)
|
flexDirection: 'column',
|
||||||
}, [wikiUrl])
|
gap: '20px'
|
||||||
|
}}>
|
||||||
if (showFullPage) {
|
<p>Weiterleitung zum Wiki...</p>
|
||||||
// Vollständige Wiki-Seite als iframe
|
<a href="https://wiki.doing-it.de" style={{ color: 'var(--color-primary)' }}>
|
||||||
return (
|
Falls die Weiterleitung nicht funktioniert, klicken Sie hier.
|
||||||
<>
|
</a>
|
||||||
<Navigation />
|
</div>
|
||||||
<main style={{ paddingTop: '52px', height: 'calc(100vh - 52px)', display: 'flex', flexDirection: 'column' }}>
|
)
|
||||||
<div style={{
|
}
|
||||||
position: 'fixed',
|
|
||||||
top: '52px',
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
background: 'rgba(0, 0, 0, 0.9)',
|
|
||||||
padding: '10px 20px',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
zIndex: 999,
|
|
||||||
borderBottom: '1px solid rgba(255, 255, 255, 0.1)'
|
|
||||||
}}>
|
|
||||||
<h2 style={{ fontSize: '18px', fontWeight: '600', margin: 0 }}>doing-it Wiki</h2>
|
|
||||||
<button
|
|
||||||
onClick={() => setShowFullPage(false)}
|
|
||||||
className="btn btn-secondary"
|
|
||||||
style={{ padding: '8px 20px', fontSize: '14px' }}
|
|
||||||
>
|
|
||||||
Zur Übersicht
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{iframeError ? (
|
|
||||||
<div style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
height: '100%',
|
|
||||||
padding: '40px',
|
|
||||||
marginTop: '50px',
|
|
||||||
textAlign: 'center'
|
|
||||||
}}>
|
|
||||||
<h2 style={{ fontSize: '24px', fontWeight: '600', marginBottom: '20px' }}>
|
|
||||||
Wiki konnte nicht geladen werden
|
|
||||||
</h2>
|
|
||||||
<p style={{ color: 'var(--color-text-secondary)', marginBottom: '30px' }}>
|
|
||||||
Bitte versuchen Sie es später erneut oder kontaktieren Sie den Support.
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setIframeError(false)
|
|
||||||
window.location.reload()
|
|
||||||
}}
|
|
||||||
className="btn btn-primary"
|
|
||||||
>
|
|
||||||
Seite neu laden
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<iframe
|
|
||||||
src={wikiUrl}
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
border: 'none',
|
|
||||||
marginTop: '50px',
|
|
||||||
background: '#fff'
|
|
||||||
}}
|
|
||||||
title="doing-it Wiki"
|
|
||||||
onError={() => setIframeError(true)}
|
|
||||||
onLoad={(e) => {
|
|
||||||
// Check if iframe loaded successfully
|
|
||||||
try {
|
|
||||||
const iframe = e.target as HTMLIFrameElement
|
|
||||||
if (iframe.contentDocument?.location.href === 'about:blank') {
|
|
||||||
// Iframe might have error
|
|
||||||
setTimeout(() => setIframeError(true), 3000)
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
// Cross-origin - can't check, assume it's working
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</main>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Übersichtsseite mit Option zum Öffnen des Wikis
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Navigation />
|
|
||||||
<main>
|
|
||||||
<section className="hero">
|
|
||||||
<motion.div
|
|
||||||
initial={{ opacity: 0, y: 20 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
transition={{ duration: 0.8 }}
|
|
||||||
className="hero-content"
|
|
||||||
>
|
|
||||||
<h1 className="hero-title">Wiki</h1>
|
|
||||||
<p className="hero-subtitle">
|
|
||||||
Unser Wissensbereich mit nützlichen Informationen<br />
|
|
||||||
rund um IT-Weiterbildung und Schulungen
|
|
||||||
</p>
|
|
||||||
<div className="hero-buttons" style={{ marginTop: '40px' }}>
|
|
||||||
<button
|
|
||||||
onClick={() => setShowFullPage(true)}
|
|
||||||
className="btn btn-primary"
|
|
||||||
style={{ cursor: 'pointer' }}
|
|
||||||
>
|
|
||||||
Wiki öffnen
|
|
||||||
</button>
|
|
||||||
<a
|
|
||||||
href={wikiUrl}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className="btn btn-secondary"
|
|
||||||
>
|
|
||||||
In neuem Tab öffnen
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</motion.div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section className="features" style={{ paddingTop: '80px' }}>
|
|
||||||
<div className="container">
|
|
||||||
<motion.div
|
|
||||||
initial={{ opacity: 0, y: 20 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
transition={{ duration: 0.8, delay: 0.2 }}
|
|
||||||
>
|
|
||||||
<h2 style={{ fontSize: '48px', fontWeight: '600', marginBottom: '40px', textAlign: 'center' }}>
|
|
||||||
Was finden Sie im Wiki?
|
|
||||||
</h2>
|
|
||||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '30px', marginTop: '60px' }}>
|
|
||||||
<div className="feature-card">
|
|
||||||
<h3 style={{ fontSize: '24px', fontWeight: '600', marginBottom: '16px' }}>
|
|
||||||
IT-Grundlagen
|
|
||||||
</h3>
|
|
||||||
<p style={{ color: 'var(--color-text-secondary)', lineHeight: '1.6' }}>
|
|
||||||
Umfassende Informationen zu grundlegenden IT-Konzepten, Technologien und Best Practices.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="feature-card">
|
|
||||||
<h3 style={{ fontSize: '24px', fontWeight: '600', marginBottom: '16px' }}>
|
|
||||||
Schulungsmethoden
|
|
||||||
</h3>
|
|
||||||
<p style={{ color: 'var(--color-text-secondary)', lineHeight: '1.6' }}>
|
|
||||||
Moderne Ansätze und bewährte Methoden für effektive IT-Schulungen und Weiterbildungen.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="feature-card">
|
|
||||||
<h3 style={{ fontSize: '24px', fontWeight: '600', marginBottom: '16px' }}>
|
|
||||||
Ressourcen
|
|
||||||
</h3>
|
|
||||||
<p style={{ color: 'var(--color-text-secondary)', lineHeight: '1.6' }}>
|
|
||||||
Sammlung von nützlichen Tools, Materialien und weiterführenden Ressourcen.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</motion.div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section className="features" style={{ paddingTop: '80px', paddingBottom: '120px' }}>
|
|
||||||
<div className="container">
|
|
||||||
<motion.div
|
|
||||||
initial={{ opacity: 0, y: 20 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
transition={{ duration: 0.8, delay: 0.4 }}
|
|
||||||
style={{ textAlign: 'center' }}
|
|
||||||
>
|
|
||||||
<h3 style={{ fontSize: '32px', fontWeight: '600', marginBottom: '20px' }}>
|
|
||||||
Bereit loszulegen?
|
|
||||||
</h3>
|
|
||||||
<p style={{ color: 'var(--color-text-secondary)', fontSize: '20px', marginBottom: '40px' }}>
|
|
||||||
Klicken Sie auf den Button oben, um direkt zum Wiki zu gelangen.
|
|
||||||
</p>
|
|
||||||
</motion.div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
<Footer />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ export default function Navigation() {
|
|||||||
<Link href="/ueber-uns" className="nav-link">
|
<Link href="/ueber-uns" className="nav-link">
|
||||||
Über uns
|
Über uns
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/wiki" className="nav-link">
|
<a href="https://wiki.doing-it.de" target="_blank" rel="noopener noreferrer" className="nav-link">
|
||||||
Wiki
|
Wiki
|
||||||
</Link>
|
</a>
|
||||||
<Link href="/kontakt" className="nav-link">
|
<Link href="/kontakt" className="nav-link">
|
||||||
Kontakt
|
Kontakt
|
||||||
</Link>
|
</Link>
|
||||||
@@ -72,9 +72,9 @@ export default function Navigation() {
|
|||||||
<Link href="/ueber-uns" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
<Link href="/ueber-uns" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
||||||
Über uns
|
Über uns
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/wiki" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
<a href="https://wiki.doing-it.de" target="_blank" rel="noopener noreferrer" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
||||||
Wiki
|
Wiki
|
||||||
</Link>
|
</a>
|
||||||
<Link href="/kontakt" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
<Link href="/kontakt" className="nav-mobile-link" onClick={() => setIsOpen(false)}>
|
||||||
Kontakt
|
Kontakt
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -7,29 +7,9 @@ services:
|
|||||||
- "3001:3000"
|
- "3001:3000"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
# Wiki URL - kann über .env oder Umgebungsvariable gesetzt werden
|
|
||||||
# Standard: http://localhost:3033 (für separate Quartz-Instanz)
|
|
||||||
- NEXT_PUBLIC_WIKI_URL=${NEXT_PUBLIC_WIKI_URL:-http://localhost:3033}
|
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
- /app/.next
|
- /app/.next
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# Wiki-Service ist optional - kann entfernt werden, wenn separate Instanz verwendet wird
|
|
||||||
# depends_on:
|
|
||||||
# - wiki
|
|
||||||
|
|
||||||
wiki:
|
|
||||||
build:
|
|
||||||
context: ./quartz-setup
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
# Port nicht nach außen exponiert - nur intern über Docker-Netzwerk erreichbar
|
|
||||||
expose:
|
|
||||||
- "8080"
|
|
||||||
volumes:
|
|
||||||
- ./wiki-vault:/app/content
|
|
||||||
- ./quartz-setup/public:/app/public
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
- QUARTZ_BASE_URL=/wiki
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
# PowerShell script to test and debug the Wiki Docker setup
|
|
||||||
|
|
||||||
Write-Host "=== Testing Wiki Docker Setup ===" -ForegroundColor Green
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "1. Checking Docker installation..." -ForegroundColor Yellow
|
|
||||||
docker --version
|
|
||||||
docker-compose --version
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "2. Validating docker-compose configuration..." -ForegroundColor Yellow
|
|
||||||
docker-compose config
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "3. Building Wiki service..." -ForegroundColor Yellow
|
|
||||||
docker-compose build wiki 2>&1
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "4. Checking for existing containers..." -ForegroundColor Yellow
|
|
||||||
docker ps -a | Select-String "wiki"
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "5. Starting services..." -ForegroundColor Yellow
|
|
||||||
docker-compose up -d
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "6. Checking service status..." -ForegroundColor Yellow
|
|
||||||
Start-Sleep -Seconds 3
|
|
||||||
docker-compose ps
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "7. Showing Wiki service logs..." -ForegroundColor Yellow
|
|
||||||
docker-compose logs wiki --tail=50
|
|
||||||
Write-Host ""
|
|
||||||
|
|
||||||
Write-Host "=== Test Complete ===" -ForegroundColor Green
|
|
||||||
Write-Host "Check the logs above for any errors." -ForegroundColor Cyan
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user