From ad7a0f8164fe15fe1388a23447e6990cf8d6dc55 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 7 Jul 2026 12:19:26 +0200 Subject: [PATCH] refactor(mtproto): manage ad-tags per client only The inbound-level ad-tag duplicated the per-client override for no gain: the fork's global tag applied to every secret anyway, so one value had two homes and they could drift. The inbound form field, the settings key, and the global ad-tag in the generated config and in the PUT /secrets body are gone; the tag is set on each client instead. Existing inbound-level values are intentionally not migrated; a leftover settings key is stripped on the next save. --- .../pages/inbounds/form/protocols/mtproto.tsx | 10 -------- .../src/schemas/protocols/inbound/mtproto.ts | 11 ++------ internal/database/model/model.go | 20 +++++++++++++++ internal/database/model/model_mtproto_test.go | 22 ++++++++++++++++ internal/mtproto/manager.go | 24 ++++++------------ internal/mtproto/manager_reload_test.go | 7 +++--- internal/mtproto/manager_test.go | 25 ++++++++----------- internal/web/service/inbound.go | 9 ++++--- internal/web/translation/ar-EG.json | 4 +-- internal/web/translation/en-US.json | 4 +-- internal/web/translation/es-ES.json | 4 +-- internal/web/translation/fa-IR.json | 4 +-- internal/web/translation/id-ID.json | 4 +-- internal/web/translation/ja-JP.json | 4 +-- internal/web/translation/pt-BR.json | 4 +-- internal/web/translation/ru-RU.json | 4 +-- internal/web/translation/tr-TR.json | 4 +-- internal/web/translation/uk-UA.json | 4 +-- internal/web/translation/vi-VN.json | 4 +-- internal/web/translation/zh-CN.json | 4 +-- internal/web/translation/zh-TW.json | 4 +-- 21 files changed, 83 insertions(+), 97 deletions(-) diff --git a/frontend/src/pages/inbounds/form/protocols/mtproto.tsx b/frontend/src/pages/inbounds/form/protocols/mtproto.tsx index 68a78c35e..72ce53031 100644 --- a/frontend/src/pages/inbounds/form/protocols/mtproto.tsx +++ b/frontend/src/pages/inbounds/form/protocols/mtproto.tsx @@ -2,8 +2,6 @@ import { useTranslation } from 'react-i18next'; import { Form, Input, InputNumber, Select, Switch } from 'antd'; import { useOutboundTags } from '@/api/queries/useOutboundTags'; -import { MtprotoInboundSettingsSchema } from '@/schemas/protocols/inbound/mtproto'; -import { antdRule } from '@/utils/zodForm'; export default function MtprotoFields() { const { t } = useTranslation(); @@ -87,14 +85,6 @@ export default function MtprotoFields() { /> )} - - -