Root cause of the 404: _trigger_rebuild was firing bincio render (= full astro build), but:

1. The build took minutes → 404 during that window
  2. Even after the build, the output lands in site/dist/ — nginx serves from /var/www/bincio/ which is only updated by the rsync in the post-receive hook, not by the server process

  Fixes applied:

  1. bincio/render/cli.py: Added --no-build flag — merges sidecars and updates manifests but skips astro build. This is fast (~1 second).
  2. bincio/serve/server.py _trigger_rebuild: Now passes --no-build. After an upload, _merged/ and root index.json are updated immediately, so the feed reflects the new activity. The static Astro pages are
  only rebuilt on git push.
  3. site/src/components/ActivityDetailLoader.svelte (new): Svelte component that reads the activity ID from the URL, calls loadIndex to resolve the shard tree, then renders ActivityDetail dynamically — no
  pre-built page needed.
  4. site/src/pages/activity/index.astro (new): Generic Astro shell page that renders ActivityDetailLoader. Gets compiled to dist/activity/index.html.
  5. docs/deployment/vps.md: Added location /activity/ { try_files $uri $uri/ /activity/index.html; } to the nginx config. When a request arrives for /activity/2026-04-06T153345Z/ and no pre-built file
  exists, nginx serves the shell, which loads the data dynamically from /data/ (which nginx already serves live from disk).
This commit is contained in:
Davide Scaini
2026-04-10 17:48:23 +02:00
parent 61349e6292
commit eeed3fe3b2
5 changed files with 69 additions and 2 deletions
+11
View File
@@ -253,6 +253,17 @@ server {
add_header Cache-Control "no-cache, must-revalidate";
}
# Activity detail pages: fall back to the dynamic shell for activities uploaded
# after the last site build (avoids 404 while waiting for a rebuild).
location /activity/ {
try_files $uri $uri/ /activity/index.html;
}
# Per-user profile pages: same fallback for new users.
location /u/ {
try_files $uri $uri/ =404;
}
# Static files
location / {
try_files $uri $uri/ $uri.html =404;