Add package update checks and upgrades

This commit is contained in:
2026-02-07 23:00:13 +03:00
parent 8d5eda3244
commit 5ade542828
3 changed files with 98 additions and 1 deletions

View File

@@ -7,6 +7,8 @@ from system_checks import security, disks
from app import cfg
from services.http_checks import get_url_checks, check_url
import asyncio
from services.queue import enqueue
from services.updates import list_updates, apply_updates
@dp.message(F.text == "💽 Disks")
@@ -50,3 +52,29 @@ async def urls(msg: Message):
await msg.answer("\n".join(lines), reply_markup=system_kb)
asyncio.create_task(worker())
@dp.message(F.text == "📦 Updates")
async def updates_list(msg: Message):
if not is_admin_msg(msg):
return
async def job():
text = await list_updates()
await msg.answer(text, reply_markup=system_kb, parse_mode="Markdown")
pos = await enqueue("pkg-updates", job)
await msg.answer(f"🕓 Updates queued (#{pos})", reply_markup=system_kb)
@dp.message(F.text == "⬆️ Upgrade")
async def updates_apply(msg: Message):
if not is_admin_msg(msg):
return
async def job():
text = await apply_updates()
await msg.answer(text, reply_markup=system_kb, parse_mode="Markdown")
pos = await enqueue("pkg-upgrade", job)
await msg.answer(f"🕓 Upgrade queued (#{pos})", reply_markup=system_kb)