Two problems with `panel.bandwidth_reset_day`, both around its interaction with the quota period: - The user panel hardcoded "至次月 N 号", which is wrong whenever the reset day is still ahead of today: the period in force started on that day of the PREVIOUS month, so it ends on that day of THIS one (reset day 22 on the 16th ends on the 22nd of this month). mgr.BandwidthNextReset derives the real moment, the page flags whether it lands in this calendar month, and the label follows. A test also pins it against BandwidthPeriod, so the label and the rollover can never disagree about the boundary. - Changing the day DISCARDS every user's accumulated bandwidth totals. That is not an explicit reset: the counters are keyed by a period derived from the day, so moving the day moves the key and the next sampler pass sees a new period. It stays that way (it is the period model), but it is no longer silent: the key is classified ApplyDestructive, so `vps config set` shows a confirmation naming the loss, repeats it on the --no-apply path (where the loss lands at the next panel restart instead), and prints it after applying. docs/configuration.md explains the mechanism and points at the admin panel's per-user "重置流量统计" button for a deliberate reset. TestApplyBandwidthPeriodChangeDiscardsTotals pins the discard so the warning cannot quietly become wrong, and TestBandwidthResetDayIsDestructive keeps the classification from regressing to a plain restart. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Documentation
Technical documentation for vpsmgr. All docs are in English.
| Doc | What it covers |
|---|---|
| architecture.md | System design: components, storage, network, security, traffic, users and user groups, image, install/uninstall lifecycle |
| configuration.md | Full reference for /etc/vpsmgr/config.yaml |
| ipv6.md | IPv6 pass-through design: deterministic addresses, prefix support, routing, installer flow |
| ipv6-ndp-responder.md | Why prefix mode replaced ndppd with an in-tree NDP responder, design hardening, and what to test at scale |
| development.md | Building, testing, releasing, conventions |
See also AGENTS.md at the repo root — short version aimed at AI coding agents.