Commit Graph

10 Commits

Author SHA1 Message Date
shanshanzhong147 19d28a8f89 修复(#1): 服务器用户列表缓存按 protocol 隔离 + 兜底不写缓存
服务器用户列表缓存跨协议污染修复(HIF-1 / 详见 PR #5 四件套):

1. 缓存 key 加 protocol 维度(`server:user:{server_id}:{protocol}`),对齐 ServerConfig 已有约定
2. 显式枚举协议清除用户列表缓存(AllProtocols + ServerUserListCacheKeysForServer),不用 SCAN
3. 三个兜底分支不写缓存 + Errorw 日志(带 server_id + protocol 字段)
4. hysteria2 → hysteria 兼容归一化 + 6 个新单测

Closes HIF-1
2026-06-03 05:37:03 -07:00
shanshanzhong147 bcefb274ab perf(server): cache speed limit calculations
Build docker and publish / build (20.15.1) (push) Successful in 5m37s
2026-04-29 01:37:59 -07:00
shanshanzhong147 1a08949c80 fix: 流量触发限速后主动清除节点用户缓存
节点用户列表缓存(server:user:{id})永不过期,用户流量超限触发按量限速后
缓存中仍是旧的速度值,节点不会感知限速状态。

修复:每次写入 traffic_log 后,检查该订阅是否触发按量限速规则,
若 IsThrottled=true 则立即删除对应节点的用户列表缓存,
节点下次拉取时重新计算并应用降速后的 speed_limit。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-28 18:36:13 -07:00
EUForest 06a2425474 feat(subscribe): add traffic limit rules and user traffic stats
- Add subscribe traffic_limit schema and migration\n- Support traffic_limit in admin create/update and list/details\n- Apply traffic_limit when building server user list speed limits\n- Add public user traffic stats API
2026-03-14 12:41:52 +08:00
EUForest 80ee9a6acf Merge upstream/master into develop
Sync upstream changes from perfect-panel/server

  Includes updates from v1.0.1 to v1.2.5:
  - Currency configuration support
  - Subscribe improvements (short token, inventory check, etc.)
  - Node management enhancements
  - Database migrations
  - Bug fixes and optimizations
2026-01-02 12:51:55 +08:00
Chang lue Tsen d74d636735 feat(traffic): add protocol handling and update traffic statistics calculation 2025-09-28 11:31:21 -04:00
Chang lue Tsen c1c324878b fix(traffic): skip logs with zero upload and download values 2025-09-27 10:16:28 -04:00
Chang lue Tsen c7884d94aa feat(api): migrate server and node data handling, update related structures and logic 2025-08-26 07:05:59 -04:00
Chang lue Tsen 34c09c4618 refactor: update import paths from ppanel-server to server 2025-04-25 15:09:31 +09:00
Chang lue Tsen 8addcc584b init: 1.0.0 2025-04-25 12:08:29 +09:00