[GH-ISSUE #5285] [Question]: When will automatic traffic reset for users be added? #3699

Closed
opened 2026-10-31 20:34:19 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @cflowstudio on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5285

What are you trying to do?

Hello, dear developers of the 3x-ui panel! I have a question about resetting traffic for users. When will you add the ability for a specific user to automatically reset their traffic? It's a bit annoying to log in to the panel just to reset some users' traffic. 😇

What have you already tried?

No response

3x-ui version

3.3.1

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @cflowstudio on GitHub (Jun 13, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5285 ### What are you trying to do? Hello, dear developers of the 3x-ui panel! I have a question about resetting traffic for users. When will you add the ability for a specific user to automatically reset their traffic? It's a bit annoying to log in to the panel just to reset some users' traffic. 😇 ### What have you already tried? _No response_ ### 3x-ui version 3.3.1 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-10-31 20:34:19 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 13, 2026):

The automatic per-client traffic reset feature is already present in 3.3.1.

When you open the client edit form in the Clients page, there is a field labeled Auto Renew (days) (tooltip: "Auto-renewal after expiration. (0 = disable)(unit: day)"). Setting it to a non-zero integer N causes the panel to automatically advance that client's expiry time by N days and zero out their upload/download counters each time the expiry is reached. The implementation lives in internal/web/service/inbound_traffic.go (autoRenewClients, line 269), which runs on every traffic-accounting cycle as part of addTrafficLocked. The query at line 276 selects clients where reset > 0 AND expiry_time > 0 AND expiry_time <= now, then loops the expiry forward by reset × 86 400 000 ms until it is in the future and clears the traffic totals.

There is also a separate per-inbound scheduled reset — configured on each inbound as never / hourly / daily / weekly / monthly — which resets all clients of that inbound on the chosen schedule (internal/web/job/periodic_traffic_reset_job.go, registered in internal/web/web.go:303–309). This is a different mechanism from the per-client renew described above.

If you want to reset a specific client's traffic without logging into the web panel, the Telegram bot (when configured) provides that capability directly from the bot interface (internal/web/service/tgbot/tgbot_router.go, lines 364 and 1446).

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4698957536 --> @github-actions[bot] commented on GitHub (Jun 13, 2026): The automatic per-client traffic reset feature is already present in 3.3.1. When you open the client edit form in the Clients page, there is a field labeled **Auto Renew (days)** (tooltip: *"Auto-renewal after expiration. (0 = disable)(unit: day)"*). Setting it to a non-zero integer N causes the panel to automatically advance that client's expiry time by N days and zero out their upload/download counters each time the expiry is reached. The implementation lives in `internal/web/service/inbound_traffic.go` (`autoRenewClients`, line 269), which runs on every traffic-accounting cycle as part of `addTrafficLocked`. The query at line 276 selects clients where `reset > 0 AND expiry_time > 0 AND expiry_time <= now`, then loops the expiry forward by `reset × 86 400 000 ms` until it is in the future and clears the traffic totals. There is also a separate **per-inbound** scheduled reset — configured on each inbound as *never / hourly / daily / weekly / monthly* — which resets all clients of that inbound on the chosen schedule (`internal/web/job/periodic_traffic_reset_job.go`, registered in `internal/web/web.go:303–309`). This is a different mechanism from the per-client renew described above. If you want to reset a specific client's traffic without logging into the web panel, the Telegram bot (when configured) provides that capability directly from the bot interface (`internal/web/service/tgbot/tgbot_router.go`, lines 364 and 1446). *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@cflowstudio commented on GitHub (Jun 13, 2026):

Recently, a new MTProto protocol was introduced, and it is possible to create new clients for connecting and tracking the usage of traffic and all the features available to regular clients?

<!-- gh-comment-id:4698998153 --> @cflowstudio commented on GitHub (Jun 13, 2026): Recently, a new MTProto protocol was introduced, and it is possible to create new clients for connecting and tracking the usage of traffic and all the features available to regular clients?
Author
Owner

@cflowstudio commented on GitHub (Jun 13, 2026):

I noticed that I can't modify the JSON file in the panel for MTProto. I wanted to add a couple of changes, but after saving, I went to check the config and it didn't have the lines I added.

<!-- gh-comment-id:4699076095 --> @cflowstudio commented on GitHub (Jun 13, 2026): I noticed that I can't modify the JSON file in the panel for MTProto. I wanted to add a couple of changes, but after saving, I went to check the config and it didn't have the lines I added.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3699
No description provided.