Serve static maintenance page with 503 when PocketBase is unreachable

This commit is contained in:
tleininger committed 2026-10-01 17:12:00 +02:00
1 parent ed6aa5d5ec
commit 7e56e83953
7 files changed
+500 -4

No files matched your search

+25
View File
@@ -128,6 +128,31 @@ development and the tests and are **not** used on Unraid — see `entwicklung.md
---
## Outage: PocketBase unreachable
If `eb-pocketbase` is down while `eb-blazor` runs, the app does not render
half-empty pages (the menu comes from PocketBase too). A gate in `Program.cs`
answers every **page** request with the static `wwwroot/maintenance.html`:
| Request | Answer while PocketBase is down |
|---|---|
| Any page (`/`, `/board`, `/posts/…`, unknown slugs) | **503**, `Retry-After: 60`, maintenance page |
| `/health` | **503** `PocketBase unreachable` (for Uptime Kuma) |
| `/events.ics` | 200 with an empty calendar, so subscriptions keep working |
| `/events/{id}.ics` | 503 |
| Static files (CSS, fonts, PDFs, `/maintenance.html`) | served as usual |
The gate caches the health check for **10 seconds** (`PocketBaseHealthCache`). So
after PocketBase stops, pages can render for up to 10 s more (the components
degrade on their own in that window: empty menu, a short note, 503), and after it
starts again the maintenance page can stay up for up to 10 s. No restart of the
web app is needed — the site comes back by itself.
`maintenance.html` carries its styles inline, as a copy of the tokens from
`app.css`. When colours change there, copy them over.
---
## Rollback
`scripts/release.sh` additionally tags each release with the short commit SHA,