Add Gitea health check

This commit is contained in:
2026-02-08 02:41:50 +03:00
parent 857fa86e85
commit 0f7f53cb27
6 changed files with 125 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ from services.queue import enqueue
from services.updates import list_updates, apply_updates
from services.runner import run_cmd
from services.npmplus import fetch_certificates, format_certificates, list_proxy_hosts, set_proxy_host
from services.gitea import get_gitea_health
import state
from state import UPDATES_CACHE, REBOOT_PENDING
from services.metrics import summarize
@@ -246,6 +247,23 @@ async def ssl_certs(msg: Message):
asyncio.create_task(worker())
@dp.message(F.text == "🍵 Gitea")
async def gitea_health(msg: Message):
if not is_admin_msg(msg):
return
await msg.answer("⏳ Checking Gitea health…", reply_markup=system_logs_kb)
async def worker():
try:
text = await asyncio.to_thread(get_gitea_health, cfg)
except Exception as e:
text = f"⚠️ Gitea error: {e}"
await msg.answer(text, reply_markup=system_logs_kb)
asyncio.create_task(worker())
@dp.message(F.text == "🧩 NPMplus")
async def npmplus_hosts(msg: Message):
if not is_admin_msg(msg):