mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
357 lines
12 KiB
Text
357 lines
12 KiB
Text
# SOME DESCRIPTIVE TITLE.
|
||
# Copyright (C) 2023, aiogram Team
|
||
# This file is distributed under the same license as the aiogram package.
|
||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
|
||
#
|
||
#, fuzzy
|
||
msgid ""
|
||
msgstr ""
|
||
"Project-Id-Version: aiogram \n"
|
||
"Report-Msgid-Bugs-To: \n"
|
||
"POT-Creation-Date: 2023-10-29 02:22+0300\n"
|
||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||
"MIME-Version: 1.0\n"
|
||
"Content-Type: text/plain; charset=utf-8\n"
|
||
"Content-Transfer-Encoding: 8bit\n"
|
||
"Generated-By: Babel 2.13.1\n"
|
||
|
||
#: ../../dispatcher/webhook.rst:5
|
||
msgid "Webhook"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:7
|
||
msgid ""
|
||
"Telegram Bot API supports webhook. If you set webhook for your bot, "
|
||
"Telegram will send updates to the specified url. You can use "
|
||
":meth:`aiogram.methods.set_webhook.SetWebhook` method to specify a url "
|
||
"and receive incoming updates on it."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:14
|
||
msgid "If you use webhook, you can't use long polling at the same time."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:16
|
||
msgid ""
|
||
"Before start i'll recommend you to read `official Telegram's "
|
||
"documentation about webhook <https://core.telegram.org/bots/webhooks>`_"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:18
|
||
msgid "After you read it, you can start to read this section."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:20
|
||
msgid ""
|
||
"Generally to use webhook with aiogram you should use any async web "
|
||
"framework. By out of the box aiogram has an aiohttp integration, so we'll"
|
||
" use it."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:25
|
||
msgid ""
|
||
"You can use any async web framework you want, but you should write your "
|
||
"own integration if you don't use aiohttp."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:29
|
||
msgid "aiohttp integration"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:31
|
||
msgid "Out of the box aiogram has aiohttp integration, so you can use it."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:33
|
||
msgid ""
|
||
"Here is available few ways to do it using different implementations of "
|
||
"the webhook controller:"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:35
|
||
msgid ""
|
||
":class:`aiogram.webhook.aiohttp_server.BaseRequestHandler` - Abstract "
|
||
"class for aiohttp webhook controller"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:36
|
||
msgid ""
|
||
":class:`aiogram.webhook.aiohttp_server.SimpleRequestHandler` - Simple "
|
||
"webhook controller, uses single Bot instance"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:37
|
||
msgid ""
|
||
":class:`aiogram.webhook.aiohttp_server.TokenBasedRequestHandler` - Token"
|
||
" based webhook controller, uses multiple Bot instances and tokens"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:39
|
||
msgid "You can use it as is or inherit from it and override some methods."
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:1 of
|
||
msgid ""
|
||
"Base handler that helps to handle incoming request from aiohttp and "
|
||
"propagate it to the Dispatcher"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.ip_filter_middleware of
|
||
msgid "Parameters"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:4
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:3
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:9 of
|
||
msgid "instance of :class:`aiogram.dispatcher.dispatcher.Dispatcher`"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.__init__:5 of
|
||
msgid ""
|
||
"immediately responds to the Telegram instead of a waiting end of a "
|
||
"handler process"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:1 of
|
||
msgid "Register route and shutdown callback"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:3
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:3 of
|
||
msgid "instance of aiohttp Application"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.register:4
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:4 of
|
||
msgid "route path"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:1
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:1 of
|
||
msgid "This method should be implemented in subclasses of this class."
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:3
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:3 of
|
||
msgid "Resolve Bot instance from request."
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot
|
||
#: aiogram.webhook.aiohttp_server.ip_filter_middleware of
|
||
msgid "Returns"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.BaseRequestHandler.resolve_bot:6
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.resolve_bot:6 of
|
||
msgid "Bot instance"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:1 of
|
||
msgid "Handler for single Bot instance"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:4
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:10 of
|
||
msgid ""
|
||
"immediately responds to the Telegram instead of a waiting end of handler "
|
||
"process"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.__init__:6 of
|
||
msgid "instance of :class:`aiogram.client.bot.Bot`"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.SimpleRequestHandler.close:1 of
|
||
msgid "Close bot session"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:1 of
|
||
msgid ""
|
||
"Handler that supports multiple bots the context will be resolved from "
|
||
"path variable 'bot_token'"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:6 of
|
||
msgid ""
|
||
"This handler is not recommended in due to token is available in URL and "
|
||
"can be logged by reverse proxy server or other middleware."
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.__init__:12 of
|
||
msgid "kwargs that will be passed to new Bot instance"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.register:1 of
|
||
msgid "Validate path, register route and shutdown callback"
|
||
msgstr ""
|
||
|
||
#: aiogram.webhook.aiohttp_server.TokenBasedRequestHandler.resolve_bot:1 of
|
||
msgid "Get bot token from a path and create or get from cache Bot instance"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:51
|
||
msgid "Security"
|
||
msgstr "Безпека"
|
||
|
||
#: ../../dispatcher/webhook.rst:53
|
||
msgid ""
|
||
"Telegram supports two methods to verify incoming requests that they are "
|
||
"from Telegram:"
|
||
msgstr "Telegram підтримує два методи перевірки вхідних запитів, що вони надходять від Telegram:"
|
||
|
||
#: ../../dispatcher/webhook.rst:56
|
||
msgid "Using a secret token"
|
||
msgstr "Використання секретного токена"
|
||
|
||
#: ../../dispatcher/webhook.rst:58
|
||
msgid ""
|
||
"When you set webhook, you can specify a secret token and then use it to "
|
||
"verify incoming requests."
|
||
msgstr ""
|
||
"Коли ви налаштовуєте webhook, ви можете вказати секретний токен і потім "
|
||
"використовувати його для перевірки вхідних запитів."
|
||
|
||
#: ../../dispatcher/webhook.rst:61
|
||
msgid "Using IP filtering"
|
||
msgstr "Використання фільтрації за IP"
|
||
|
||
#: ../../dispatcher/webhook.rst:63
|
||
msgid ""
|
||
"You can specify a list of IP addresses from which you expect incoming "
|
||
"requests, and then use it to verify incoming requests."
|
||
msgstr ""
|
||
"Ви можете вказати список IP-адрес, з яких очікуєте вхідні запити, і "
|
||
"використовувати його для перевірки запитів."
|
||
|
||
#: ../../dispatcher/webhook.rst:65
|
||
msgid ""
|
||
"It can be acy using firewall rules or nginx configuration or middleware "
|
||
"on application level."
|
||
msgstr ""
|
||
"Це можна зробити за допомогою правил firewall, конфігурації nginx або "
|
||
"middleware на рівні застосунку."
|
||
|
||
#: ../../dispatcher/webhook.rst:67
|
||
msgid ""
|
||
"So, aiogram has an implementation of the IP filtering middleware for "
|
||
"aiohttp."
|
||
msgstr ""
|
||
"Тому в aiogram є реалізація middleware для фільтрації за IP для aiohttp."
|
||
|
||
#: ../../dispatcher/webhook.rst:69
|
||
msgid ""
|
||
"`aiogram` IP filtering middleware reads the left-most IP address from "
|
||
"`X-Forwarded-For`."
|
||
msgstr ""
|
||
"IP-фільтр middleware в `aiogram` читає крайню ліву IP-адресу з "
|
||
"`X-Forwarded-For`."
|
||
|
||
#: ../../dispatcher/webhook.rst:73
|
||
msgid ""
|
||
"`X-Forwarded-For` is trustworthy only if all webhook traffic goes through a"
|
||
" trusted reverse proxy that rewrites this header. If your application is "
|
||
"directly reachable from the Internet, this header can be forged."
|
||
msgstr ""
|
||
"`X-Forwarded-For` можна вважати надійним лише тоді, коли весь webhook-"
|
||
"трафік проходить через довірений reverse proxy, який перезаписує цей "
|
||
"заголовок. Якщо ваш застосунок напряму доступний з Інтернету, цей "
|
||
"заголовок можна підробити."
|
||
|
||
#: ../../dispatcher/webhook.rst:76
|
||
msgid "For production deployments, use defense in depth:"
|
||
msgstr "Для production-деплойментів використовуйте багаторівневий захист:"
|
||
|
||
#: ../../dispatcher/webhook.rst:78
|
||
msgid "Always set and verify :code:`X-Telegram-Bot-Api-Secret-Token`"
|
||
msgstr "Завжди встановлюйте та перевіряйте :code:`X-Telegram-Bot-Api-Secret-Token`"
|
||
|
||
#: ../../dispatcher/webhook.rst:79
|
||
msgid ""
|
||
"Restrict network access to the webhook endpoint (firewall, security "
|
||
"groups, ACL)"
|
||
msgstr ""
|
||
"Обмежуйте мережевий доступ до webhook endpoint (firewall, security groups, "
|
||
"ACL)"
|
||
|
||
#: ../../dispatcher/webhook.rst:80
|
||
msgid ""
|
||
"Ensure the backend app is not publicly reachable and accepts requests only "
|
||
"from the trusted proxy"
|
||
msgstr ""
|
||
"Переконайтеся, що backend-застосунок не доступний публічно та приймає "
|
||
"запити лише від довіреного proxy"
|
||
|
||
#: ../../dispatcher/webhook.rst:75
|
||
msgid "Examples"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:78
|
||
msgid "Behind reverse proxy"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:80
|
||
msgid ""
|
||
"In this example we'll use aiohttp as web framework and nginx as reverse "
|
||
"proxy."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:84
|
||
msgid ""
|
||
"When you use nginx as reverse proxy, you should set `proxy_pass` to your "
|
||
"aiohttp server address."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:98
|
||
msgid "Without reverse proxy (not recommended)"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:100
|
||
msgid "In case without using reverse proxy, you can use aiohttp's ssl context."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:102
|
||
msgid "Also this example contains usage with self-signed certificate."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:108
|
||
msgid "With using other web framework"
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:110
|
||
msgid ""
|
||
"You can pass incoming request to aiogram's webhook controller from any "
|
||
"web framework you want."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:112
|
||
msgid ""
|
||
"Read more about it in "
|
||
":meth:`aiogram.dispatcher.dispatcher.Dispatcher.feed_webhook_update` or "
|
||
":meth:`aiogram.dispatcher.dispatcher.Dispatcher.feed_update` methods."
|
||
msgstr ""
|
||
|
||
#: ../../dispatcher/webhook.rst:123
|
||
msgid ""
|
||
"If you want to use reply into webhook, you should check that result of "
|
||
"the :code:`feed_update` methods is an instance of API method and build "
|
||
":code:`multipart/form-data` or :code:`application/json` response body "
|
||
"manually."
|
||
msgstr ""
|
||
|
||
#~ msgid ""
|
||
#~ "In case you want can't use reverse"
|
||
#~ " proxy, you can use aiohttp's ssl "
|
||
#~ "context."
|
||
#~ msgstr ""
|