PUBLIC_URL: Kalender-Link per Umgebungsvariable (HTTPS hinter Proxy)

This commit is contained in:
2026-01-29 14:02:44 +01:00
parent 221e9eb8d6
commit 51e7cdd85c
3 changed files with 11 additions and 4 deletions

View File

@@ -82,6 +82,7 @@ Die eigentliche iCal-Datei für Abos und direkten Download ist unter `/calendar.
- `KANTINE_BASE_URL` Basis-URL der Kantine (Standard: `http://kantine-bhz.de`)
- `REFRESH_INTERVAL_SECONDS` Sekunden zwischen Aktualisierungen (Standard: 86400 = 24 h)
- `PUBLIC_URL` Öffentliche Basis-URL (z. B. `https://kantine.elpatron.me`). Wenn gesetzt, wird diese URL für die Kalender-Abo-URL auf der Startseite verwendet. **Empfohlen hinter HTTPS-Proxy**, falls der Proxy keine `X-Forwarded-Proto`/`X-Forwarded-Host`-Header sendet sonst erscheint dort weiterhin `http://`.
---
@@ -92,11 +93,12 @@ Für den Betrieb als Container (z. B. auf einem Server):
**Build und Run:**
```bash
docker build -t kantine2ical .
docker run -p 8000:8000 kantine2ical
docker run -p 8000:8000 -e PUBLIC_URL=https://kantine.elpatron.me kantine2ical
```
(Ersetzen Sie `https://kantine.elpatron.me` durch Ihre öffentliche HTTPS-URL. Dann zeigt die Startseite die Kalender-URL mit `https://`.)
- **Startseite** (Anleitung + Abo-URL): `http://<host>:8000/`
- **iCal-Abo:** `http://<host>:8000/calendar.ics`
- **Startseite** (Anleitung + Abo-URL): `http://<host>:8000/` bzw. Ihre HTTPS-URL
- **iCal-Abo:** `http://<host>:8000/calendar.ics` bzw. `https://<host>/calendar.ics`
**Mit Docker Compose:**
```bash