Put the site behind NPM via proxynet, add Strato DynDNS updater

- eb-blazor joins the external network proxynet and publishes no host port;
  NPM forwards to eb-blazor:8080 by name
- Stack network gets the fixed name eb-internal (Compose Manager derives the
  project name from the stack folder); the dev overlay resets it and turns
  proxynet into a local network
- eb-ddns keeps the A record of elternbeirat-igmh.info at Strato current
- docs/unraid-infrastructure.md records the actual Unraid state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Opus 5.5 committed 2026-10-10 00:12:18 +02:00
1 parent 53cee04396
commit 4968b62f06
6 files changed
+267 -28

No files matched your search

+38
View File
@@ -82,6 +82,44 @@ to the outside. NPM terminates TLS and is the only path to the container.
`UseForwardedHeaders` with emptied `KnownNetworks`/`KnownProxies` is correct because
the container has no port mapping and is reachable only through NPM.
## AE-5: DynDNS as a container in the stack (ddns-updater)
**Decision:** The A record of `elternbeirat-igmh.info` at Strato is kept current by
`eb-ddns` ([ddns-updater](https://github.com/qdm12/ddns-updater)), a third service
in `compose.yaml`. Its whole configuration is the `CONFIG` environment variable in
that file; only the DynDNS password comes from the stack's env
(`STRATO_DYNDNS_PASSWORD`).
**Rationale:** The site runs on the private connection, whose public IP changes.
The FritzBox has a single DynDNS slot and it already serves `anticarnist.de`, so
the update has to run elsewhere. Putting it in the stack means it moves with the
site. ddns-updater was chosen over ddclient because of where the config lives:
ddclient needs a config file, which would have to sit next to the stack on the
server (the Unraid stack is maintained by hand, not from a checkout) and be set up
again whenever the container or its folder is deleted. ddns-updater takes the whole
config from one environment variable, so `compose.yaml` alone describes it and the
container can be deleted and recreated without any setup — only the one secret
stays outside the repo.
**Consequence:** No volume, so ddns-updater keeps no update history across
recreations; it just checks the IP again on start. The dev overlay disables the
service, so a local `up` never changes the public DNS. Setup:
`deployment.md`.
## AE-6: No proxy in the stack
**Decision:** NPM is **not** part of `eb-stack`. The site uses the NPM that already
runs on Unraid.
**Rationale:** A host has only one 80/443, and the router forwards it to one target.
A second NPM in the stack would collide with the existing one, which also serves
`anticarnist.de`. Which proxy owns 80/443 is a property of the host, not of the
site.
**Consequence:** Moving the site to another host means setting up a proxy there and
recreating one proxy host (domain → app, Let's Encrypt). The steps are in
`deployment.md`.
## Rejected alternatives (for AE-1)
| Alternative | Why not |
+79 -10
View File
@@ -4,9 +4,10 @@ How a new version of the website ends up on Unraid. Current state:
**manual** — build the image locally, push it to the Gitea registry, pull it on
Unraid. Automation via Gitea Actions comes later.
The site runs as a **two-container stack** (project `eb-stack`): the Blazor app
(`eb-blazor`) plus a PocketBase container (`eb-pocketbase`) that holds the
content. The stack is described by `compose.yaml` (the production base) with
The site runs as a **three-container stack** (project `eb-stack`): the Blazor app
(`eb-blazor`), a PocketBase container (`eb-pocketbase`) that holds the content,
and a DynDNS updater (`eb-ddns`) that keeps the domain pointed at the
connection. The stack is described by `compose.yaml` (the production base) with
overlays layered on top.
> **Running it locally is a separate document.** For starting the stack on your
@@ -34,6 +35,78 @@ permission** (`package: Read and Write`) — **not** the account password.
The Docker login then stores the token locally, so it only has to be entered once.
### DynDNS for elternbeirat-igmh.info (Strato)
The domain is registered at **Strato**; the site runs on the private connection,
whose public IP changes. `eb-ddns` ([ddns-updater](https://github.com/qdm12/ddns-updater))
reports the current IP to Strato every five minutes. Why a container and why
ddns-updater: `architektur.md`, AE-5.
The whole updater config sits in `compose.yaml` (`CONFIG`), so deleting and
recreating the container needs no setup. The only thing outside the repo is the
DynDNS password.
1. **Strato** customer area → domain `elternbeirat-igmh.info` → DNS settings →
**Dynamic DNS** → activate. `www` needs nothing: it is a CNAME on the domain
and follows on its own.
2. **Strato password:** DynDNS accepts the package password **or** a separate
DynDNS password, set under **Security → Set passwords** (not under Dynamic
DNS). Use the separate one — the package password also opens the webspace.
3. **Compose Manager Plus** → stack **eb-stack** → env file: add
```ini
STRATO_DYNDNS_PASSWORD=<DynDNS password>
```
**No quotes** — Compose Manager Plus passed them on as part of the password,
which Strato answered with `badauth`. The password ends up inside JSON, so it
must not contain `"` or `\`; avoid `$` and `#` as well.
4. **Compose Down**, then **Compose Up** (a plain restart keeps the old env).
`docker logs eb-ddns` shows `Updating record … to use <IP>` with no `ERROR`
after it.
5. Check: the Strato nameservers answer with the public IP of the connection
right away; public resolvers follow once their cache expires.
```bash
dig +short @docks05.rzone.de elternbeirat-igmh.info
```
**Testing the credentials without the container** — passing the IP the record
already has, so a successful login changes nothing (`nochg`); `badauth` means
domain or password are wrong:
```bash
curl -u elternbeirat-igmh.info "https://dyndns.strato.com/nic/update?hostname=elternbeirat-igmh.info&myip=<current IP>"
```
> **The DynDNS password is a secret** like the registry token: only in the stack's
> env on the server, never in Git. A missing value does not stop the stack; it
> shows up as a failed update in `docker logs eb-ddns`. The dev overlay disables
> `eb-ddns`, so a local `up` never touches the public DNS.
### NPM proxy host
The NPM that already runs on Unraid fronts the site (why not one in the stack:
`architektur.md`, AE-6). The router forwards 80/443 to it.
**Hosts → Proxy Hosts → Add Proxy Host:**
| Tab | Field | Value |
|---|---|---|
| Details | Domain Names | `elternbeirat-igmh.info`, `www.elternbeirat-igmh.info` |
| | Scheme / Forward Hostname / Port | `http` / `eb-blazor` / `8080` |
| | Block Common Exploits | on |
| | Cache Assets, Websockets Support | off |
| SSL | SSL Certificate | Request a new SSL Certificate (Let's Encrypt) |
| | Force SSL, HTTP/2, HSTS | on |
| | HSTS Subdomains, DNS Challenge | off |
NPM and `eb-blazor` share the Docker network `proxynet`, so NPM reaches the app by
container name; the app publishes no host port (`unraid-infrastructure.md`).
Let's Encrypt asks the Strato nameservers directly,
so the certificate works as soon as DynDNS has updated, even while public
resolvers still cache the old IP.
---
## Way of working: branches, never directly on main
@@ -113,19 +186,15 @@ In the **Compose Manager Plus** plugin (Unraid web interface):
## The compose files
`compose.yaml` is the **production** base and is the file Unraid uses. It defines
both services with no host port mappings — in production NPM is the only path to
the web app, and the editors reach PocketBase through an NPM subdomain (see #9).
all services. `eb-blazor` publishes no host port and joins the external network
`proxynet`, so NPM is the only path to the web app. `eb-pocketbase` still publishes
`8090` for the editors until they reach it through an NPM subdomain (see #9).
`eb-pocketbase` keeps its data on the bind mount
`/mnt/user/appdata/pocketbase/pb_data`, which only exists on the server.
The two overlays (`compose.dev.yaml`, `compose.test.yaml`) are for local
development and the tests and are **not** used on Unraid — see `entwicklung.md`.
> **NPM network (still open).** The base does not yet attach `eb-blazor` to the
> external NPM Docker network; while the domain has not moved, add a temporary
> `ports:` mapping (e.g. `5000:8080`) to reach the app on the LAN, and swap it for
> the `npm` external network once NPM sits in front. Tracked with #9.
---
## Outage: PocketBase unreachable
+89
View File
@@ -0,0 +1,89 @@
# Unraid infrastructure
What runs on the Unraid host and how the website stack fits in. This is the
**actual state** on the server. How to deploy a new version: `deployment.md`.
## Host
| | |
|---|---|
| LAN IP | `192.168.1.14` |
| Web UI | `https://unraid.server:44302` |
| Version | Unraid OS 7.0.1 |
| Stack management | Compose Manager plugin, stack `elternbeirat` |
| Docker network for NPM | `proxynet` (created with `docker network create proxynet`) |
**Settings → Docker → Advanced View → Preserve user defined networks: Yes.**
Without it Unraid deletes `proxynet` on every Docker restart, and every container
attached to it fails to start.
## Website stack
The stack is created in the Compose Manager under the name `elternbeirat`. Its
compose content is a copy of `compose.yaml` **without the comments**, pasted
into the stack's config in the Unraid UI.
> **The project name comes from the stack folder, not from `name:`.** The
> Compose Manager starts the stack with `-p elternbeirat`, which overrides
> `name: eb-stack`. Renaming the stack in the UI does not change it. That is why
> `compose.yaml` gives the stack's network the fixed name `eb-internal` instead of
> the derived `elternbeirat_default`. Changing a network name needs **Compose Down**
> and then **Compose Up**; a plain Up fails because the existing containers still
> point at the old network.
| Container | Network | Container port | Host port |
|---|---|---|---|
| `eb-blazor` | `eb-internal`, `proxynet` | `8080` | – |
| `eb-pocketbase` | `eb-internal` | `8090` | `8090` |
| `eb-ddns` | `eb-internal` | – | – |
Persistent data: `/mnt/user/appdata/pocketbase/pb_data` → `/pb_data`.
## Nginx Proxy Manager
The container is called **`nginx`** and runs on the network `proxynet`.
| Container port | Host port |
|---|---|
| `8080` (HTTP) | `80` |
| `4443` (HTTPS) | `443` |
| admin UI | `7818` (`http://192.168.1.14:7818`) |
| config | `/mnt/cache/appdata/nginx` → `/config` |
> **Why `proxynet` and not `bridge`:** Docker's default `bridge` has no name
> resolution. On `proxynet` NPM reaches `eb-blazor:8080` by name, so the site needs
> no host port.
### Active proxy hosts
Except for the website, destinations use LAN host names (`unraid.server`),
resolved by the LAN DNS, never container IPs. That is why they kept working when
NPM moved from `bridge` to `proxynet`.
| Source | Destination | SSL |
|---|---|---|
| `elternbeirat-igmh.info`, `www.elternbeirat-igmh.info` | `http://eb-blazor:8080` | Let's Encrypt |
| `gitea.anticarnist.de` | `http://unraid.server:3005` | Let's Encrypt |
| `cloud.anticarnist.de` | `https://unraid.server:44304` | Let's Encrypt |
| `home.anticarnist.de` | `http://unraid.server:44303` | Let's Encrypt |
| `assistant.anticarnist.de` | `http://192.168.1.15:8123` | Let's Encrypt |
Further hosts (`*.katzenfunk.de`, `anticarnist.de` → `arch.server` / SearXNG)
exist but are offline and unused.
## Other containers on the host
Except for AdGuard, all of these run on `bridge` and have nothing to do with the
website. They are listed so it is clear which ports are taken.
| Container | Host ports |
|---|---|
| AdGuard-Home | own IP `192.168.1.7` (`br0`) |
| flame | `44303` |
| Gitea | `2205` (SSH), `3005` (HTTP) |
| Gitea-Runner | – |
| nextcloud | `44304` |
| piper | `10200` |
| postgresql15 | `5432` |
| SearXNG | `1234` (stopped) |
| UptimeKuma | `3001` |