mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
## What changed Adds `chat_integration_telegram_api_base_url` setting for the Telegram chat integration (discourse-chat-integration plugin) The setting defaults to `https://api.telegram.org`, so existing installations keep their current behavior. ## Why Some Discourse installations cannot reach `api.telegram.org` directly because Telegram is blocked or restricted by local network providers. This setting allows administrators to route Telegram Bot API requests through a trusted reverse proxy, such as a Cloudflare Worker, without patching the plugin. ## Cloudflare Worker example The following Worker can be deployed as a small Telegram Bot API proxy: ```js export default { async fetch(request) { const url = new URL(request.url); if ( !url.pathname.startsWith("/bot") && !url.pathname.startsWith("/file/bot") ) { return new Response("Not found", { status: 404 }); } url.hostname = "api.telegram.org"; url.protocol = "https:"; url.port = ""; return fetch(new Request(url, request)); }, }; ``` The proxy must be trusted because Telegram bot tokens are included in Bot API request paths. --------- Co-authored-by: Régis Hanol <regis@hanol.fr> |
||
|---|---|---|
| .. | ||
| admin/assets/javascripts/discourse | ||
| app | ||
| assets | ||
| config | ||
| db/migrate | ||
| lib/discourse_chat_integration | ||
| spec | ||
| test/javascripts/acceptance | ||
| package.json | ||
| plugin.rb | ||
| README.md | ||
| tsconfig.json | ||
Chat Integration Plugin
Integrate your chat system of choice with Discourse.
For more information, please see: https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522