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:
MHSanaei
2026-07-07 12:19:26 +02:00
parent 406ce54fb2
commit ad7a0f8164
21 changed files with 83 additions and 97 deletions
@@ -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(),
});