Files
flvx/plans/033-user-traffic-quota.md
sagitchu ad9b336fb9 refactor(quota): migrate traffic quota from tunnel to user level
- Replace tunnel_quota table with user_quota table
- Add user-level daily/monthly quota tracking and enforcement
- Update user CRUD to include quota configuration
- Migrate backup/restore to use user quota fields
- Update frontend API and UI for user quota management
2026-03-12 14:17:57 +08:00

1014 B

User Traffic Quota (Fix PR #308 Semantics)

  • Confirm new quota semantics: daily/monthly quota applies per user (aggregated across all tunnels), not per tunnel; overage pauses only that user's active forwards and blocks create/resume.
  • Backend schema: replace tunnel_quota usage with new user_quota persistence model + view types.
  • Repository: implement user quota read/write/increment/reset + daily/monthly window rollover.
  • Handler: wire quota accumulation into flow uploads, enforce overage (pause forwards + mark quota-disabled), and add admin reset API.
  • Jobs: run daily quota window rollover + release logic in existing 00:05 maintenance job.
  • Backup/import: persist quota config + quota-disable metadata on user backup payloads (not rolling usage).
  • Tests: update contract + handler job tests to validate quota blocking + reset window rollover.
  • Frontend: move quota inputs/usage/reset UI from tunnel management to user management; update API/types accordingly.