docs(okf): replace Cloudflare Tunnel with own nginx reverse proxy

direction change: own nginx proxy (Terraform-installed, certbot TLS) is the only public entry; add own-proxy decision; update system, gateway SSE notes, server budget and accepted-downtime docs
This commit is contained in:
Noel Sabia committed 2026-10-14 21:54:33 +02:00
1 parent e432895080
commit 3636053a35
8 files changed
+47 -14

No files matched your search

+4 -3
View File
@@ -38,10 +38,11 @@ The same stream feeds the life map and the developer view.
- **Global limit:** `golang.org/x/time/rate`, for example 1 fall per second with burst 3.
- Knockdowns are shared state on purpose: every viewer sees "someone just knocked down X".
# Cloudflare Tunnel and SSE
# nginx proxy and SSE
- Send `Content-Type: text/event-stream` and flush after every message.
- Send a comment line (`: ping`) every 30 seconds so idle connections are not closed.
- Terminate SSE at the gateway; nginx proxies it per-connection with buffering off (`proxy_buffering off`).
- Send a comment line (`: ping`) every 30 seconds so idle connections are not closed
through nginx's default read timeout.
# Tracker
+1
View File
@@ -6,4 +6,5 @@
* [Frontend](frontend.md) - Nuxt site generated to static files and served by the gateway, with three audience layers fed by one SSE stream.
* [Server and memory budget](server-budget.md) - The CV shares a 2 vCPU, 4 GB server with Gitea and a small webapp, so every workload gets a hard memory cap.
* [Delivery](delivery.md) - Gitea Actions on the home server scan, build, push to the Gitea registry, deploy with kubectl, and version with release-please.
* [Terraform provisioning](terraform.md) - Terraform rebuilds the server, swap, k3s, nginx and DNS from nothing; nothing inside the cluster.
* [In-browser language model](language-model.md) - A tiny language model trained by Noel that runs entirely in the visitor's browser and shows its internals live.
+1 -1
View File
@@ -62,7 +62,7 @@ spec:
`/etc/rancher/k3s/config.yaml`:
```yaml
disable: [traefik, servicelb] # Cloudflare Tunnel replaces both
disable: [traefik, servicelb] # nginx (Terraform) replaces both
kubelet-arg:
- "system-reserved=memory=1300Mi" # measured 1143 MB plus margin
- "eviction-hard=memory.available<200Mi"
+2 -2
View File
@@ -11,7 +11,7 @@ generated: { by: claude-code/claude-opus-5-5, at: 2026-10-11T12:15:30Z }
| Component | Runs as | Job |
|---|---|---|
| Cloudflare Tunnel | `cloudflared` on the home server | Only way in from the internet. Points at the gateway. |
| nginx (reverse proxy) | Terraform-installed, on the home server | Only way in from the internet. TLS via certbot. Points at the gateway. |
| [Gateway](/architecture/gateway.md) | 1 Deployment, Go | Serves the static site, streams states, forwards knockdowns, counts visits into SQLite. The only public service. |
| [Frontend](/architecture/frontend.md) | Static files inside the gateway image | Nuxt, built with `nuxt generate`. |
| [Chapter service](/architecture/chapter-service.md) | One Deployment or Job per chapter | Behaves healthy, not-ready, crashing, or completed, set by env. |
@@ -32,7 +32,7 @@ cmd/chapter → image `chapter`
# Flow: page load
1. Visitor opens the apex domain. Cloudflare Tunnel forwards to the gateway Service.
1. Visitor opens the apex domain. DNS points at the home server. nginx (TLS via certbot) forwards to the gateway Service.
2. Gateway returns prerendered Nuxt HTML. The first screen works without JavaScript.
3. The page opens `GET /api/events` (SSE) and receives the current state of every chapter, then every change.