3x-ui/internal/database
MHSanaei 43500a5470
feat(mtproto): per-client ad-tags, management-API auth, and record secret sync
Catch the panel up to the mtg-multi README (v1.14.0):

- Each client can now carry its own 32-hex advertising tag overriding the
  inbound-level one. The tag lives on the client (settings JSON is the
  source of truth, clients.ad_tag is the UI projection), is rendered into
  the fork's [secret-ad-tags] section for active secrets only (mtg rejects
  a config whose override names an unknown secret), is pushed per entry
  through PUT /secrets, and is part of the reload fingerprint so a tag
  edit hot-applies without dropping connections.
- The loopback management API can replace the whole secret set, so every
  mtg process now gets a random per-process api-token; the manager sends
  it as a bearer token on PUT /secrets and GET /stats and reuses it across
  config rewrites, because mtg reads the token only at startup.
- Malformed tags are rejected at every save path and additionally dropped
  in InstanceFromInbound: one bad tag would otherwise fail the whole
  generated config and take every client of the inbound down with it.
- SyncInbound never copied a re-keyed mtproto secret into the canonical
  clients table, so the clients page and subscription links kept serving
  the old secret, which mtg then rejects. It is now guarded-copied like
  the other credentials.
2026-07-07 12:00:43 +02:00
..
model feat(mtproto): per-client ad-tags, management-API auth, and record secret sync 2026-07-07 12:00:43 +02:00
api_token_timestamp_test.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
db.go fix(mtproto): stop persisting a vestigial inbound-level secret 2026-07-06 17:55:57 +02:00
db_seed_test.go fix(settings): repair legacy path settings that block every settings save 2026-07-02 13:42:03 +02:00
db_settled_test.go fix(database): stop noisy per-startup errors in the Postgres server log 2026-07-01 23:07:05 +02:00
dialect.go fix(db): clamp traffic counters below int64 max and repair overflowed rows 2026-07-05 20:33:09 +02:00
dump_sqlite.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
dump_sqlite_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
host_migration_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
host_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
inbound_dedupe_test.go fix(client): stop duplicate client entries accumulating in inbound settings 2026-07-05 21:17:25 +02:00
index_tags_test.go fix: resolve a batch of open bug-tagged issues (traffic accounting, share strategy, sub address, CPU) (#5477) 2026-06-22 00:22:28 +02:00
migrate_data.go fix(database): stop noisy per-startup errors in the Postgres server log 2026-07-01 23:07:05 +02:00
migrate_data_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
mtproto_migration_test.go fix(mtproto): stop persisting a vestigial inbound-level secret 2026-07-06 17:55:57 +02:00
settings_index_test.go perf(db): add an index on settings.key (#5359) 2026-06-20 15:08:54 +03:30
traffic_overflow_repair_test.go fix(db): clamp traffic counters below int64 max and repair overflowed rows 2026-07-05 20:33:09 +02:00
wireguard_migration_test.go feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00