feat(review): sample every detected car, not only ticketed entries
Build & push images / images (push) Successful in 5m20s

The entry stream for the reviewer was fed from the session-tied read only (ticket
printed / exit signed). park-2 ran an afternoon with its barriers up: hundreds of
camera vehicle pushes, zero tickets, zero samples.

- anpr-entry: keep the best-framed vehicle of each poll loop (highest body-type
  confidence with a box), store that frame as a snapshot (identity pass:<id>, no
  session) and emit a vehicle read with the camera id — plate or no plate. One
  sample per detection, fire-and-forget, never on the ANPR path.
- snapshot.ts: normalizedBoxes() shared by the session-tied read and the bridge;
  vehicle reads now carry deviceId.
- review-outbox: sampleEntry(deviceId) dedups per camera for 30 s so the pass
  sample and a ticket entry's read (same car, seconds apart) go once.
- wiki: outbox page (entry stream, troubleshooting checklist for 'nothing arrives':
  the month-long silence was a missing Netbird policy, not code), park-2 camera
  port-forward procedure (site-device-installation §7), log.
This commit is contained in:
2026-10-08 19:30:03 +02:00
parent 354de04a3d
commit 30a1180108
10 changed files with 288 additions and 28 deletions
+43
View File
@@ -285,6 +285,49 @@ barcode with a real ticket (the KP-300H garbled overflowing barcodes until the g
8. Record in the site record: every IP, serial, camera password, printer model, which relay is
which, photos of the labels. Remove the temporary laptop addresses. Log out of every device UI.
## 7. Reaching the cameras remotely — port forward through the booth host (park-2, 2026-10-08)
park-buzi exposed its two Hikvision web UIs on the site router (`park-buzi.msai.al:8081` / `:8082`,
see [[lpr-camera]]). park-2 does the same **through the booth host**, because its router only
knows the 192.168.1.0/24 side while the cameras live on the device VLAN:
| | address |
| --- | --- |
| router / internet side | `eno1` 192.168.1.101, gateway 192.168.1.1, public 91.230.255.154 |
| device VLAN side | `eno1` 10.0.10.101 (same NIC, second address) |
| Netbird | `wt0` 100.75.7.237 = `park-2.nb.infra` |
| entry camera | 10.0.10.9:80 → published as **8081** |
| exit camera | 10.0.10.10:80 → published as **8082** |
Done with iptables on the host (needs root; the admin account has no passwordless sudo).
`ip_forward` is already 1 because Docker set it. Docker also sets the FORWARD policy to DROP, so
the explicit ACCEPTs are mandatory, and the SNAT is what brings the camera's replies back through
the host (the cameras' gateway is not the booth):
```bash
iptables -t nat -A PREROUTING -p tcp --dport 8081 -j DNAT --to-destination 10.0.10.9:80
iptables -t nat -A PREROUTING -p tcp --dport 8082 -j DNAT --to-destination 10.0.10.10:80
iptables -t nat -A POSTROUTING -p tcp -d 10.0.10.9 --dport 80 -j SNAT --to-source 10.0.10.101
iptables -t nat -A POSTROUTING -p tcp -d 10.0.10.10 --dport 80 -j SNAT --to-source 10.0.10.101
iptables -I FORWARD -p tcp -d 10.0.10.9 --dport 80 -j ACCEPT
iptables -I FORWARD -p tcp -d 10.0.10.10 --dport 80 -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
apt install -y iptables-persistent && netfilter-persistent save # survive reboots
```
- **Reach:** from any Netbird peer with a policy to park-2, `http://park-2.nb.infra:8081/`
(no router change needed). From the internet only once the router forwards 8081/8082 to
192.168.1.101. PREROUTING does not apply to the host's own traffic — test from another machine.
- **Netbird-only variant:** add `-d 100.75.7.237` to the two PREROUTING rules; then the public
forward can never reach the cameras even if someone adds it on the router.
- **Undo:** the same lines with `-D`. **ufw**, if ever enabled there, also needs
`ufw route allow proto tcp to 10.0.10.9 port 80` (and `.10`).
- **Why not Docker:** `docker run -p 100.75.7.237:8081:80 alpine/socat …` would do the same
without sudo, bound to the overlay only; the user chose the iptables route.
- This is a deliberate hole in [[network-isolation]] (camera web UI reachable off the VLAN);
the camera's own digest auth is the only gate behind it. Keep the public side off unless
needed; prefer the Netbird path.
## Gaps to fill next time you hold the hardware
- Factory address and configuration tool of the **Cashino KP-300H** and the **Rongta RP** units