From fcec92e2decf2a994e4c6754a59ff7cfb4e25004 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 3 Oct 2026 15:27:52 -0700 Subject: [PATCH] feat: the site keeps the crash reports Snowbound sends to POST /crash Plain text or JSON up to 64 KB, ten an hour from an address and 500 an hour in all, each a timestamped file in --crashes (crashes beside the root by default), nothing echoed back. --trust-forwarded counts senders as the relay does, whose address rule both now share. Assisted-by: claude-opus-5.5 --- crates/relay/README.md | 14 +- crates/relay/deploy/snowbound-site.service | 3 +- crates/relay/src/lib.rs | 28 +++- crates/relay/src/server.rs | 39 +---- crates/relay/src/site.rs | 180 +++++++++++++++++++-- crates/relay/src/site_main.rs | 22 ++- crates/relay/tests/site.rs | 100 +++++++++++- 7 files changed, 325 insertions(+), 61 deletions(-) diff --git a/crates/relay/README.md b/crates/relay/README.md index a95a496196a2f6157f5a9aba333cf4c578a48617..a11136cb1754c4b0588104a039bcbd4809d8a2a2 100644 --- a/crates/relay/README.md +++ b/crates/relay/README.md @@ -86,8 +86,13 @@ code (`/7KQ-4MZ-9XR`, read as loosely as the app reads one) a page that opens it `snowbound://join/`, and in the web build where `--web` names where (once the web build joins shares). Anything else under the folder is a file; `/` is its `index.html`. A build's module and JavaScript sit in `b//` and are cached for good; `index.html` and the -codes' pages are checked on every load, and the rest (fonts, dictionaries) for a day. It -holds no state. +codes' pages are checked on every load, and the rest (fonts, dictionaries) for a day. + +`POST /crash` takes a crash report the app sends when its user chooses Send Report: plain +text or JSON up to 64 KB, ten an hour from one address and 500 an hour in all, each kept as +a file named for when it came (`2026-10-03T21-04-05Z-1a2b3c4d.txt`) in `--crashes`, by +default `crashes` beside the root. Nothing else is kept, and nothing sent comes back. Behind +a proxy, `--trust-forwarded true` counts senders by the address it adds, as the relay does. `python3 tools/release_web.py --deploy` builds the web app and the site for the VPS's architecture, copies the build into `~/snowbound-web/site/` (keeping the last three builds' @@ -99,7 +104,7 @@ ssh vps mkdir -p ~/snowbound-web/site # after the first `release_web.py --deploy` has put the binary there: pm2 start ~/snowbound-web/snowbound-site --name snowbound-site -- \ - --listen 127.0.0.1:23593 --root "$HOME/snowbound-web/site" + --listen 127.0.0.1:23593 --root "$HOME/snowbound-web/site" --trust-forwarded true pm2 save ``` @@ -112,7 +117,8 @@ snowbound.paperclover.net { } ``` -`snowbound-site.service` runs it under systemd instead (`--root /srv/snowbound/web`). +`snowbound-site.service` runs it under systemd instead (`--root /srv/snowbound/web`, the +reports in `/var/lib/snowbound-site`). `snowbound-site --help` lists the options, each also `SNOWBOUND_SITE_