Add a front door, a user guide in two languages, and an honest list of what is broken

Four documents and two fixes to the deploy directory that the documents
exposed while being written.

The repo had no root README. Cloning it landed you on a 40 KB spec and a 24 KB
plan with nothing to orient you, which mattered more once main stopped being
an empty branch. The new one links rather than duplicates, and its status table
says plainly what has never run on hardware and that there are no backups.

docs/README.USER.md and its German twin are written for someone who will use
this, not build it: what radar buys over a PIR sensor, why there is no sign-up
page, what "pre-trigger" means, what to do when the six-digit code is refused.
Every POORBIRD_* setting is described in plain language, including the two that
cost an hour each the first time they bite. The German version is a
translation, not a mechanical flip of the English.

docs/OPEN-TOPICS.AI.md is the list nobody writes: unfixed security issues,
traps, and test debt, each labelled ACCEPTED, OPEN or TRAP, because the
difference between "known trade-off" and "not done yet" is the only thing that
makes such a list usable. It ends with a section of things that are NOT
problems -- the SHA-256/Argon2id split, the frozen 0001 migration, the finite
pool_timeout -- so they stop being rediscovered and "fixed".

Two real defects surfaced while documenting the install:

Nothing served the WebUI in production. The Caddyfile's human-facing block
only reverse-proxied to FastAPI, and FastAPI mounts no static files, so a
by-the-book install produced a working API and no gallery. It now has a
file_server with a try_files fallback, because the router does client-side
routing and without it only the entry page survives a reload.

INSTALL.md never created an account. With no sign-up endpoint, following it
end to end left you at a login form with no credentials that work -- the exact
wall hit on the dev machine today, and worse on a headless host. It also never
built or copied the UI, so a git pull on the server silently kept the old
bundle; that is now its own step, with --delete spelled out because Vite emits
content-hashed filenames.

Verified: caddy validate via the official caddy:2 image reports "Valid
configuration" (with the cloudflare-DNS block stripped, since that plugin is
not in the stock image and the block is unchanged); npm run build is clean at
192 modules; all 31 relative links across every .md resolve; the committed
line endings are LF, so caddy fmt's complaint was my working tree only.

Not verified: none of the install has run on a real host. The doc says so.

One claim was wrong before it shipped: both guides said signing out ends every
session everywhere. logout calls revoke_session for the current token only --
revoke_all_for_user exists but is not called there -- so it ends that browser's
session alone, and `user passwd` is what clears them all. Corrected in both
languages.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thomas KarnerandClaude Opus 5 committed 2026-09-21 23:01:20 +02:00
1 parent f9d0b09d2f
commit 6907d9a014
6 files changed
+1264 -5

No files matched your search

+19 -3
View File
@@ -43,9 +43,25 @@ poorbird.example.internal {
encode zstd gzip
reverse_proxy 127.0.0.1:8090 {
header_up X-Real-IP {remote_host}
import protected_files
# The API, and with it the auth-checked image handoff.
handle /api/* {
reverse_proxy 127.0.0.1:8090 {
header_up X-Real-IP {remote_host}
import protected_files
}
}
# The WebUI: built on the dev machine with `npm run build` and copied here
# as static files. Nothing in web/ runs on the server (SPEC 6), so this is
# a file_server and not a second application.
handle {
root * /srv/poorbird/web
# The router does client-side routing, so a reload on /devices or a
# pasted deep link arrives as a path with no file behind it. Without
# this fallback those are 404s and only the entry page ever works.
try_files {path} /index.html
file_server
}
}
+68 -2
View File
@@ -16,10 +16,16 @@ sudo apt update
sudo apt install -y postgresql python3-venv python3-pip git caddy
sudo useradd --system --home-dir /opt/poorbird --shell /usr/sbin/nologin poorbird
sudo mkdir -p /opt/poorbird /etc/poorbird /srv/poorbird/{images,thumbs} /var/lib/poorbird
sudo mkdir -p /opt/poorbird /etc/poorbird /srv/poorbird/{images,thumbs,web} /var/lib/poorbird
sudo chown -R poorbird:poorbird /srv/poorbird /var/lib/poorbird /opt/poorbird
```
`images/` and `thumbs/` must stay siblings under `/srv/poorbird`: that is the
directory the Caddyfile's `file_server` serves, and the auth-checked image
handoff needs both sides to agree on it. `poorbird check` verifies the layout,
because getting it wrong produces 404s from Caddy and nothing in the app's log.
`web/` is where the built UI goes (step 7).
## 2. Database
Loopback TCP with `scram-sha-256`, deliberately not a Unix socket — see
@@ -112,7 +118,63 @@ DNS-01 needs a Caddy build with your provider's plugin:
`caddy add-package github.com/caddy-dns/cloudflare`. For a first test, replace
the human-facing site block with `http://:8081` and drop the `tls` block.
## 7. Network
> **If you do that, you cannot sign in until you also set
> `POORBIRD_SESSION_COOKIE_SECURE=false`.** The session cookie is `Secure` by
> default, and a browser silently discards a `Secure` cookie over plain HTTP:
> the login returns 200, and you are never signed in, with nothing in any log
> to explain it. Set it back to `true` the moment TLS is on.
## 7. The WebUI
The UI is built on your dev machine and copied here as static files. Nothing
in `web/` runs on the server (SPEC §6) — Caddy serves it, and there is no Node
on this host.
On the dev machine:
```bash
cd web
npm ci
npm run build # typechecks, then writes dist/
```
Then copy it over, and let Caddy read it:
```bash
rsync -a --delete dist/ youruser@poorbird-host:/tmp/poorbird-web/
# on the host:
sudo rsync -a --delete /tmp/poorbird-web/ /srv/poorbird/web/
sudo chown -R poorbird:poorbird /srv/poorbird/web
```
`--delete` matters on an upgrade: Vite writes content-hashed filenames, so
without it every old bundle stays behind forever.
Re-run this after any UI change. There is no build step on the server, so
`git pull` alone never updates the UI.
## 8. Your first account
**There is no sign-up page, and a fresh install has no accounts** — so without
this step the login screen has nothing you can type into it.
```bash
sudo -u poorbird env $(sudo cat /etc/poorbird/poorbird.env | grep -v '^#' | xargs) \
/opt/poorbird/venv/bin/poorbird user add yourname --role admin
```
It prompts for the password, then prints an `otpauth://` URI once. **Scan it
into your authenticator app before pressing on** — it is not shown again, and
TOTP is required on every login for an account that has a secret.
`--no-totp` skips the second factor and warns that it is doing so. There is
currently no command to add or remove TOTP later, and none to delete a user,
so this choice sticks for that account.
Roles are `viewer`, `editor` and `admin` (SPEC §3.1); Devices and System need
`admin`. Devices are not users and never appear here.
## 9. Network
Give the server a **DHCP reservation or a static IP, then hardcode that
address in the firmware** — simpler and more reliable than mDNS (SPEC §9).
@@ -131,6 +193,10 @@ sudo systemctl restart poorbird-api poorbird-worker
`ExecStartPre` applies migrations on restart.
**The UI is not part of that.** It is built on the dev machine, so a `git pull`
here leaves the old bundle in `/srv/poorbird/web` and you get a new API with an
old gallery. Repeat step 7 whenever `web/` changed.
> Restarting mid-OTA-rollout matters: a device on a trial image marks that
> image valid **only after a heartbeat the endpoint accepted**. Returning 5xx
> to a trial device rolls it back — correct behaviour, but know it before you