[PR #5615] [CLOSED] Add Telegram proxy configuration UI and validate bot backup chat IDs #5931

Closed
opened 2026-11-02 04:05:07 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5615
Author: @Amirwopi
Created: 6/27/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (2)

  • 5fb6444 Add Telegram proxy configuration UI and validate bot backup chat IDs
  • 5510ecd fix: keep Telegram proxy mode editable and preserve tgBotProxy

📊 Changes

19 files changed (+249 additions, -44 deletions)

View changed files

📝 frontend/src/models/setting.ts (+1 -0)
📝 frontend/src/pages/settings/TelegramTab.tsx (+157 -1)
➕ frontend/src/test/telegram-proxy.test.tsx (+23 -0)
📝 internal/database/db.go (+3 -3)
📝 internal/web/service/tgbot/tgbot.go (+20 -12)
📝 internal/web/service/tgbot/tgbot_test.go (+17 -0)
📝 internal/web/translation/ar-EG.json (+2 -2)
📝 internal/web/translation/en-US.json (+3 -3)
📝 internal/web/translation/es-ES.json (+2 -2)
📝 internal/web/translation/fa-IR.json (+3 -3)
📝 internal/web/translation/id-ID.json (+2 -2)
📝 internal/web/translation/ja-JP.json (+2 -2)
📝 internal/web/translation/pt-BR.json (+2 -2)
📝 internal/web/translation/ru-RU.json (+2 -2)
📝 internal/web/translation/tr-TR.json (+2 -2)
📝 internal/web/translation/uk-UA.json (+2 -2)
📝 internal/web/translation/vi-VN.json (+2 -2)
📝 internal/web/translation/zh-CN.json (+2 -2)
📝 internal/web/translation/zh-TW.json (+2 -2)

📄 Description

Summary

This PR adds Telegram proxy configuration to the panel UI so the bot can run through SOCKS5, HTTP, or HTTPS proxies. It also
hardens Telegram admin chat ID parsing for backup delivery and clarifies backup behavior for both SQLite and PostgreSQL panels.

Changes

  • add tgBotProxy to the frontend settings model
  • add Telegram proxy fields in the settings UI
  • support structured proxy input for SOCKS5, HTTP, and HTTPS
  • keep a custom proxy URL fallback for existing/manual configurations
  • trim and validate configured Telegram admin chat IDs before bot startup
  • add tests for admin chat ID parsing
  • update Persian and English settings text for proxy and backup behavior

Behavior

  • the panel now lets admins configure Telegram bot proxy settings directly from the UI
  • backup delivery still detects the active database backend first
  • SQLite backups are sent as .db
  • PostgreSQL backups are sent as .dump
  • backups are sent only to valid numeric Telegram chat IDs

Validation

  • go test ./internal/web/service/tgbot
  • npm ci
  • npm run typecheck

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5615 **Author:** [@Amirwopi](https://github.com/Amirwopi) **Created:** 6/27/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`5fb6444`](https://github.com/MHSanaei/3x-ui/commit/5fb644479bd1b5c09469c6ab1280af90678d8a04) Add Telegram proxy configuration UI and validate bot backup chat IDs - [`5510ecd`](https://github.com/MHSanaei/3x-ui/commit/5510ecd3eced4826ee001c670dcd8d32d547c249) fix: keep Telegram proxy mode editable and preserve tgBotProxy ### 📊 Changes **19 files changed** (+249 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/models/setting.ts` (+1 -0) 📝 `frontend/src/pages/settings/TelegramTab.tsx` (+157 -1) ➕ `frontend/src/test/telegram-proxy.test.tsx` (+23 -0) 📝 `internal/database/db.go` (+3 -3) 📝 `internal/web/service/tgbot/tgbot.go` (+20 -12) 📝 `internal/web/service/tgbot/tgbot_test.go` (+17 -0) 📝 `internal/web/translation/ar-EG.json` (+2 -2) 📝 `internal/web/translation/en-US.json` (+3 -3) 📝 `internal/web/translation/es-ES.json` (+2 -2) 📝 `internal/web/translation/fa-IR.json` (+3 -3) 📝 `internal/web/translation/id-ID.json` (+2 -2) 📝 `internal/web/translation/ja-JP.json` (+2 -2) 📝 `internal/web/translation/pt-BR.json` (+2 -2) 📝 `internal/web/translation/ru-RU.json` (+2 -2) 📝 `internal/web/translation/tr-TR.json` (+2 -2) 📝 `internal/web/translation/uk-UA.json` (+2 -2) 📝 `internal/web/translation/vi-VN.json` (+2 -2) 📝 `internal/web/translation/zh-CN.json` (+2 -2) 📝 `internal/web/translation/zh-TW.json` (+2 -2) </details> ### 📄 Description ## Summary This PR adds Telegram proxy configuration to the panel UI so the bot can run through `SOCKS5`, `HTTP`, or `HTTPS` proxies. It also hardens Telegram admin chat ID parsing for backup delivery and clarifies backup behavior for both SQLite and PostgreSQL panels. ## Changes - add `tgBotProxy` to the frontend settings model - add Telegram proxy fields in the settings UI - support structured proxy input for `SOCKS5`, `HTTP`, and `HTTPS` - keep a custom proxy URL fallback for existing/manual configurations - trim and validate configured Telegram admin chat IDs before bot startup - add tests for admin chat ID parsing - update Persian and English settings text for proxy and backup behavior ## Behavior - the panel now lets admins configure Telegram bot proxy settings directly from the UI - backup delivery still detects the active database backend first - SQLite backups are sent as `.db` - PostgreSQL backups are sent as `.dump` - backups are sent only to valid numeric Telegram chat IDs ## Validation - `go test ./internal/web/service/tgbot` - `npm ci` - `npm run typecheck` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:07 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5931
No description provided.