312 Commits

Author SHA1 Message Date
df7303738a bug: 无订阅情况 出现下多笔订单 支付状态乱
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m18s
2026-03-30 00:32:41 -07:00
a9205cc3fc feat: 用户订阅显示节点分组名及限速起止时间
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m28s
- UserSubscribe/UserSubscribeDetail 新增 node_group_id/node_group_name 字段
- 管理员查询用户订阅列表批量填充分组名
- 管理员查询单个订阅详情填充分组名
- ThrottleResult/UserSubscribeDetail 新增 throttle_start/throttle_end 字段
- 限速时返回限速窗口起止时间(秒级 Unix 时间戳)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-29 10:07:17 -07:00
1dbc3a81e9 fix: 老版本客户端去掉每个套餐 discount 最后一个,而非整个套餐 2026-03-29 03:19:15 -07:00
3b4e882965 feat: 根据 X-App-Id 判断是否裁剪套餐列表,老版客户端去掉最后一个
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
2026-03-28 23:21:00 -07:00
26c9ff2f0f x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m31s
2026-03-28 22:57:19 -07:00
aaacb47dad x
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 7m51s
2026-03-28 22:44:22 -07:00
8398865bd3 fix: SingleModel 下首购 isNew 判断错误导致佣金不发
SingleModel 模式下,用户首次购买会被路由成 orderType=2(续费),
导致 isNew 判断逻辑跳过,始终为 false,激活时 shouldProcessCommission
误判为非首购,佣金不发给邀请人。

修复:去除 isNew 查询对 orderType==1 的依赖,始终通过
IsUserEligibleForNewOrder 判断用户是否有历史完成订单。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-28 11:28:02 -07:00
6f6943f295 api-header
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m23s
2026-03-28 10:05:32 -07:00
507ee16a30 x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m20s
2026-03-28 09:06:24 -07:00
2db2bc0860 feat: 限速状态可视化 - 后台订阅详情展示实际限速与降速状态
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m7s
- 新增 pkg/speedlimit/calculator.go 公共限速计算函数
- UserSubscribeDetail 响应新增 effective_speed/is_throttled/throttle_rule 字段
- GetUserSubscribeById 接口查询时实时计算并返回限速状态
- 重构 getServerUserListLogic 的 calculateEffectiveSpeedLimit,改用共享函数

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-28 08:14:07 -07:00
89e0c03fec fix: 统一限速单位为 Mbps,与 ppanel-node 节点端对齐
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m1s
ppanel-node limiter.go 将 speed_limit 视为 Mbps(× 1000000 / 8 → Bytes/s),
但后端之前存储的是 Bytes(前端 mbToBits 转换),导致节点收到天文数字等于不限速。

