mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix: the API verifies a backup and shows what was found; Docker's health check reads /healthz
The backups API had every backup action but Verify, and did not show a backup's verified_at and damage: a script restoring through it got no sign of a damaged chain. Docker's health check asked for the login page, so a hung job worker left the container healthy; it now reads /healthz.
This commit is contained in:
parent
fc6ad4e8ca
commit
7b23c75bf5
5 changed files with 42 additions and 6 deletions
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/sh
|
||||
# Docker's health check: every process has run for 5 s at least (one that
|
||||
# keeps failing never has) and the panel answers through nginx.
|
||||
# keeps failing never has) and the panel answers /healthz through nginx: its
|
||||
# database answers and the job worker beats (a hung worker runs still).
|
||||
# X-Forwarded-Proto: https keeps the HTTPS profile from redirecting it.
|
||||
# "webvirtcloud:worker RUNNING pid 27, uptime 0:00:10" (or "1 day, 0:00:10")
|
||||
supervisorctl status | awk '
|
||||
$2 != "RUNNING" { print; bad = 1; next }
|
||||
$0 !~ / day/ { split($NF, t, ":"); if (t[1] * 3600 + t[2] * 60 + t[3] < 5) { print; bad = 1 } }
|
||||
END { exit bad }' || exit 1
|
||||
exec /srv/webvirtcloud/venv/bin/python3 -c "import urllib.request as u; u.urlopen(u.Request('http://127.0.0.1/accounts/login/', headers={'X-Forwarded-Proto': 'https'}), timeout=5)"
|
||||
exec /srv/webvirtcloud/venv/bin/python3 -c "import urllib.request as u; u.urlopen(u.Request('http://127.0.0.1/healthz', headers={'X-Forwarded-Proto': 'https'}), timeout=5)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue