Refactor bot and integrate services

This commit is contained in:
2026-02-07 22:10:08 +03:00
parent 492e3bd3cf
commit 588127c076
31 changed files with 1061 additions and 849 deletions

16
app.py Normal file
View File

@@ -0,0 +1,16 @@
from aiogram import Bot, Dispatcher
from config import load_cfg, load_env
cfg = load_cfg()
TOKEN = cfg["telegram"]["token"]
ADMIN_ID = cfg["telegram"]["admin_id"]
ARTIFACT_STATE = cfg["paths"]["artifact_state"]
RESTIC_ENV = load_env(cfg["paths"].get("restic_env", "/etc/restic/restic.env"))
DISK_WARN = int(cfg.get("thresholds", {}).get("disk_warn", 80))
LOAD_WARN = float(cfg.get("thresholds", {}).get("load_warn", 2.0))
bot = Bot(TOKEN)
dp = Dispatcher()