Fix daily puzzle rotation timezone issue

- Added lib/dateUtils.ts for consistent timezone handling
- Updated app/page.tsx and app/api/daily/route.ts to use Europe/Berlin timezone
- Updated lib/gameState.ts to sync client-side daily check with server time
- Exposed TZ env var to client in next.config.ts
This commit is contained in:
Hördle Bot
2025-11-22 00:44:14 +01:00
parent 3e0fa430a3
commit 4f8524c286
6 changed files with 66 additions and 10 deletions

View File

@@ -82,6 +82,55 @@ Das Projekt ist für den Betrieb mit Docker optimiert.
- URL: `/admin`
- Standard-Passwort: `admin123` (Bitte in `docker-compose.yml` ändern!)
## Nginx-Konfiguration (für Reverse Proxy)
Wenn du Nginx als Reverse Proxy verwendest, benötigst du spezielle Einstellungen für Audio-Streaming:
```nginx
server {
listen 80;
server_name your-domain.com;
# Erhöhe Upload-Limit
client_max_body_size 50M;
location / {
proxy_pass http://localhost:3010;
proxy_http_version 1.1;
# Wichtig für Audio-Streaming: Range Requests weiterleiten
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_no_cache $http_range $http_if_range;
# Standard Proxy Headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
Eine vollständige Beispiel-Konfiguration findest du in `nginx.conf.example`.
## Troubleshooting
### Audio-Dateien lassen sich nicht abspielen (in Produktion mit Nginx)
**Problem:** MP3-Dateien funktionieren lokal, aber nicht hinter Nginx.
**Lösung:**
1. Stelle sicher, dass Nginx Range Requests unterstützt (siehe Nginx-Konfiguration oben)
2. Prüfe die Nginx-Logs: `sudo tail -f /var/log/nginx/error.log`
3. Teste direkt ohne Nginx: `http://localhost:3010/uploads/dateiname.mp3`
4. Überprüfe die Response-Headers im Browser (Developer Tools → Network)
**Wichtige Nginx-Einstellungen:**
- `proxy_set_header Range $http_range;` - Leitet Range Requests weiter
- `proxy_buffering off;` - Deaktiviert Buffering für große Dateien
- `client_max_body_size 50M;` - Erlaubt große Uploads
## Lizenz
MIT