From d7ba17a510b2d724a88326389768ef8716f7a73f Mon Sep 17 00:00:00 2001 From: Oleg <18466855+EvaTheSalmon@users.noreply.github.com> Date: Wed, 28 Oct 2026 00:06:21 +0300 Subject: [PATCH 1/3] ci(github): skip ci for docs-only changes Every pull request ran the full ci twice, on the pull request and on the push to master, about 8 minutes each, also when it changed only docs. No test reads the docs or the example files under deploy/, so ci now ignores those paths. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb5d6b..8bb8864 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,30 @@ name: ci +# No test reads these paths. Keep both lists equal. on: pull_request: + paths-ignore: + - "**.md" + - "docs/**" + - "LICENSE" + - "logo.png" + - ".zed/**" + - "deploy/compose.example.yml" + - "deploy/xray/**" + - "deploy/usher/**" + - ".github/workflows/release.yml" push: branches: [master] + paths-ignore: + - "**.md" + - "docs/**" + - "LICENSE" + - "logo.png" + - ".zed/**" + - "deploy/compose.example.yml" + - "deploy/xray/**" + - "deploy/usher/**" + - ".github/workflows/release.yml" permissions: contents: read From 9507694906e58ccf1be53beaabd44df947051016 Mon Sep 17 00:00:00 2001 From: Oleg <18466855+EvaTheSalmon@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:59:03 +0300 Subject: [PATCH 2/3] docs(status): describe AWG online for sleeping phones The README said a WireGuard user reads online while the tunnel is up. A sleeping phone sends no keepalive, so it reads 0 with the tunnel on and 1 for a few minutes after each wake. The table and a new paragraph now say what the handshake window measures. Co-Authored-By: Claude Opus 5.5 (1M context) --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f81bd5..1d6b0cb 100644 --- a/README.md +++ b/README.md @@ -166,11 +166,17 @@ mean different things: | | AmneziaWG | Xray | | ---------------- | -------------------------------------------------- | ------------------------------------------------ | -| online | a handshake less than 180 s ago: 1 while the tunnel is up, 0 up to 180 s after the client disconnects | at least one open proxied connection; an idle client reads 0 | +| online | a handshake less than 180 s ago; a sleeping phone reads 0 | at least one open proxied connection; an idle client reads 0 | | bytes | encrypted packets, keepalives included | proxied payload | | counters reset | when the peer is recreated or the interface restarts | when Xray restarts | | users in the file | users of the interface in `usher.yml` that have a peer | every user of the inbound in `usher.yml` | +An AmneziaWG client handshakes about every 2 minutes while it sends packets, and the +`PersistentKeepalive = 25` of its config keeps it sending while the device is awake. A phone that +sleeps sends no keepalive: it reads 0 while its app still shows the tunnel on, and 1 for a few +minutes each time it wakes. 180 s is the WireGuard key lifetime; a session without a newer +handshake carries no traffic after it. A disconnected client reads 0 at most 180 s later. + `rate()` and `increase()` handle the counter resets. A user gets series only on the interfaces `usher.yml` lists for that user. When usher cannot read the stats of an interface, it logs `reading stats` and leaves the users of that interface out of the file: a missing series From f284d42eef37e00a00a14a980c0275f52c7297bd Mon Sep 17 00:00:00 2001 From: Oleg <18466855+EvaTheSalmon@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:59:03 +0300 Subject: [PATCH 3/3] docs(status): add alert rules for the status file usher shows a down backend by leaving its interfaces out of the file, and a stopped pass by keeping the old content. The only rule in the docs, absent(usher_interface_up), fires only when every backend is down. The new Alerts section names the failures that show only as absence or age, and gives a rule for each. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/operations.md | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/operations.md b/docs/operations.md index e28d45f..af127c7 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -35,9 +35,41 @@ usher writes the file with mode `0644`. A node_exporter that runs as another use reads only `*.prom` files, so it skips the temporary file of a write in progress. A pass that stops early, for example on a `users.json` error, or that a stop signal interrupts, -writes no file, and the file keeps the previous content. node_exporter's -`node_textfile_mtime_seconds` for the file then stops moving; usher writes no timestamp of its own. -A write error is logged as `writing status file`. +writes no file, and the file keeps the previous content. A stopped usher leaves it the same way. +node_exporter keeps serving that content, so every interface still reads 1. usher writes no +timestamp of its own; node_exporter's `node_textfile_mtime_seconds` for the file stops moving. A +write error is logged as `writing status file`. -When every backend is down, usher still writes the file, but it holds no series. Alert on -`absent(usher_interface_up)` as well. +### Alerts + +usher reports most failures by leaving series out, so a rule on `usher_interface_up == 0` alone +misses them: + +- The interfaces of a backend that is down are absent. The other backend keeps + `usher_interface_up` present, so `absent(usher_interface_up)` fires only when every backend is + down and the file holds no series. Each interface needs an `absent` rule of its own. +- A stale file keeps its last values. Only its age shows the failure. + +```yaml +groups: + - name: usher + rules: + - alert: UsherInterfaceDown + expr: usher_interface_up == 0 + for: 2m + - alert: UsherInterfaceAbsent + expr: >- + absent(usher_interface_up{interface="awg0"}) + or absent(usher_interface_up{interface="vless-reality"}) + for: 2m + - alert: UsherStatusEmpty + expr: absent(usher_interface_up) + for: 2m + - alert: UsherStatusStale + expr: time() - node_textfile_mtime_seconds{file=~".*usher.prom"} > 180 + for: 2m +``` + +`UsherInterfaceAbsent` lists the interface names of the deployment; add a term when you add an +interface to a backend. usher runs a pass at least every 30 s, so 180 s of file age is six missed +passes.