Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35073273d1 | ||
|
|
955e2faa3f |
No files matched your search
+1
-1
@@ -13,6 +13,6 @@ GITEA_REPO=Tom/Elternbeirat
|
||||
# PocketBase superuser login, used to read/write records via the REST API
|
||||
# (e.g. migrating content) without loosening the collection API rules -- a
|
||||
# superuser bypasses them. Create the superuser in the dashboard at <PB_URL>/_/.
|
||||
PB_URL=http://<unraid-host>:8090
|
||||
PB_URL=https://redaktion.elternbeirat-igmh.info
|
||||
PB_ADMIN_EMAIL=
|
||||
PB_ADMIN_PASSWORD=
|
||||
@@ -119,3 +119,8 @@ jobs:
|
||||
echo "eb-blazor did not report healthy within 60 seconds." >&2
|
||||
docker logs --tail 50 eb-blazor >&2
|
||||
exit 1
|
||||
|
||||
# Every deploy leaves the previous :latest behind as an untagged image. Only
|
||||
# untagged images go; a rollback pulls its :<sha> from the registry anyway.
|
||||
- name: Remove untagged images
|
||||
run: docker image prune -f
|
||||
+10
-11
@@ -2,11 +2,11 @@
|
||||
# only PocketBase's data is a volume, everything else lives inside the images or
|
||||
# in this file.
|
||||
#
|
||||
# NPM runs outside this stack (the `nginx` container on Unraid) and reaches the web
|
||||
# app by name over the external Docker network `proxynet` (eb-blazor:8080), so the
|
||||
# web app publishes no host port. The `ports:` block on PocketBase is TEMPORARY: it
|
||||
# is the editors' way onto the admin UI until they reach it through an NPM subdomain
|
||||
# (#9). Unraid setup: docs/unraid-infrastructure.md.
|
||||
# NPM runs outside this stack (the `nginx` container on Unraid) and reaches both the
|
||||
# web app (eb-blazor:8080) and the PocketBase admin (eb-pocketbase:8090, for
|
||||
# redaktion.elternbeirat-igmh.info) by name over the external Docker network
|
||||
# `proxynet`. No service publishes a host port: NPM is the only way in. Unraid
|
||||
# setup: docs/unraid-infrastructure.md.
|
||||
#
|
||||
# On Unraid this file is deployed as is by .gitea/workflows/deploy.yml (project
|
||||
# eb-stack), not pasted into the Compose Manager.
|
||||
@@ -39,12 +39,11 @@ services:
|
||||
volumes:
|
||||
# The only state that must survive a restart or redeploy.
|
||||
- /mnt/user/appdata/pocketbase/pb_data:/pb_data
|
||||
ports:
|
||||
# TEMPORARY: exposes the admin UI on the LAN (http://<unraid>:8090/_/) while
|
||||
# NPM is not in front yet. Replace once the editors reach PocketBase through an
|
||||
# NPM subdomain (#9): NPM points at eb-pocketbase:8090 over a shared network, so
|
||||
# this host mapping can go -- until then the admin has no other way in.
|
||||
- "8090:8090"
|
||||
networks:
|
||||
# default: serve the web app. proxynet: be reached by NPM as eb-pocketbase:8090
|
||||
# for redaktion.elternbeirat-igmh.info.
|
||||
- default
|
||||
- proxynet
|
||||
healthcheck:
|
||||
# The image ships this endpoint; the web app waits for it to pass.
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8090/api/health"]
|
||||
|
||||
+43
-2
@@ -103,6 +103,45 @@ 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.
|
||||
|
||||
### Editor subdomain (redaktion.elternbeirat-igmh.info)
|
||||
|
||||
The editors reach the PocketBase admin at
|
||||
<https://redaktion.elternbeirat-igmh.info/_/>.
|
||||
|
||||
1. **Strato** → Domainverwaltung → **Subdomain anlegen** `redaktion` → its
|
||||
**DNS** → **CNAME-Record** `elternbeirat-igmh.info`. Like `www`, it follows the
|
||||
DynDNS IP on its own.
|
||||
2. `eb-pocketbase` joins `proxynet` (`compose.yaml`), so NPM reaches it by name.
|
||||
3. **NPM** proxy host:
|
||||
|
||||
| Tab | Field | Value |
|
||||
|---|---|---|
|
||||
| Details | Domain Names | `redaktion.elternbeirat-igmh.info` only |
|
||||
| | Scheme / Forward Hostname / Port | `http` / `eb-pocketbase` / `8090` |
|
||||
| | Block Common Exploits, Websockets Support | on |
|
||||
| SSL | SSL Certificate | Request a new SSL Certificate (Let's Encrypt) |
|
||||
| | Force SSL, HTTP/2 | on |
|
||||
| Advanced (gear icon) | Custom Nginx Configuration | see below |
|
||||
|
||||
PocketBase has nothing at `/`; this sends the bare subdomain to the admin:
|
||||
|
||||
```nginx
|
||||
location = / {
|
||||
return 302 https://$host/_/;
|
||||
}
|
||||
```
|
||||
|
||||
The full URL is needed: with a bare path (`return 302 /_/;`) nginx adds its
|
||||
container port and the redirect lands on `:4443`.
|
||||
|
||||
Pitfalls: no `www.redaktion…` in Domain Names — it has no DNS record, and one
|
||||
unknown name makes Let's Encrypt refuse the whole certificate. And no Custom
|
||||
Location for `/`: an empty one without a forward target breaks the subdomain.
|
||||
|
||||
> **The whole PocketBase API is public on this subdomain, not just the admin.**
|
||||
> That is fine as long as the collection API rules only allow reading; writing is
|
||||
> for superusers, who bypass the rules (`redaktion.md`).
|
||||
|
||||
---
|
||||
|
||||
## Way of working: branches, never directly on main
|
||||
@@ -130,6 +169,8 @@ Merge the pull request into `main`. The workflow then:
|
||||
`compose.yaml` — only containers whose image or config changed are recreated,
|
||||
3. checks `http://eb-blazor:8080/health` from inside `proxynet` (health gate). A
|
||||
red run means the new version is live but not healthy: roll back (below).
|
||||
4. removes untagged images (`docker image prune -f`) — the previous `:latest`
|
||||
loses its tag on every deploy and would pile up on Unraid otherwise.
|
||||
|
||||
Pushes that only touch `docs/` or Markdown files trigger nothing. A manual run
|
||||
(**Actions** → **Build and deploy** → **Run workflow**) redeploys the current
|
||||
@@ -164,8 +205,8 @@ and there is no stale copy left there that could be started by accident.
|
||||
`compose.yaml` is the **production** base; the workflow deploys it to Unraid as
|
||||
is. It defines
|
||||
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).
|
||||
`proxynet`, so NPM is the only path to the web app. `eb-pocketbase` joins
|
||||
`proxynet` too, for the editor subdomain, and publishes no host port either.
|
||||
`eb-pocketbase` keeps its data on the bind mount
|
||||
`/mnt/user/appdata/pocketbase/pb_data`, which only exists on the server.
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Das Admin heißt „Redaktion Elternbeirat" und ist unter der PocketBase-Adresse
|
||||
erreichbar:
|
||||
|
||||
- **Lokal:** <http://localhost:8090/_/> (Dev-Stack, siehe `entwicklung.md`).
|
||||
- **Auf dem Server:** über die NPM-Subdomain (Login von außen — noch offen, #9).
|
||||
- **Auf dem Server:** <https://redaktion.elternbeirat-igmh.info/_/>, von überall erreichbar.
|
||||
|
||||
Redakteure sind **Superuser**: jede vertraute Person aus dem Vorstand bekommt
|
||||
einen eigenen Superuser-Zugang (unter *Collections → System → `_superusers`*).
|
||||
|
||||
@@ -34,7 +34,7 @@ so the workflow's `docker compose` talks to the Unraid daemon directly.
|
||||
| Container | Network | Container port | Host port |
|
||||
|---|---|---|---|
|
||||
| `eb-blazor` | `eb-internal`, `proxynet` | `8080` | – |
|
||||
| `eb-pocketbase` | `eb-internal` | `8090` | `8090` |
|
||||
| `eb-pocketbase` | `eb-internal`, `proxynet` | `8090` | – |
|
||||
| `eb-ddns` | `eb-internal` | – | – |
|
||||
|
||||
Persistent data: `/mnt/user/appdata/pocketbase/pb_data` → `/pb_data`.
|
||||
@@ -56,13 +56,14 @@ The container is called **`nginx`** and runs on the network `proxynet`.
|
||||
|
||||
### Active proxy hosts
|
||||
|
||||
Except for the website, destinations use LAN host names (`unraid.server`),
|
||||
Except for the website stack, 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 |
|
||||
| `redaktion.elternbeirat-igmh.info` | `http://eb-pocketbase:8090` (`/` → `/_/`) | 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 |
|
||||
|
||||
Reference in new issue
Block a user