- 在DeviceManager中添加GetOnlineDeviceCount方法用于获取在线设备数 - 在统计接口中增加在线设备数返回 - 优化订阅查询逻辑,增加服务组关联节点数量计算 - 添加AnyTLS协议支持及相关URI生成功能 - 重构邀请佣金计算逻辑,支持首购/年付/非首购不同比例 - 修复用户基本信息更新中IsAdmin和Enable字段类型不匹配问题 - 更新数据库迁移脚本和配置文件中邀请相关配置项
131 lines
9.6 KiB
SQL
131 lines
9.6 KiB
SQL
-- 000002_init_data.up.sql
|
|
SET FOREIGN_KEY_CHECKS = 0;
|
|
|
|
-- auth_method
|
|
INSERT IGNORE INTO `auth_method` (`id`, `method`, `config`, `enabled`, `created_at`, `updated_at`)
|
|
VALUES (1, 'email',
|
|
'{"platform":"smtp","platform_config":{"host":"","port":0,"user":"","pass":"","from":"","ssl":false},"enable_verify":false,"enable_notify":false,"enable_domain_suffix":false,"domain_suffix_list":"","verify_email_template":"","expiration_email_template":"","maintenance_email_template":"","traffic_exceed_email_template":""}',
|
|
1, '2025-04-22 14:25:16.642', '2025-04-22 14:25:16.642'),
|
|
(2, 'mobile',
|
|
'{"platform":"AlibabaCloud","platform_config":{"access":"","secret":"","sign_name":"","endpoint":"","template_code":""},"enable_whitelist":false,"whitelist":[]}',
|
|
0, '2025-04-22 14:25:16.642', '2025-04-22 14:25:16.642'),
|
|
(3, 'apple', '{"team_id":"","key_id":"","client_id":"","client_secret":"","redirect_url":""}', 0,
|
|
'2025-04-22 14:25:16.642', '2025-04-22 14:25:16.642'),
|
|
(4, 'google', '{"client_id":"","client_secret":"","redirect_url":""}', 0, '2025-04-22 14:25:16.642',
|
|
'2025-04-22 14:25:16.642'),
|
|
(5, 'github', '{"client_id":"","client_secret":"","redirect_url":""}', 0, '2025-04-22 14:25:16.642',
|
|
'2025-04-22 14:25:16.642'),
|
|
(6, 'facebook', '{"client_id":"","client_secret":"","redirect_url":""}', 0, '2025-04-22 14:25:16.642',
|
|
'2025-04-22 14:25:16.642'),
|
|
(7, 'telegram', '{"bot_token":"","enable_notify":false,"webhook_domain":""}', 0, '2025-04-22 14:25:16.642',
|
|
'2025-04-22 14:25:16.642'),
|
|
(8, 'device', '{"show_ads":false,"only_real_device":false,"enable_security":false,"security_secret":""}', 0,
|
|
'2025-04-22 14:25:16.642', '2025-04-22 14:25:16.642');
|
|
|
|
-- payment
|
|
INSERT IGNORE INTO `payment` (`id`, `name`, `platform`, `description`, `icon`, `domain`, `config`, `fee_mode`,
|
|
`fee_percent`, `fee_amount`, `enable`, `token`)
|
|
VALUES (-1, 'Balance', 'balance', '', '', '', '', 0, 0, 0, 1, '');
|
|
|
|
-- subscribe_type
|
|
INSERT IGNORE INTO `subscribe_type` (`id`, `name`, `mark`, `created_at`, `updated_at`)
|
|
VALUES (1, 'Clash', 'Clash', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(2, 'Hiddify', 'Hiddify', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(3, 'Loon', 'Loon', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(4, 'NekoBox', 'NekoBox', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(5, 'NekoRay', 'NekoRay', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(6, 'Netch', 'Netch', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(7, 'Quantumult', 'Quantumult', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(8, 'Shadowrocket', 'Shadowrocket', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(9, 'SingBox', ' SingBox', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(10, 'Surfboard', 'Surfboard', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(11, 'Surge', 'Surge', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(12, 'V2box', 'V2box', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(13, 'V2rayN', 'V2rayN', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648'),
|
|
(14, 'V2rayNg', 'V2rayNg', '2025-04-22 14:25:16.648', '2025-04-22 14:25:16.648');
|
|
|
|
-- system
|
|
INSERT IGNORE INTO `system` (`id`, `category`, `key`, `value`, `type`, `desc`, `created_at`, `updated_at`)
|
|
VALUES (1, 'site', 'SiteLogo', '/favicon.svg', 'string', 'Site Logo', '2025-04-22 14:25:16.637',
|
|
'2025-04-22 14:25:16.637'),
|
|
(2, 'site', 'SiteName', 'Perfect Panel', 'string', 'Site Name', '2025-04-22 14:25:16.637',
|
|
'2025-04-22 14:25:16.637'),
|
|
(3, 'site', 'SiteDesc',
|
|
'PPanel is a pure, professional, and perfect open-source proxy panel tool, designed to be your ideal choice for learning and practical use.',
|
|
'string', 'Site Description', '2025-04-22 14:25:16.637', '2025-04-22 14:25:16.637'),
|
|
(4, 'site', 'Host', '', 'string', 'Site Host', '2025-04-22 14:25:16.637', '2025-04-22 14:25:16.637'),
|
|
(5, 'site', 'Keywords', 'Perfect Panel,PPanel', 'string', 'Site Keywords', '2025-04-22 14:25:16.637',
|
|
'2025-04-22 14:25:16.637'),
|
|
(6, 'site', 'CustomHTML', '', 'string', 'Custom HTML', '2025-04-22 14:25:16.637', '2025-04-22 14:25:16.637'),
|
|
(7, 'tos', 'TosContent', 'Welcome to use Perfect Panel', 'string', 'Terms of Service', '2025-04-22 14:25:16.637',
|
|
'2025-04-22 14:25:16.637'),
|
|
(8, 'tos', 'PrivacyPolicy', '', 'string', 'PrivacyPolicy', '2025-04-22 14:25:16.637', '2025-04-22 14:25:16.637'),
|
|
(9, 'ad', 'WebAD', 'false', 'bool', 'Display ad on the web', '2025-04-22 14:25:16.637',
|
|
'2025-04-22 14:25:16.637'),
|
|
(10, 'subscribe', 'SingleModel', 'false', 'bool', '是否单订阅模式', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(11, 'subscribe', 'SubscribePath', '/api/subscribe', 'string', '订阅路径', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(12, 'subscribe', 'SubscribeDomain', '', 'string', '订阅域名', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(13, 'subscribe', 'PanDomain', 'false', 'bool', '是否使用泛域名', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(14, 'verify', 'TurnstileSiteKey', '', 'string', 'TurnstileSiteKey', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(15, 'verify', 'TurnstileSecret', '', 'string', 'TurnstileSecret', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(16, 'verify', 'EnableLoginVerify', 'false', 'bool', 'is enable login verify', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(17, 'verify', 'EnableRegisterVerify', 'false', 'bool', 'is enable register verify', '2025-04-22 14:25:16.639',
|
|
'2025-04-22 14:25:16.639'),
|
|
(18, 'verify', 'EnableResetPasswordVerify', 'false', 'bool', 'is enable reset password verify',
|
|
'2025-04-22 14:25:16.639', '2025-04-22 14:25:16.639'),
|
|
(19, 'server', 'NodeSecret', '12345678', 'string', 'node secret', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(20, 'server', 'NodePullInterval', '10', 'int', 'node pull interval', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(21, 'server', 'NodePushInterval', '60', 'int', 'node push interval', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(22, 'server', 'NodeMultiplierConfig', '[]', 'string', 'node multiplier config', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(23, 'invite', 'ForcedInvite', 'false', 'bool', 'Forced invite', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(24, 'invite', 'FirstPurchasePercentage', '20', 'int', 'First purchase commission percentage', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(25, 'invite', 'NonFirstPurchasePercentage', '10', 'int', 'Non-first purchase commission percentage', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(26, 'invite', 'ForcedInvite', 'false', 'bool', 'Forced invite', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(42, 'invite', 'FirstYearlyPurchasePercentage', '25', 'int', 'First yearly purchase commission percentage', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(27, 'register', 'StopRegister', 'false', 'bool', 'is stop register', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(27, 'register', 'EnableTrial', 'false', 'bool', 'is enable trial', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(28, 'register', 'TrialSubscribe', '', 'int', 'Trial subscription', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(29, 'register', 'TrialTime', '24', 'int', 'Trial time', '2025-04-22 14:25:16.640', '2025-04-22 14:25:16.640'),
|
|
(30, 'register', 'TrialTimeUnit', 'Hour', 'string', 'Trial time unit', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(31, 'register', 'EnableIpRegisterLimit', 'false', 'bool', 'is enable IP register limit',
|
|
'2025-04-22 14:25:16.640', '2025-04-22 14:25:16.640'),
|
|
(32, 'register', 'IpRegisterLimit', '3', 'int', 'IP Register Limit', '2025-04-22 14:25:16.640',
|
|
'2025-04-22 14:25:16.640'),
|
|
(33, 'register', 'IpRegisterLimitDuration', '64', 'int', 'IP Register Limit Duration (minutes)',
|
|
'2025-04-22 14:25:16.640', '2025-04-22 14:25:16.640'),
|
|
(34, 'currency', 'Currency', 'USD', 'string', 'Currency', '2025-04-22 14:25:16.641', '2025-04-22 14:25:16.641'),
|
|
(35, 'currency', 'CurrencySymbol', '$', 'string', 'Currency Symbol', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(36, 'currency', 'CurrencyUnit', 'USD', 'string', 'Currency Unit', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(37, 'currency', 'AccessKey', '', 'string', 'Exchangerate Access Key', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(38, 'verify_code', 'VerifyCodeExpireTime', '300', 'int', 'Verify code expire time', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(39, 'verify_code', 'VerifyCodeLimit', '15', 'int', 'limits of verify code', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(40, 'verify_code', 'VerifyCodeInterval', '60', 'int', 'Interval of verify code', '2025-04-22 14:25:16.641',
|
|
'2025-04-22 14:25:16.641'),
|
|
(41, 'system', 'Version', '0.2.0(02002)', 'string', 'System Version', '2025-04-22 14:25:16.642',
|
|
'2025-04-22 14:25:16.642');
|
|
SET FOREIGN_KEY_CHECKS = 1; |