[GH-ISSUE #5119] [Feature]: Inbound Traffic Reset date customizable #3598

Open
opened 2026-10-31 20:33:37 +07:00 by bsakaguchi · 1 comment
Owner

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

Image

My VPS has not reset the traffic limitation on a calendar month, but on the date that I ordered. However, 3x-ui v3.2.8 can ONLY set a regular timing Traffic Reset.

Describe the solution you'd like

I'd like to have a customizable Traffic Reset schedule. Here I'm using cron job schedule 0 0 9 * * as an example.

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @MaurUppi on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5119 ### Is your feature request related to a problem? <img width="802" height="305" alt="Image" src="https://github.com/user-attachments/assets/fe1ca659-799f-46e3-a180-aaae8f574784" /> My VPS has not reset the traffic limitation on a calendar month, but on the date that I ordered. However, 3x-ui v3.2.8 can ONLY set a regular timing Traffic Reset. ### Describe the solution you'd like I'd like to have a customizable Traffic Reset schedule. Here I'm using cron job schedule `0 0 9 * *` as an example. ### Alternatives you've considered _No response_ ### Concrete use case _No response_ ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? _No response_ ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
Author
Owner

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

Thanks for the clear request, @MaurUppi!

Current behavior (confirmed in source)

The inbound trafficReset field (database/model/model.go line 55) is validated as:
oneof=never hourly daily weekly monthly

The scheduler registers four fixed-interval jobs at startup (web/web.go lines 304-312):

  • hourly: every hour
  • daily: midnight every day
  • weekly: midnight Sat/Sun
  • monthly: midnight on the 1st of each month

There is no option to pick a custom day of the month (e.g. the 9th to match a VPS billing cycle).

What a proper implementation would require

  1. Model / validation: extend TrafficReset beyond the current enum in database/model/model.go, e.g. add a day_of_month mode or store a cron expression.
  2. Scheduler: in web/web.go / web/job/periodic_traffic_reset_job.go, dynamically register a matching cron entry for inbounds using a custom schedule.
  3. Frontend: add a day-of-month or cron picker to the inbound settings UI in frontend/.

Workaround until this is implemented

The panel exposes REST endpoints (documented at /docs via Swagger) that you can call from a host cron job:

  • Reset all inbounds: POST /panel/inbound/resetAllTraffics
  • Reset clients for one inbound: POST /panel/inbound/resetClientTraffics/{id}

Add an entry to crontab on your server to fire on the 9th of each month at midnight:

0 0 9 * *  curl -s -X POST -b 'session=YOUR_SESSION_COOKIE' 'https://YOUR_PANEL/panel/inbound/resetAllTraffics'

This is a valid enhancement - leaving open for maintainer review.

<!-- gh-comment-id:4657836134 --> @github-actions[bot] commented on GitHub (Jun 9, 2026): Thanks for the clear request, @MaurUppi\! **Current behavior (confirmed in source)** The inbound trafficReset field (database/model/model.go line 55) is validated as: oneof=never hourly daily weekly monthly The scheduler registers four fixed-interval jobs at startup (web/web.go lines 304-312): - hourly: every hour - daily: midnight every day - weekly: midnight Sat/Sun - monthly: midnight on the 1st of each month There is no option to pick a custom day of the month (e.g. the 9th to match a VPS billing cycle). **What a proper implementation would require** 1. Model / validation: extend TrafficReset beyond the current enum in database/model/model.go, e.g. add a day_of_month mode or store a cron expression. 2. Scheduler: in web/web.go / web/job/periodic_traffic_reset_job.go, dynamically register a matching cron entry for inbounds using a custom schedule. 3. Frontend: add a day-of-month or cron picker to the inbound settings UI in frontend/. **Workaround until this is implemented** The panel exposes REST endpoints (documented at /docs via Swagger) that you can call from a host cron job: - Reset all inbounds: POST /panel/inbound/resetAllTraffics - Reset clients for one inbound: POST /panel/inbound/resetClientTraffics/{id} Add an entry to crontab on your server to fire on the 9th of each month at midnight: 0 0 9 * * curl -s -X POST -b 'session=YOUR_SESSION_COOKIE' 'https://YOUR_PANEL/panel/inbound/resetAllTraffics' This is a valid enhancement - leaving open for maintainer review.
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#3598
No description provided.