Compare commits

..
1 Commits
Author SHA1 Message Date
ahtlon d79e68fc0e [gitea_translater] add /health and monitor on overwatch
Hydra callback / on_push (pull_request) Skipped
Hydra callback / on_pr (pull_request) Successful in 7m17s
Check flake syntax / flake-check (push) Successful in 22m27s
2026-10-16 21:22:25 +02:00
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -20,6 +20,7 @@
services.malobeo.gitea-translator = {
enable = true;
host = "0.0.0.0";
};
services.hydra = {
+1
View File
@@ -145,6 +145,7 @@ in
"https://keys.malobeo.org"
"https://tasklist.malobeo.org"
"https://zines.malobeo.org"
"http://${hosts.malobeo.hosts.albert.network.address}:27364/health"
];
}];
+10 -1
View File
@@ -26,7 +26,7 @@ def _parse_response(baseurl, owner, repo):
return pulls
class PullsHandler(BaseHTTPRequestHandler):
_VALID_PATHS={"/", "/gitea-pulls-sorted.json"}
_VALID_PATHS={"/", "/gitea-pulls-sorted.json", "/health"}
# Class variables to store configuration
baseurl = None
@@ -34,6 +34,15 @@ class PullsHandler(BaseHTTPRequestHandler):
repo = None
def do_GET(self):
if self.path == "/health":
body=json.dumps({"status": "ok"}).encode("utf-8")
self.send_response(200)
self.send_header("Content-Type", "application/json; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
return
if self.path not in self._VALID_PATHS:
self.send_error(404, "Not Found")
return