- 回滚 traffic_limit KB→Bytes 转换,统一用 Mbps 直接比较
- 部署后需执行数据迁移:UPDATE subscribe SET speed_limit = speed_limit / 1048576 WHERE speed_limit > 0

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-27 02:46:25 -07:00
315c59e5b7 fix: traffic_limit 限速值 KB→Bytes 转换,修复与基础限速单位不一致
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m56s
traffic_limit 的 speed_limit 前端输入单位是 KB,
订阅基础 speed_limit 存储单位是 Bytes,
比较和返回前需要 ×1024 转换为 Bytes,否则限速值异常偏低。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-27 02:30:06 -07:00
e5c8e965af fix: 设备组详情补充 auth_type/device_type 字段,统一用户名显示
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m15s
- FamilyMemberItem 新增 auth_type、device_type 字段
- FamilySummary 新增 owner_auth_type 字段
- findUserIdentifiers 返回 identifierInfo(含 auth_type)
- 新增 parseDeviceType() 从 UserAgent 解析设备类型

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-26 21:30:51 -07:00
4a2501a3d1 fix: 折扣匹配改为精确匹配 quantity,不再取全局最小值
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m55s
将 getDiscount 和 isNewUserOnlyForQuantity 的匹配逻辑从
inputMonths >= discount.Quantity 改为 inputMonths == discount.Quantity,
买多少天就用多少天对应的折扣,避免错误配置导致折扣泄漏。
同时增加 discount 值合法性校验(>0 且 <100)。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-26 01:28:50 -07:00
774fce6147 fix: 预览节点只显示用户实际所在分组的节点,不再包含公共节点
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m48s
2026-03-25 23:15:48 -07:00
d63b943964 fix: 修复订阅更新 group_locked 不能为 null 问题 + Kutt 短链3次重试
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m46s
- updateUserSubscribeLogic: 更新订阅时补充 GroupLocked 字段,避免写入 NULL 触发数据库约束错误
- inviteLinkResolver: generateShortLinkWithTimeout 增加最多3次重试,防止网络波动导致短链生成失败

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-25 22:36:34 -07:00
b43dcd8dab merge: 同步 origin/master 新功能到定制版本
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m8s
2026-03-24 01:03:56 -07:00
95830eae8a fix: 流量分组查询条件改为仅判断 max_traffic_gb > 0 2026-03-24 01:03:29 -07:00
EUForest
7fe7243c24 feat: Add slider verification code 2026-03-23 02:42:12 +08:00
f703b5089a 分组概念
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m58s
2026-03-19 03:21:47 -07:00
e5e9f93f68 Merge remote-tracking branch 'origin/master' into internal 2026-03-19 01:55:01 -07:00
fdfadca57f 赠送逻辑
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m57s
2026-03-18 02:04:34 -07:00
282e1e4087 deviceno
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m26s
2026-03-17 09:12:56 -07:00
dcdbabdb13 注销
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m34s
2026-03-17 07:12:42 -07:00
3cd22d8538 x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m3s
2026-03-16 00:59:49 -07:00
79a1eeca1f feat: 自动生成并更新用户缺失的推荐码
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
2026-03-15 19:43:53 -07:00
3d732c0361 feat: 为用户设备添加 DeviceNo 字段并实现 ID 混淆,同时在迁移脚本中新增 ID 重建逻辑。
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-03-15 19:38:37 -07:00
ad578883e4 feat: 添加付费用户数据迁移脚本、报告及相关管理逻辑调整。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m49s
2026-03-14 22:37:03 -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
2cc1124dd8 fix: 任何人注销账号都解散整个家庭组,删除所有成员的登录方式和订阅
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m41s
统一 member/owner 注销逻辑:无论谁注销,都解散家庭、
删除所有成员的 AuthMethods + Subscribe、踢出所有设备、清除所有缓存。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 06:23:11 -07:00
b6405c8f28 fix: IAP attach 后立即清除订阅缓存,修复 App 查到旧数据;返回值改用累计到期时间
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 04:56:17 -07:00
add27aa4d9 fix: Apple IAP attach 支持家庭成员购买场景
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m15s
member 发起购买后订阅归属于 owner,但 attach 交易时校验
orderSub.UserId != u.Id 报"订单订阅与当前用户不匹配"。
现在通过 ResolveEntitlementUser 获取 EffectiveUserID,
允许 member 绑定属于其家庭 owner 的订阅。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 03:38:42 -07:00
2f33e1e680 fix: 踢其他设备时不再清除踢人者自己的 session
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m29s
logoutUnbind 循环清理家庭成员时,踢人者(kicker)也在成员列表中,
导致 kicker 的设备被踢、session 被清,自己也下线了。
现在跳过 kickerUserID,只清缓存不踢设备不清 session。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 03:05:34 -07:00
e4ec85c176 fix: clearAllSessions 改用 SCAN 查找 session,修复会话清理无效
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
根因:登录时只写了 auth:session_id:{sessionId} (Redis SET),
从未写入 auth:user_sessions:{userId} sorted set,
导致 clearAllSessions 用 ZRange 永远返回空,session 根本没被清除。

