mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5285] [Question]: When will automatic traffic reset for users be added? #3699
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3699
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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 ofaddTrafficLocked. The query at line 276 selects clients wherereset > 0 AND expiry_time > 0 AND expiry_time <= now, then loops the expiry forward byreset × 86 400 000 msuntil 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 ininternal/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.
@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?
@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.