mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-15 09:06:07 +00:00
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.
This commit is contained in:
@@ -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() {
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
name={['settings', 'adTag']}
|
||||
label={t('pages.inbounds.form.mtgAdTag')}
|
||||
tooltip={t('pages.inbounds.form.mtgAdTagHint')}
|
||||
rules={[antdRule(MtprotoInboundSettingsSchema.shape.adTag, t)]}
|
||||
>
|
||||
<Input allowClear placeholder="0123456789abcdef0123456789abcdef" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={['settings', 'publicIpv4']}
|
||||
label={t('pages.inbounds.form.mtgPublicIpv4')}
|
||||
|
||||
@@ -57,15 +57,8 @@ export const MtprotoInboundSettingsSchema = z.object({
|
||||
routeThroughXray: z.boolean().optional(),
|
||||
outboundTag: z.string().optional(),
|
||||
routeXrayPort: z.number().int().min(0).max(65535).optional(),
|
||||
// A 32-hex Telegram advertising tag: when set, mtg routes clients through
|
||||
// Telegram middle proxies so a sponsored channel appears in their chat list.
|
||||
// publicIpv4/publicIpv6 pin this server's reachable address the middle proxy
|
||||
// needs; leave them blank to let mtg auto-detect it.
|
||||
adTag: z
|
||||
.string()
|
||||
.regex(/^[0-9a-fA-F]{32}$/, 'pages.inbounds.form.mtgAdTagInvalid')
|
||||
.or(z.literal(''))
|
||||
.optional(),
|
||||
// publicIpv4/publicIpv6 pin this server's reachable address the Telegram
|
||||
// middle proxy needs when clients carry ad-tags; blank = mtg auto-detects.
|
||||
publicIpv4: z.string().optional(),
|
||||
publicIpv6: z.string().optional(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user