Add audit logging with weekly rotation
This commit is contained in:
@@ -13,6 +13,7 @@ from services.npmplus import fetch_certificates, format_certificates
|
||||
import state
|
||||
from state import UPDATES_CACHE, REBOOT_PENDING
|
||||
from services.metrics import summarize
|
||||
from services.audit import read_audit_tail
|
||||
|
||||
|
||||
@dp.message(F.text == "💽 Disks")
|
||||
@@ -68,6 +69,17 @@ async def metrics(msg: Message):
|
||||
await msg.answer(summarize(state.METRICS_STORE, minutes=15), reply_markup=system_kb)
|
||||
|
||||
|
||||
@dp.message(F.text == "🧾 Audit")
|
||||
async def audit_log(msg: Message):
|
||||
if not is_admin_msg(msg):
|
||||
return
|
||||
text = read_audit_tail(cfg, limit=200)
|
||||
if text.startswith("⚠️") or text.startswith("ℹ️"):
|
||||
await msg.answer(text, reply_markup=system_kb)
|
||||
else:
|
||||
await msg.answer(text, reply_markup=system_kb, parse_mode="Markdown")
|
||||
|
||||
|
||||
@dp.message(F.text == "🔒 SSL")
|
||||
async def ssl_certs(msg: Message):
|
||||
if not is_admin_msg(msg):
|
||||
|
||||
Reference in New Issue
Block a user