clients.mdx 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ---
  2. title: Clients
  3. description: Manage 3x-ui clients — credentials, traffic and expiry limits, IP limits, groups, bulk actions, external links, and online status.
  4. icon: Users
  5. ---
  6. A **client** is a single user, identified by a unique **email**. In the current
  7. panel, clients are first-class records that can be attached to **multiple
  8. inbounds** at once, with per-client traffic accounting.
  9. ## Client fields
  10. | Field | Applies to | Meaning |
  11. | -------------- | --------------------- | ------------------------------------------------------------------ |
  12. | **Email** | all | Unique identifier used for accounting and lookups. |
  13. | **ID (UUID)** | VLESS, VMess, TUIC | The client credential. |
  14. | **Password** | Trojan, Shadowsocks, TUIC | The client credential. |
  15. | **Auth** | Hysteria2 | The client credential. |
  16. | **Flow** | VLESS | XTLS flow, e.g. `xtls-rprx-vision`. |
  17. | **Limit IP** | all (except TUIC) | Max simultaneous source IPs (enforced via Fail2ban). |
  18. | **Total (GB)** | all | Traffic quota; the client is disabled when exhausted. |
  19. | **Expiry** | all | Date after which the client stops working. |
  20. | **Auto renewal** | all | Disabled, fixed interval in days, calendar weekly, or calendar monthly. |
  21. | **Telegram ID**| all | Links the client to a Telegram user for self-service/notifications.|
  22. | **Sub ID** | all | Subscription identifier grouping this client's links. |
  23. | **Group** | all | Optional client group for organization and bulk filtering. |
  24. | **Comment** | all | Free-text note. |
  25. <Callout type="info">
  26. Reaching the **traffic** or **expiry** limit disables the client, and a client
  27. disabled or deleted by hand counts too; the panel restarts Xray then
  28. (`restartXrayOnClientDisable`, on by default).
  29. </Callout>
  30. ## Limits and IP control
  31. - **Traffic / expiry** caps disable the client when hit; a **Reset** period
  32. auto-renews the quota.
  33. - **Limit IP** caps simultaneous source IPs. Enforcement relies on Fail2ban —
  34. see [Security](/docs/operations/security). You can view a client's recent IPs
  35. and clear them from the client's actions.
  36. - **Online status** and **last-online** times are tracked per client (and per
  37. node in multi-node setups).
  38. ## Automatic renewal
  39. The individual and bulk-create forms offer one renewal mode at a time:
  40. | Mode | API fields | Schedule |
  41. | --- | --- | --- |
  42. | Disabled | `reset=0`, `resetDay=0`, `resetWeekday=0` | The expiry is not renewed. |
  43. | Fixed interval | `reset=N`, other two fields `0` | Add exactly N × 24 hours to the previous cutoff. |
  44. | Calendar weekly | `resetWeekday=1..7`, other two fields `0` | Renew at panel-local midnight on Monday (1) through Sunday (7). |
  45. | Calendar monthly | `resetDay=1..31`, `resetWeekday=0` | Renew at panel-local midnight on that day; missing dates clamp to the month's last day without losing the configured day. |
  46. Calendar weeks stay on the selected weekday across daylight-saving changes;
  47. they are not equivalent to a fixed seven-day interval. A skipped midnight uses
  48. the first valid instant of that date; a repeated midnight uses the first one.
  49. If a timezone skips the entire selected date, the next matching week is used.
  50. Existing monthly clients
  51. that also have `reset` set retain monthly precedence. The API rejects weekly
  52. renewal combined with a positive `reset` or `resetDay`.
  53. For a full calendar month, select **monthly, day 1** and set the initial cutoff
  54. to the next month's first midnight. For example, `2030-09-01 00:00:00` is valid
  55. through `2030-08-31 23:59:59`. Day 31 renews at the **start** of the 31st and is
  56. not the same schedule. The existing optional month-end subscription-header
  57. display remains a separate setting and is not enabled by this form.
  58. The preview uses the panel's timezone and the same calendar/catch-up calculation
  59. as automatic renewal. It shows the cutoff, last valid second, next expiry, and
  60. allowances needed. It is informational: it does not save, activate, reserve, or
  61. guarantee a future renewal. When no expiry is set, auto-renewal cannot run; an
  62. explicit button can set the first calendar cutoff. Selecting a mode alone never
  63. rewrites an existing expiry. First-use clients keep their initial duration, and
  64. their calendar dates are available after activation.
  65. For legacy last-second calendar cutoffs, the renewal boundary includes the
  66. existing free alignment to the following midnight. The last-valid-second
  67. preview still uses the **stored expiry**, not that alignment: an exclusive
  68. `23:59:59` cutoff is valid through `23:59:58`. Use a next-midnight cutoff for
  69. full-day validity; the preview itself does not repair the initial expiry.
  70. `resetMax=0` means unlimited renewals. A positive limit counts **each elapsed
  71. period**, including offline catch-up, not each scheduler tick or attached inbound.
  72. If the remaining allowances cannot reach a future cutoff, the client stays
  73. expired and its traffic is not reset. Operator-disabled clients stay disabled.
  74. Renewal already resets client traffic. The separate **periodic traffic reset**
  75. does not move the expiry and is unchanged; keep it disabled unless you intend an
  76. additional reset. Quarterly, yearly, and every-N-week/month schedules are not
  77. part of these modes.
  78. <Callout type="warn">
  79. Upgrade the main panel and every participating node before enabling weekly
  80. renewal. Older versions ignore `resetWeekday`; a weekly-only client would not
  81. auto-renew and, after its expiry or quota is exhausted, can be deleted by
  82. **delete depleted clients** because older versions lack the weekly protection.
  83. Back up the database and convert weekly schedules to a renewal mode supported
  84. by every participating version before downgrading. Merely disabling weekly
  85. renewal does not protect a depleted client from deletion. Avoid depleted-client
  86. cleanup while a mixed-version fleet or unconverted weekly clients remain.
  87. Database upgrades default this new field to `0` and preserve existing limits
  88. and dates.
  89. </Callout>
  90. ## Share links and external links
  91. Every client has share links and a QR code for its inbounds, plus a combined
  92. [subscription](/docs/config/subscription). You can also attach **external
  93. links** to a client — extra `vless://`, `vmess://`, `trojan://`, `ss://`,
  94. `hysteria2://`, or `wireguard://` links, or a remote subscription URL — so they
  95. appear alongside the panel-generated ones in the client's subscription.
  96. To inspect exactly what a link contains, paste it into the
  97. [share-link inspector](/docs/config/share-links).
  98. ## Bulk actions
  99. For managing many clients at once, the panel supports bulk **create, enable,
  100. disable, delete, attach/detach** (to inbounds), **reset traffic**, and
  101. **adjust** (add days / add bytes / set flow). Maintenance actions also let you
  102. delete **depleted** clients (quota/expiry exhausted) and **orphaned** clients
  103. (not attached to any inbound).
  104. <Callout type="warn">
  105. A client's share link contains its credential. Treat links and QR codes like
  106. passwords, and rotate the credential if one leaks.
  107. </Callout>