Commit graph

4 commits

Author SHA1 Message Date
Pēteris Caune
2dd4994259
Fix fetchstatus.py (again) to handle SITE_ROOT with a path
cc: #1108
2024-12-20 11:38:33 +02:00
Pēteris Caune
0f6099b311
Fix fetchstatus.py to handle SITE_ROOT with a path
Fixes: #1107
2024-12-19 09:35:31 +02:00
Pēteris Caune
0bf73bf743
Rewrite the fetchstatus.py script to reduce Docker container CPU use
fetchstatus.py was a Django management command, and is now
a standalone script. This way we avoid doing Django housekeeping
every time it runs (every 10 seconds). It still needs to access
the ALLOWED_HOSTS setting, to make the HTTP request with
a correct Host header.

Fixes: #1071
2024-10-22 10:53:47 +03:00
Pēteris Caune
320a7c7733
Fix the Docker healthcheck script to supply correct Host header
Commit 8fed685f12 added a HEALTHCHECK
instruction in the Dockerfile. The healthcheck script calls http://localhost:8000/api/v3/status/, which fails if localhost is not in ALLOWED_HOSTS.

With this change, the healthcheck script is now a Django management
command. It reads Django's ALLOWED_HOSTS setting, grabs the first
element, and uses it in the "Host:" HTTP header when making a HTTP
request.

cc: #1051
2024-08-21 15:52:19 +03:00