ops/dossiers-ngi: cascade bar dates, center/mobile, soft refresh; serve /cascade

This commit is contained in:
Hernâni Marques 2026-09-30 15:54:46 +02:00
parent 737d37a76d
commit 84623b7c9a
No known key found for this signature in database
6 changed files with 391 additions and 110 deletions

View file

@ -87,18 +87,22 @@ rsync -avz --exclude .DS_Store "$SITE/branch-status.json" "$WWW/branch-status.js
`bar.js` fetches `/branch-status.json` and draws:
```
main @ d2fbd79
├── feat/sm-content @ …
main @ d2fbd79 · tip 2026-09-01 16:52 · build 8.4s · at 2026-09-30 15:23
├── feat/sm-content @ … · tip YYYY-MM-DD HH:MM · …
│ └── …
└── project_template @ …
```
`tip` / `at` always include **date + HH:MM** (ISO already in JSON; clock-only was misleading across days). The bar is **viewport-centered** (max-width 45em, mobile-friendly). Poll every 30s **updates tip/build/at text in place** when the branch structure is unchanged (no full tree remount).
Each name links to `/_cascade/use/<edition>` (cookie + 302 `/`). Caddy map:
```
~^[A-Za-z0-9_-]+$ {http.request.cookie.tdpd_edition}
```
Also serve `/cascade/*` from the site www root (path stubs). Live Caddy must not use a trailing `~.* flask` catch-all.
so new branches need no Caddy edit — only an `editions/<slug>/` tree.
```bash

View file

@ -21,6 +21,13 @@
root * /var/www/monitoring-sites/dossiers.ngi.hacktivism.ch
file_server
}
# Path-root cascade stubs (feat-website-views, …) live under sites/…/cascade/
# and must not fall through to editions/{cookie}/ (that yields 404).
handle /cascade/* {
root * /var/www/monitoring-sites/dossiers.ngi.hacktivism.ch
file_server
try_files {path} {path}/ {path}/index.html
}
handle /branch-status.json {
root * /var/www/monitoring-sites/dossiers.ngi.hacktivism.ch
file_server
@ -28,6 +35,8 @@
# Dynamic editions: cookie value is the dir name under editions/
# (hourly builder stages every origin/* tip as slug with / → -).
# Do not append a catch-all `~.* flask` — that forces unknown cookies
# (and can mask missing edition dirs) onto the default freeze.
map {http.request.cookie.tdpd_edition} {edition_dir} {
default flask
flask flask