diff --git a/install.sh b/install.sh index eee7c9d..0f63798 100644 --- a/install.sh +++ b/install.sh @@ -331,11 +331,25 @@ async def cmd_restart(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: async def cmd_logs(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: if not update.effective_user or not _ok(update.effective_user.id): return - code, out, err = await sh("docker", "logs", "--tail", "30", CONTAINER_NAME, timeout=15) - text = f"
{html.escape(out or err or 'Логов нет.')}"
+
+ running = await proxy_running()
+ if not running:
+ text = "❌ Контейнер не найден или остановлен."
+ else:
+ # Запрашиваем 50 строк и объединяем выводы
+ code, out, err = await sh("docker", "logs", "--tail", "50", CONTAINER_NAME, timeout=15)
+ combined_logs = (out.strip() + "\n" + err.strip()).strip()
+
+ if not combined_logs:
+ text = "📋 Контейнер запущен, но логи пока пусты.\nПопробуйте подключиться к прокси, чтобы появились записи."
+ else:
+ text = f"{html.escape(combined_logs)}"
+
kb = InlineKeyboardMarkup([[InlineKeyboardButton("◀️ Меню", callback_data="menu_main")]])
- if update.callback_query: await update.callback_query.edit_message_text(text, parse_mode="HTML", reply_markup=kb)
- else: await update.message.reply_text(text, parse_mode="HTML", reply_markup=kb)
+ if update.callback_query:
+ await update.callback_query.edit_message_text(text, parse_mode="HTML", reply_markup=kb)
+ else:
+ await update.message.reply_text(text, parse_mode="HTML", reply_markup=kb)
async def do_install(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
domain = ctx.user_data.get("install_domain", "google.com")