detached 618e538

fix(wiki): validate http_status is numeric before integer comparison

jq outputs "null" for missing JSON fields, which breaks bash integer
comparisons. Guard both the main check and the stricter alternative
with a regex test, and flag non-numeric values as unavailable.
commit
618e538d19326c0a43638e059154379117a667b1
author
brice · · 2026-03-24 05:39 UTC
parent
759791c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +7 -3
M wiki/guides/health-monitoring.md +7 -3
@@ -38,8 +38,10 @@ while IFS= read -r route; do
3838 http_status=$(echo "$route" | jq -r '.http_status')
3939 container_status=$(echo "$route" | jq -r '.container_status')
4040
41- # HTTP status: flag 4xx, 5xx, or 0 (no response)
42- if [[ "$http_status" -eq 0 ]] || [[ "$http_status" -ge 400 ]]; then
41+ # HTTP status: flag 4xx, 5xx, 0 (no response), or unavailable
42+ if ! [[ "$http_status" =~ ^[0-9]+$ ]]; then
43+ problems+=("$domain: HTTP status unavailable ($http_status)")
44+ elif [[ "$http_status" -eq 0 ]] || [[ "$http_status" -ge 400 ]]; then
4345 problems+=("$domain: HTTP $http_status")
4446 fi
4547
@@ -170,7 +172,9 @@ StandardError=append:%h/.local/share/gordon-watchdog.log
170172 **Stricter HTTP checks**: if you want to flag anything that isn't exactly 200, replace the HTTP check with:
171173
172174 ```bash
173-if [[ "$http_status" -ne 200 ]]; then
175+if ! [[ "$http_status" =~ ^[0-9]+$ ]]; then
176+ problems+=("$domain: HTTP status unavailable ($http_status)")
177+elif [[ "$http_status" -ne 200 ]]; then
174178 problems+=("$domain: HTTP $http_status")
175179 fi
176180 ```
@@ -38,8 +38,10 @@ while IFS= read -r route; do
38 http_status=$(echo "$route" | jq -r '.http_status')38 http_status=$(echo "$route" | jq -r '.http_status')
39 container_status=$(echo "$route" | jq -r '.container_status')39 container_status=$(echo "$route" | jq -r '.container_status')
40 40
41- # HTTP status: flag 4xx, 5xx, or 0 (no response)41+ # HTTP status: flag 4xx, 5xx, 0 (no response), or unavailable
42- if [[ "$http_status" -eq 0 ]] || [[ "$http_status" -ge 400 ]]; then42+ if ! [[ "$http_status" =~ ^[0-9]+$ ]]; then
43+ problems+=("$domain: HTTP status unavailable ($http_status)")
44+ elif [[ "$http_status" -eq 0 ]] || [[ "$http_status" -ge 400 ]]; then
43 problems+=("$domain: HTTP $http_status")45 problems+=("$domain: HTTP $http_status")
44 fi46 fi
45 47
@@ -170,7 +172,9 @@ StandardError=append:%h/.local/share/gordon-watchdog.log
170 **Stricter HTTP checks**: if you want to flag anything that isn't exactly 200, replace the HTTP check with:172 **Stricter HTTP checks**: if you want to flag anything that isn't exactly 200, replace the HTTP check with:
171 173
172 ```bash174 ```bash
173-if [[ "$http_status" -ne 200 ]]; then175+if ! [[ "$http_status" =~ ^[0-9]+$ ]]; then
176+ problems+=("$domain: HTTP status unavailable ($http_status)")
177+elif [[ "$http_status" -ne 200 ]]; then
174 problems+=("$domain: HTTP $http_status")178 problems+=("$domain: HTTP $http_status")
175 fi179 fi
176 ```180 ```

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close