Code1 now only submits within the correct time window

This commit is contained in:
2026-10-13 22:59:05 -05:00
parent 8775601f49
commit 1ec94767f0
3 changed files with 39 additions and 4 deletions
+7 -2
View File
@@ -71,7 +71,12 @@ step when ready.
The robot submits code 1 with `POST /event/buzz` and a JSON body containing
`delay_ms` (a non-negative integer) and `secret` (the value of `CODE1_SECRET`).
The server subtracts the target delay of 6430 ms from `delay_ms` to calculate
the signed buzz delta.
the signed buzz delta. Deltas outside the inclusive range -500 to +500 ms are
logged and ignored; the endpoint returns HTTP `200` and does not record the
submission or send/log the submission actions. Accepted submissions return
HTTP `202`. Correctly timed buzzes are only accepted between 11:00 AM and
1:30 PM, inclusive, in the `America/Chicago` timezone. Requests outside that
window are logged and return HTTP `200` without running submission actions.
Set `CODE1_SECRET` to a unique random secret of at least 32 bytes in
`.env`. For example, with the server running locally:
@@ -167,7 +172,7 @@ Set the following environment variables (updating for your project as needed):
export LEPTOS_OUTPUT_NAME="code_submission"
export LEPTOS_SITE_ROOT="site"
export LEPTOS_SITE_PKG_DIR="pkg"
export LEPTOS_SITE_ADDR="127.0.0.1:3000"
export LEPTOS_SITE_ADDR="0.0.0.0:3000"
export LEPTOS_RELOAD_PORT="3001"
```
Finally, run the server binary.