mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
feat: enable Telegram WebApp button via HTTPS (nip.io + Let's Encrypt)
- WebApp inline button uses https://IP.nip.io/telegram-app - Bot menu button 'VPS Panel' set via setChatMenuButton API - nginx reverse proxy with valid SSL cert on port 443 - Fallback to regular URL button if WebApp fails Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,9 +41,17 @@ async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
[InlineKeyboardButton("⚙️ Управление", callback_data="manage")],
|
||||
]
|
||||
|
||||
keyboard.append([
|
||||
InlineKeyboardButton("🌐 Открыть панель", url=f"http://{_get_host()}:7272")
|
||||
])
|
||||
# WebApp button (HTTPS via nip.io for valid SSL)
|
||||
host = _get_host()
|
||||
webapp_url = f"https://{host}.nip.io/telegram-app"
|
||||
try:
|
||||
keyboard.append([
|
||||
InlineKeyboardButton("📱 Открыть панель", web_app=WebAppInfo(url=webapp_url))
|
||||
])
|
||||
except Exception:
|
||||
keyboard.append([
|
||||
InlineKeyboardButton("🌐 Открыть панель", url=f"http://{host}:7272")
|
||||
])
|
||||
|
||||
reply_markup = InlineKeyboardMarkup(keyboard)
|
||||
await update.message.reply_text(text, reply_markup=reply_markup, parse_mode="Markdown")
|
||||
|
||||
Reference in New Issue
Block a user