From b2ceb854f5c5f153589dd5861b14ef222e4a5b22 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 3 Jul 2026 09:23:07 +0200 Subject: [PATCH] feat(tgbot): include hostname in backup and ban-log messages Backup and ban-log pushes carried no server identity, so admins running the bot against several panels could not tell which server a backup came from. Prepend the same hostname line the periodic report and event notifications already use; the tgbot.messages.hostname key exists in all locales, so no new i18n keys are needed. Closes #5387 --- internal/web/service/tgbot/tgbot_report.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/web/service/tgbot/tgbot_report.go b/internal/web/service/tgbot/tgbot_report.go index 61dff6cba..25395e76a 100644 --- a/internal/web/service/tgbot/tgbot_report.go +++ b/internal/web/service/tgbot/tgbot_report.go @@ -396,7 +396,8 @@ func (t *Tgbot) onlineClients(chatId int64, messageID ...int) { // sendBackup sends a backup of the database and configuration files. func (t *Tgbot) sendBackup(chatId int64) { - output := t.I18nBot("tgbot.messages.backupTime", "Time=="+time.Now().Format("2006-01-02 15:04:05")) + output := t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) + output += t.I18nBot("tgbot.messages.backupTime", "Time=="+time.Now().Format("2006-01-02 15:04:05")) t.SendMsgToTgbot(chatId, output) // Send database backup (SQLite file, or a pg_dump archive on PostgreSQL) @@ -442,7 +443,8 @@ func (t *Tgbot) sendBackup(chatId int64) { // sendBanLogs sends the ban logs to the specified chat. func (t *Tgbot) sendBanLogs(chatId int64, dt bool) { if dt { - output := t.I18nBot("tgbot.messages.datetime", "DateTime=="+time.Now().Format("2006-01-02 15:04:05")) + output := t.I18nBot("tgbot.messages.hostname", "Hostname=="+hostname) + output += t.I18nBot("tgbot.messages.datetime", "DateTime=="+time.Now().Format("2006-01-02 15:04:05")) t.SendMsgToTgbot(chatId, output) }