mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-21 02:21:01 +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:
@@ -532,9 +532,9 @@ func (s *InboundService) normalizeStreamSettings(inbound *model.Inbound) {
|
||||
|
||||
// normalizeMtprotoSecret rebuilds every mtproto client's FakeTLS secret so it is
|
||||
// always valid before the row is persisted, and drops the vestigial inbound-level
|
||||
// secret: MTProto is multi-client, so mtg and every share link read only the
|
||||
// per-client secrets. Leaving an inbound-level secret behind is what produced
|
||||
// stale links that failed with "incorrect client random".
|
||||
// secret and adTag: MTProto is multi-client, so mtg and every share link read
|
||||
// only the per-client values. Leaving an inbound-level secret behind is what
|
||||
// produced stale links that failed with "incorrect client random".
|
||||
func (s *InboundService) normalizeMtprotoSecret(inbound *model.Inbound) {
|
||||
if inbound.Protocol != model.MTProto {
|
||||
return
|
||||
@@ -542,6 +542,9 @@ func (s *InboundService) normalizeMtprotoSecret(inbound *model.Inbound) {
|
||||
if stripped, ok := model.StripMtprotoInboundSecret(inbound.Settings); ok {
|
||||
inbound.Settings = stripped
|
||||
}
|
||||
if stripped, ok := model.StripMtprotoInboundAdTag(inbound.Settings); ok {
|
||||
inbound.Settings = stripped
|
||||
}
|
||||
if healed, ok := model.HealMtprotoClientSecrets(inbound.Settings); ok {
|
||||
inbound.Settings = healed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user