29 Commits

Author SHA1 Message Date
954b19c332 feat: 邮箱规范化(NormalizeEmail)与域名白名单检查(IsEmailDomainWhitelisted)
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-12 18:43:47 -07:00
e818ac8764 x
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m38s
2026-04-04 09:41:41 -07:00
98d8525fa9 refactor: 简化 trial 赠送配置,删除多余的白名单启用开关
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 7m42s
**简化方案**:
- 删除 `EnableTrialEmailWhitelist` 配置字段(多余)
- 保留 `TrialEmailDomainWhitelist`(逗号分隔的白名单域名)
- 赠送规则:白名单**非空** 且 **邮箱在列表** 才赠送

**新的赠送逻辑**:
```yaml
TrialEmailDomainWhitelist: "qq.com,163.com,gmail.com"
```
- 为空 →  不赠送(关闭)
- 非空 →  赠送给白名单域名的邮箱

**更新的地方**:
1. internal/config/config.go - 删除 EnableTrialEmailWhitelist 字段
2. userRegisterLogic.go - 简化赠送逻辑
3. emailLoginLogic.go - 简化赠送逻辑
4. bindEmailWithVerificationLogic.go - 简化赠送逻辑
5. oAuthLoginGetTokenLogic.go - 简化赠送逻辑

**配置升级说明**:
旧配置:
```yaml
EnableTrial: true
EnableTrialEmailWhitelist: true
TrialEmailDomainWhitelist: "qq.com,163.com"
```

新配置(只保留两项):
```yaml
EnableTrial: true
TrialEmailDomainWhitelist: "qq.com,163.com"
```

关闭赠送:
```yaml
EnableTrial: true
TrialEmailDomainWhitelist: ""
```

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-03 07:20:10 -07:00
3417da2a9e feat: trial 赠送改为白名单邮箱域名控制
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 7m14s
- 新增 EnableTrialEmailWhitelist + TrialEmailDomainWhitelist 配置
- 邮箱注册/登录:加白名单域名判断,域名匹配才赠送 trial
- 设备登录/手机注册:移除 activeTrial,不再自动赠送
- 绑定邮箱(bindEmailWithVerification):绑定成功后检查白名单+防重复赠送
- 新增 IsEmailDomainWhitelisted 导出函数供跨包调用
- 清理 deviceLoginLogic/telephoneUserRegisterLogic 中的 activeTrial 死代码

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-02 05:46:04 -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
EUForest
7fe7243c24 feat: Add slider verification code 2026-03-23 02:42:12 +08: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
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
39310d5b9a Features:
- Node group CRUD operations with traffic-based filtering
  - Three grouping modes: average distribution, subscription-based, and traffic-based
  - Automatic and manual group recalculation with history tracking
  - Group assignment preview before applying changes
  - User subscription group locking to prevent automatic reassignment
  - Subscribe-to-group mapping configuration
  - Group calculation history and detailed reports
  - System configuration for group management (enabled/mode/auto_create)

  Database:
  - Add node_group table for group definitions
  - Add group_history and group_history_detail tables for tracking
  - Add node_group_ids (JSON) to nodes and subscribe tables
  - Add node_group_id and group_locked fields to user_subscribe table
  - Add migration files for schema changes
2026-03-08 23:22:38 +08:00
6c370485d1 fix gitea workflow path and runner label
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 8m1s
2026-03-04 03:07:41 -08:00
82626dd749 fix device decrypt flow and delete_account response stability
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 8m0s
2026-03-04 01:37:11 -08:00
4d8516b2e1 同步历史版本代码 2026-03-03 09:32:22 -08:00
5f1a546bbe fix: resolve trial subscription cache issue on new user registration
When new users register with trial subscription enabled, the subscription
link fails to connect in Clash clients. This is caused by missing cache
invalidation after transaction commit.

Changes:
- Add cache clearing after successful trial subscription creation
- Clear user subscription cache, subscription details cache, and server cache
- Modify activeTrial functions to return subscription object for cache clearing
- Apply fix to all registration methods: email, phone, device, and OAuth

This ensures subscription links work immediately after registration without
requiring manual subscription reset.
2026-01-22 23:57:15 +07: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
EUForest
ff2d3f85f3 new features: Based on IP user registration restrictions 2025-11-13 14:52:02 +08:00
EUForest
de6661cc16 Update: Successful authentication records the identifier. 2025-11-06 15:32:29 +08:00
EUForest
2605d22f8e Add: ClearServerAllCache Func 2025-11-01 16:05:37 +08:00
EUForest
96808d531a
Application device interface encryption and other bug fixes (#87)
* add: device login

* update: global config

* add: User transmission interface encryption

* update: get global config

* update: User transmission interface encryption

* add: get device list

* add: SecretIsEmpty Message

* update: device middleware

* add: query user subscribe node list

* fix bug: query device list

* fix bug: unbind device

* update: device login

* fix bug: The ad table is missing the description field

* fix bug:page size is zero

* update: Device Middleware

* fix bug: Site custom data update failed
2025-10-15 10:09:19 -04:00
Chang lue Tsen
8562734fde feat(user): add encryption algorithm and salt fields to User model for migrate 2025-10-09 13:33:03 -04:00
Chang lue Tsen
5ca4179285 feat(user): add OnlyFirstPurchase field to user creation logic 2025-09-27 10:13:41 -04:00
Chang lue Tsen
fe629e59dd fix(log): update timestamp handling in login and registration logs 2025-09-02 14:12:06 -04:00
Chang lue Tsen
82fd674ae4 feat(api): standardize timestamp field across log structures 2025-08-26 14:39:54 -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
ad4f3df74e feat(server): implement server management handlers and database schema 2025-08-25 14:06:37 -04:00
Chang lue Tsen
d33f4cd1ce feat(traffic): add traffic statistics logging and scheduling 2025-08-21 14:11:03 -04:00
Chang lue Tsen
87c771bbd4 refactor(log): consolidate logging models and update related logic for improved clarity and functionality 2025-08-20 13:36:06 -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