diff --git a/README.md b/README.md index 0b404c8..9e461b9 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ make setup # Serve the page from the Vite dev server 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 # Run the tests, both linters and the format check @@ -36,9 +36,16 @@ make docker docker run -p 8080:8080 netwatch ``` -`make check` and `make docker` need Docker. `make run` starts `netwatch-server` -on port 8080 with its defaults, so the page's reports are stored in -`data/reports`. `make dev` passes the page's `/api` requests there. +After `make dev`, open the page at `http://localhost:5173/`. From the image, it +is at `http://localhost:8080/`. + +`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 @@ -113,9 +120,10 @@ half second. As soon as one answers, a new round starts. ### Rows, colors and controls 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 dot beside -the host's name takes the same color. The graph's axis ends at 1000 ms; a higher -latency is drawn at the top, and the figure still shows its real value. +from green under 50 ms to red from 500 ms up. The dot beside the host's name +takes the figure's color. A failed check has a gray figure, and a faint red band +in the graph. The graph's axis ends at 1000 ms; a higher 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 first, failed last. The pin button at the left of a row keeps the row at the @@ -140,7 +148,9 @@ fields: 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` (`"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 waits as long as the history holds it: the last 100 rounds of each host. An @@ -218,8 +228,9 @@ reason is in its log. `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 `netwatch-server.yaml` in `/etc/netwatch-server/` or -`~/.config/netwatch-server/`, when one exists. A variable in the environment -wins over a file. +`~/.config/netwatch-server/`, when one exists. In the YAML file, each key is a +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 names the variable. An empty variable counts as unset, except `TRUSTED_PROXIES`.