mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +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>
174 lines
5.1 KiB
YAML
Vendored
174 lines
5.1 KiB
YAML
Vendored
chat_integration:
|
|
chat_integration_enabled:
|
|
default: false
|
|
chat_integration_discourse_username:
|
|
default: system
|
|
type: username
|
|
chat_integration_delay_seconds:
|
|
default: 20
|
|
|
|
#######################################
|
|
########## SLACK SETTINGS #############
|
|
#######################################
|
|
chat_integration_slack_username:
|
|
default: ''
|
|
chat_integration_slack_enabled:
|
|
default: false
|
|
validator: "ChatIntegrationSlackEnabledSettingValidator"
|
|
chat_integration_slack_access_token:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_slack_incoming_webhook_token:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_slack_excerpt_length:
|
|
default: 400
|
|
chat_integration_slack_outbound_webhook_url:
|
|
default: ''
|
|
secret: true
|
|
regex: '^https:\/\/hooks\.slack\.com\/(services|workflows)\/.+$'
|
|
chat_integration_slack_icon_url:
|
|
default: ''
|
|
chat_integration_slack_transcript_quote:
|
|
default: true
|
|
|
|
#######################################
|
|
######### TELEGRAM SETTINGS ###########
|
|
#######################################
|
|
chat_integration_telegram_enabled:
|
|
default: false
|
|
chat_integration_telegram_access_token:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_telegram_api_base_url:
|
|
default: 'https://api.telegram.org'
|
|
validator: "ChatIntegrationTelegramApiBaseUrlSettingValidator"
|
|
chat_integration_telegram_excerpt_length:
|
|
default: 400
|
|
chat_integration_telegram_enable_slash_commands:
|
|
default: true
|
|
chat_integration_telegram_secret:
|
|
default: ''
|
|
hidden: true
|
|
|
|
#######################################
|
|
########## DISCORD SETTINGS ###########
|
|
#######################################
|
|
chat_integration_discord_enabled:
|
|
default: false
|
|
chat_integration_discord_message_content:
|
|
default: ""
|
|
chat_integration_discord_excerpt_length:
|
|
default: 400
|
|
|
|
#######################################
|
|
########## GUILDED SETTINGS ###########
|
|
#######################################
|
|
chat_integration_guilded_enabled:
|
|
default: false
|
|
chat_integration_guilded_excerpt_length:
|
|
default: 400
|
|
|
|
|
|
#######################################
|
|
######## MATTERMOST SETTINGS ##########
|
|
#######################################
|
|
chat_integration_mattermost_enabled:
|
|
default: false
|
|
chat_integration_mattermost_webhook_url:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_mattermost_incoming_webhook_token:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_mattermost_icon_url:
|
|
default: ''
|
|
chat_integration_mattermost_excerpt_length:
|
|
default: 400
|
|
|
|
#######################################
|
|
########## MATRIX SETTINGS ############
|
|
#######################################
|
|
chat_integration_matrix_enabled:
|
|
default: false
|
|
chat_integration_matrix_homeserver:
|
|
default: 'https://matrix.org'
|
|
chat_integration_matrix_access_token:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_matrix_excerpt_length:
|
|
default: 400
|
|
chat_integration_matrix_use_notice:
|
|
default: true
|
|
|
|
#######################################
|
|
########### ZULIP SETTINGS ############
|
|
#######################################
|
|
chat_integration_zulip_enabled:
|
|
default: false
|
|
chat_integration_zulip_server:
|
|
default: ''
|
|
chat_integration_zulip_bot_email_address:
|
|
default: ''
|
|
chat_integration_zulip_bot_api_key:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_zulip_excerpt_length:
|
|
default: 400
|
|
|
|
#######################################
|
|
######## ROCKET CHAT SETTINGS #########
|
|
#######################################
|
|
chat_integration_rocketchat_enabled:
|
|
default: false
|
|
chat_integration_rocketchat_webhook_url:
|
|
default: ''
|
|
secret: true
|
|
chat_integration_rocketchat_excerpt_length:
|
|
default: 400
|
|
|
|
#######################################
|
|
########## GITTER SETTINGS ############
|
|
#######################################
|
|
chat_integration_gitter_enabled:
|
|
default: false
|
|
|
|
#######################################
|
|
########## GROUPME SETTINGS ##########
|
|
#######################################
|
|
chat_integration_groupme_enabled:
|
|
default: false
|
|
chat_integration_groupme_excerpt_length:
|
|
default: 400
|
|
chat_integration_groupme_bot_ids:
|
|
default: ''
|
|
chat_integration_groupme_instance_names:
|
|
default: ''
|
|
###########################################
|
|
######## MICROSOFT TEAMS SETTINGS #########
|
|
###########################################
|
|
chat_integration_teams_enabled:
|
|
default: false
|
|
chat_integration_teams_excerpt_length:
|
|
default: 400
|
|
####################################################
|
|
######## MICROSOFT POWER AUTOMATE SETTINGS #########
|
|
####################################################
|
|
chat_integration_powerautomate_enabled:
|
|
default: false
|
|
chat_integration_powerautomate_excerpt_length:
|
|
default: 400
|
|
#################################
|
|
######## WEBEX SETTINGS #########
|
|
#################################
|
|
chat_integration_webex_enabled:
|
|
default: false
|
|
chat_integration_webex_excerpt_length:
|
|
default: 400
|
|
###########################################
|
|
########## GOOGLE CHAT SETTINGS ###########
|
|
###########################################
|
|
chat_integration_google_enabled:
|
|
default: false
|
|
chat_integration_google_excerpt_length:
|
|
default: 100
|