README: page address, failed-check band, timestamp form, YAML keys (closes #210)
check / check (push) Canceled after 0s

Getting Started names the address to open for `make dev` and the image,
and says `make run` serves no page. Rows, colors and controls says a
failed check is a faint red band in the graph. Reporting gives the
`timestamp` form. Settings gives an example line of the YAML file.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-11 20:27:10 +00:00
1 parent 93bbd80d57
commit 2183bb224a
1 file changed
+20 -10
+20 -10
View File
@@ -22,7 +22,7 @@ make setup
# Serve the page from the Vite dev server # Serve the page from the Vite dev server
make dev make dev
# Build the page and netwatch-server, then run the server on port 8080 # Build the page and netwatch-server, then run only the server, on port 8080
make run make run
# Run the tests, both linters and the format check # Run the tests, both linters and the format check
@@ -36,9 +36,16 @@ make docker
docker run -p 8080:8080 netwatch docker run -p 8080:8080 netwatch
``` ```
`make check` and `make docker` need Docker. `make run` starts `netwatch-server` After `make dev`, open the page at `http://localhost:5173/`. From the image, it
on port 8080 with its defaults, so the page's reports are stored in is at `http://localhost:8080/`.
`data/reports`. `make dev` passes the page's `/api` requests there.
`make run` serves no page: `http://localhost:8080/` answers
`404 page not found`. It starts `netwatch-server` on port 8080 with its
defaults, which stores reports in `data/reports`. `make dev` passes the page's
`/api` requests there, so run `make run` in a second terminal to store the
page's reports.
`make check` and `make docker` need Docker.
## The page ## The page
@@ -113,9 +120,9 @@ half second. As soon as one answers, a new round starts.
### Rows, colors and controls ### Rows, colors and controls
A figure and its line in the graph take the color of the legend in the footer, A figure and its line in the graph take the color of the legend in the footer,
from green under 50 ms to red from 500 ms up; gray is no answer. The graph's from green under 50 ms to red from 500 ms up. A failed check has a gray figure,
axis ends at 1000 ms; a higher latency is drawn at the top, and the figure still and a faint red band in the graph. The graph's axis ends at 1000 ms; a higher
shows its real value. latency is drawn at the top, and the figure still shows its real value.
From time to time, the page sorts the WAN rows by their latest latency: fastest From time to time, the page sorts the WAN rows by their latest latency: fastest
first, failed last. The pin button at the left of a row keeps the row at the first, failed last. The pin button at the left of a row keeps the row at the
@@ -140,7 +147,9 @@ fields:
and `history`, its samples. A sample has the check's time `t` in Unix and `history`, its samples. A sample has the check's time `t` in Unix
milliseconds, its `latency` (`null` for a failed check) and its `error` milliseconds, its `latency` (`null` for a failed check) and its `error`
(`"timeout"`, `"unreachable"` or `null`). (`"timeout"`, `"unreachable"` or `null`).
- `timestamp`: the time of the report - `timestamp`: the time of the report, as an ISO 8601 string such as
`2026-11-11T20:01:35.685Z`. A report whose `timestamp` is a number is refused
with 400.
Each report carries only the samples no earlier report has delivered. A sample Each report carries only the samples no earlier report has delivered. A sample
waits as long as the history holds it: the last 100 rounds of each host. An waits as long as the history holds it: the last 100 rounds of each host. An
@@ -218,8 +227,9 @@ reason is in its log.
`netwatch-server` reads its settings from environment variables. It also reads a `netwatch-server` reads its settings from environment variables. It also reads a
`.env` file in the directory it starts in, and a YAML file named `.env` file in the directory it starts in, and a YAML file named
`netwatch-server.yaml` in `/etc/netwatch-server/` or `netwatch-server.yaml` in `/etc/netwatch-server/` or
`~/.config/netwatch-server/`, when one exists. A variable in the environment `~/.config/netwatch-server/`, when one exists. In the YAML file, each key is a
wins over a file. variable's name, in upper or lower case: `PORT: 8090` sets the port. A variable
in the environment wins over a file.
The server does not start when a variable holds a value it cannot use. Its error The server does not start when a variable holds a value it cannot use. Its error
names the variable. An empty variable counts as unset, except `TRUSTED_PROXIES`. names the variable. An empty variable counts as unset, except `TRUSTED_PROXIES`.