修复:改用 SCAN auth:session_id:* 遍历所有 session key,
按 value 匹配 userId 找出该用户的全部 session 后删除,
同时清理关联的 device cache key。

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:47:32 -07:00
dddb8c7fe2 fix: 平级踢人后更新被踢设备 online 状态为 false
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
unbindDeviceLogic.logoutUnbind 中 KickDevice 后缺少
device.Online = false + UpdateDevice,导致后台仍显示在线

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:37:12 -07:00
384c8df506 fix: 踢出用户时清除所有 session,确保旧 token 立即失效
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m43s
- kickOfflineByUserDeviceLogic: 管理员踢设备后新增 clearAllSessions,
  之前只清单个 WebSocket session,用户可用旧 token 继续访问
- unbindDeviceLogic: 家庭成员被踢时增加踢设备+清 session;
  补全 session detail key 清理

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 02:19:35 -07:00
7d5b4fcb84 邮箱修复
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m13s
2026-03-12 01:24:21 -07:00
a3cc23bbd4 feat: 绑定新邮箱时创建独立邮箱用户并转移订阅,而非挂在设备用户上
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m5s
- bindEmailWithVerificationLogic: 新邮箱路径改为创建独立 email user + joinFamily
- familyBindingHelper: clearMemberSubscribes → transferMemberSubscribesToOwner,订阅转移给 owner 而非删除
- accountMergeHelper: 同步更新调用点

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-12 00:52:50 -07:00
772c12f821 fix: 注销后 device login 补回被删除的 device auth_method,修复前端按钮显示异常
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m18s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 10:07:14 -07:00
3f56fc6def feat: Owner 退出登录时转移订阅/邮箱/家庭权限给 member,而非解散家庭
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-11 09:00:35 -07:00
bb80df5786 权限问题
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-03-11 08:06:13 -07:00
fafb229295 feat: 为折扣计算函数 getDiscount 引入新用户判断逻辑以支持新用户专属折扣。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
2026-03-11 03:56:48 -07:00
48383fa0a9 更新支付方式相关业务逻辑。
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m31s
2026-03-10 21:42:02 -07:00
26f6400e74 feat: 苹果支付uuid 及设备逻辑
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 8m3s
2026-03-10 19:53:19 -07:00
EUForest
17163486f6 fix(subscribe): fix user subscription node retrieval logic to support directly assigned nodes 2026-03-10 18:29:19 +08:00
662ef6edb3 15分钟修改成5分钟
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m38s
2026-03-09 22:29:30 -07:00
a542a6df46 fix: 修复 退出登录 auth问题
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
2026-03-09 09:04:47 -07:00
EUForest
fae77a8954 feat(auth): add captcha verification to phone authentication
- Add verifyCaptcha method to phone login logic
- Add verifyCaptcha method to phone registration logic
- Support both local and Turnstile captcha verification
- Check EnableUserLoginCaptcha for phone login
- Check EnableUserRegisterCaptcha for phone registration
- Validate captcha before processing phone authentication
2026-03-09 22:55:23 +08:00
EUForest
cea3e31f3a feat(auth): add captcha verification to user email authentication
- Add verifyCaptcha method to user login logic
- Add verifyCaptcha method to user registration logic
- Add verifyCaptcha method to password reset logic
- Support both local and Turnstile captcha verification
- Check respective configuration flags before verification
- Validate captcha code and ID for local captcha
- Validate Turnstile token for Turnstile mode
2026-03-09 22:55:08 +08:00
EUForest
9aaffec61d feat(auth): add admin authentication with permission checks
- Add admin login handler and logic with IsAdmin verification
- Add admin password reset handler and logic
- Add admin captcha generation handler and logic
- Implement device binding for admin login
- Add login logging for admin authentication
- Check EnableAdminLoginCaptcha configuration
- Separate admin authentication from user authentication
- Verify admin permission before allowing access
2026-03-09 22:54:59 +08:00