0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/plugins/discourse-chat-integration/spec
Sergei Dmitriev 8def92409e
FEATURE: Allow custom Telegram API base URL (#41818)
## 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>
2026-07-22 17:27:40 +02:00
..
fabricators
helpers DEV: Fix random typos (#33839) 2025-07-24 22:04:13 +02:00
integration
jobs
lib/discourse_chat_integration FEATURE: Allow custom Telegram API base URL (#41818) 2026-07-22 17:27:40 +02:00
models
requests UX: Improve chat integration plugin provider setup (#38892) 2026-04-17 09:56:05 +10:00
services UX: Improve chat integration plugin provider setup (#38892) 2026-04-17 09:56:05 +10:00
support UX: Improve chat integration plugin provider setup (#38892) 2026-04-17 09:56:05 +10:00
system DEV: Improve stability of post-event and chat-integration channel specs (#39658) 2026-04-30 16:35:47 +02:00
dummy_provider.rb UX: Improve chat integration plugin provider setup (#38892) 2026-04-17 09:56:05 +10:00