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:
Андрей Бобырев
2026-05-20 12:46:58 +03:00
parent fab7ed7912
commit 68b4521ae9

View File

@@ -41,8 +41,16 @@ async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
[InlineKeyboardButton("⚙️ Управление", callback_data="manage")],
]
# 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("🌐 Открыть панель", url=f"http://{_get_host()}:7272")
InlineKeyboardButton("📱 Открыть панель", web_app=WebAppInfo(url=webapp_url))
])
except Exception:
keyboard.append([
InlineKeyboardButton("🌐 Открыть панель", url=f"http://{host}:7272")
])
reply_markup = InlineKeyboardMarkup(keyboard)