Compare commits

..

96 Commits

Author SHA1 Message Date
GeekQu 12ccc306d8 +1 7 years ago
GeekQu 60e82fc07f 修改客户端下载链接 7 years ago
GeekQu e9fa797b25 修复 Shadowrocket ss-v2ray-plugin 节点的编码错误 7 years ago
GeekQu b24f68098e ss && ssd 7 years ago
GeekQu 77c7f2e8c9 fix 7 years ago
GeekQu 42cf1b8749 Create README.md 7 years ago
GeekQu 31b53a0052 getPcClient 7 years ago
GeekQu f955323d3c getPcClient 7 years ago
GeekQu 764b300582 修复 Surge 4 使用 Surge 2 规则的问题 7 years ago
GeekQu a8470bb0a3 修复缺失的判断 7 years ago
GeekQu 7a7ec8a192 分离 YAML2Array 7 years ago
GeekQu fea0fc9580 telegram 推送自定义设置 2 7 years ago
GeekQu 5bc4a557b7 修改 sendDiary_Msg 7 years ago
GeekQu 805e602d5a telegram 推送自定义设置 7 years ago
GeekQu a835ba415b Update ConfController.php 7 years ago
GeekQu ae58db22ee 术后修复 7 years ago
GeekQu 647efbecc7 Merge branch 'pr/41' into dev 7 years ago
Anankke 51a10a31b6
Merge pull request #838 from NS-Sp4ce/dev
修复安卓V2RayNG链接错误
7 years ago
Sp4ce 7fc7046290
修复安卓V2RayNG链接错误
修复安卓V2RayNG链接错误
7 years ago
GeekQu 44bcbbcb6f 修复 Base64_url_encode 带来的兼容问题 7 years ago
GeekQu 7a7a7d8044 2333 7 years ago
GeekQu 7516dfcf83 修复 Quantumult SS 订阅的兼容问题 7 years ago
GeekQu 87d178fd29 Update index.tpl 7 years ago
GeekQu 36799fc57b 为 Clash VMess 加入 udp 字段 7 years ago
GeekQu 9beb73c5a0 重写订阅中的用户账户到期及流量展示,现在可以在 Config 配置为订阅添加一些简短的公告了 7 years ago
GeekQu f4c1688f84 可移除 SS 节点名称中的站点名 7 years ago
GeekQu 53c9578796 解决 Quantumult SS 订阅提示无 group 的问题 7 years ago
GeekQu 6dab034a26 emoji 7 years ago
TheCGDF 275941191f V2rayU -> ssr-download 7 years ago
GeekQu 4a5b63fcfa Surge 4 以及 ClashR 显示 7 years ago
GeekQu 9486df11da 支持 Surge 的新特性 7 years ago
laurieryayoi ed70ab3ed8 替换update中的System_config为_ENV 7 years ago
GeekQu 9cfa7f5c79 审计封禁可添加例外用户 7 years ago
Regend Soh d747eedadd config: update default params(#829)
避免小白继续祸害各大运营商IP
7 years ago
GeekQu 00ba947172 喜迎国庆 +1s 7 years ago
錢爸爸 576e9e5b98
Update README.md 7 years ago
錢爸爸 8d5b103234
fix:Gravatar url 7 years ago
Anankke e42e5ee3e0 refactor: 129137b773 (r35233741) 7 years ago
SukkaW e1907e3b7b refactor(gravatar): minor updates 7 years ago
GeekQu 66030bbe3c 修复节点使用了端口偏移时 SSD 订阅的问题 7 years ago
GeekQu 191d1ccb57 修复资料编辑中的重置订阅链接以及切换配置 7 years ago
Regend Soh 8916041998 feat: add copy button for node SSR and SS link (#816)
* Add copy button for node SSR and SS link

* Remove unnecessary script
7 years ago
Regend Soh c92a52df64 feat: add function to display disable reason for disabled accounts (#815)
* Add disableReason Function

* Added disable reason based on 审计规则
7 years ago
錢爸爸 a7503a8207
Restore Gravatar function & Add set Avatar 7 years ago
錢爸爸 129137b773
Restore Gravatar function 7 years ago
Regend Soh 84ad7f2bf3 feat: add paid user count feature (#814)
* Add paidUserCount function

* Add display of paidUserCount
7 years ago
GeekQu cbd1c5b57f 修排版 7 years ago
GeekQu e6519b4ef1 修改默认 7 years ago
GeekQu be0cb7f93a 审计封禁 7 years ago
Regend Soh 89ea1b75d8 feat: add display income feature (#813)
* Adding income calculation function

Below functions are added:
- yesterday_income()
- today_income()
- this_month_income()
- last_month_income()
- total_income()

* Add income display on /admin/code page

Display the following information at /admin/code
- Today's income
- Yesterday's income
- This month's income
- Last month's income
- Total income

* Reformatting code style

Reformat the code, attempting to follow the standard required.

* Refactor to camel case naming

* Refactor to camel case naming

* Reformat due to spacing and tabbing issue
7 years ago
GeekQu a6df534356 fix 7 years ago
Anankke 797bd35f1b revert: "fix(init): remove default http forward header handle"
This reverts commit 040e987a
7 years ago
SakuraSa233 189bbf9026
fix(ci): sync test config file 7 years ago
SakuraSa233 91b2bf2016
feat(config): store config to $_ENV 7 years ago
SakuraSa233 fb8bd622fb
clean(services\config): unused env set function 7 years ago
SakuraSa233 040e987aa6
fix(init): remove default http forward header handle 7 years ago
Regend Soh badc98f29e feat(admin): add aff id change function
* 添加修改用户邀请者

* 添加 chginvite 路由

* 添加chgInvite function
7 years ago
Anankke 76d7d586d9
Merge pull request #807 from wewall/patch-2
fix error(user/index): rm obsolete code
7 years ago
围墙 bc05bb18ff
fix error(user/index): rm obsolete code 7 years ago
NimaQu 66f8d8bc8f
Update README.md 7 years ago
Anankke 85306ae54d
Merge pull request #803 from pang-w/dev
#801 修复暴力获取mu参数引发的错误。
7 years ago
Pw 8d5122c7b4 * 修复暴力获取mu参数引发的错误。
* 简单优化没有mu参数的逻辑。
7 years ago
GeekQu 2135c4c300 从 getAllItems 分离 SS V2RayPlugin 节点 7 years ago
GeekQu 8648e42477 加入用户订阅记录清理 7 years ago
GeekQu 5b3a57c5cc 优化可读性 7 years ago
GeekQu c29c14930a 修复使用 noclass 的问题 7 years ago
GeekQu db63baeb47 ??? 7 years ago
GeekQu 2373a4557a fix 7 years ago
GeekQu 6ecf279774 订阅可通过正则筛选节点 7 years ago
GeekQu 90fe6def61 ClashR 兼容性,用户手动修改订阅链接 clash=2 即可 7 years ago
GeekQu 11353c5364 Merge branch 'pr/39' into dev 7 years ago
GeekQu 4e6002fcd6 修复 7 years ago
GeekQu f1a7996979 现在可以配置为中转规则直接下发偏移后的端口了 7 years ago
SakuraSa233 1811fc0aaa
refactor(composer): clean composer.json 7 years ago
GeekQu 4407015e46 现在可以配置为后端直接下发偏移后的端口了 7 years ago
GeekQu ed0d9fde04 优化流量耗尽用户限速至 1Mbps 7 years ago
Anankke 0619513890
fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug
py(划掉)pr
7 years ago
czn ecf3f67d04 fix: 修复不能识别$debug字段, 本地开发环境无法进入index的bug 7 years ago
GeekQu 99c70fa767 修改默认策略组更适合新手 7 years ago
GeekQu 10cc5c8764 fixed 7 years ago
GeekQu ec5091080f 修改 Surge、Clash、Surfboard 策略组 7 years ago
GeekQu e5f760e873 优化 Kitsunebi 订阅 7 years ago
GeekQu 49fea06df7 可选用户流量耗尽后不断网 7 years ago
GeekQu 593241432b 减少因为加密协议混淆同时支持 ss & ssr 而导致 Shadowrocket 订阅出现大量重复节点 7 years ago
GeekQu ddcbd4fa0f V2Ray、Shadowsocks - V2Ray-Plugin 节点默认单端口多用户 7 years ago
GeekQu 00eaeaf7b4
Merge branch 'dev' into dev 7 years ago
GeekQu 39d22fc924 用户订阅日志可选是否开启,开启请注意导入 user_subscribe_log.sql 7 years ago
GeekQu 175de83e40 用户可查询订阅记录 7 years ago
Rico 8fbc2c8118
Update README.md 7 years ago
GeekQu fae633893b
Merge pull request #48 from GeekQu/dev
增加用户订阅日志,需导入 sql/user_subscribe_log.sql
7 years ago
GeekQu a8ebbdb2ae
Merge pull request #47 from GeekQu/dev
船新的 Clash 配置、修改 Surfboard SS 节点格式、V2Ray & Kitsunebi 订阅默认带账户及流量信息
7 years ago
GeekQu b531d16b6d
Merge pull request #46 from GeekQu/dev
接小火箭的锅
7 years ago
GeekQu 88dc5d283b
Merge pull request #45 from GeekQu/dev
修复小火箭订阅
7 years ago
GeekQu 073fb840e7
Merge pull request #44 from GeekQu/dev
修复 用户中心-资料编辑 的排版
7 years ago
GeekQu 24f796250b
Merge pull request #43 from GeekQu/dev
更新上游至 20190725 以及修复端口偏移的 bug
7 years ago
GeekQu 043bf5c0c3
Merge pull request #42 from GeekQu/dev
部分修改以及增加对 NAT 节点端口偏移支持
7 years ago

@ -18,6 +18,10 @@
SSPanel UIM 是一款专为 Shadowsocks / ShadowsocksR / V2Ray 设计的多用户管理面板,基于 ss-panel-v3-mod 开发。
## AD
**特别优惠 Malio SSPANEL 主题 + Rico V2Ray 后端,原价 1000 CNY,现在只需 899 CNY,👉[查看详情](https://malio.fxxkmy.life/)**
## 特性
- 集成超过 8 种支付系统
@ -47,7 +51,7 @@ SSPanel UIM 支持安装在 LNMP、宝塔面板、Plesk 面板、oneinstack 等
```
账号:admin
密码:admin
mukey=NimaQu
mukey ShirakamiFubuki
```
## 文档
@ -162,9 +166,7 @@ SSPanel UIM 离不开所有 [贡献代码](https://github.com/Anankke/SSPanel-Ui
#### galaxychuck
- [黛米付-支付接入](https://www.daimiyun.cn/register.php?aff=624)
- [冲上云霄云主机](http://console.soar-clouds.com/aff.php?aff=94)
- [Vultr](https://www.vultr.com/?ref=7205737)
- [hkserversolution-推荐UIM面板服务器放置](https://www.hkserversolution.com/aff.php?aff=60)
#### laurieryayoi

@ -52,11 +52,21 @@ class DailyMail
$sts = new Analytics();
Telegram::Send('各位老爷少奶奶,我来为大家报告一下系统今天的运行状况哈~' .
PHP_EOL .
'今日签到人数:' . $sts->getTodayCheckinUser() . PHP_EOL .
'今日使用总流量:' . Tools::flowAutoShow($lastday_total) . PHP_EOL .
'晚安~');
if (Config::get('sendDiary_Telegram') == 'true') {
Telegram::Send(
str_replace(
array(
'%getTodayCheckinUser%',
'%lastday_total%'
),
array(
$sts->getTodayCheckinUser(),
Tools::flowAutoShow($lastday_total)
),
Config::get('sendDiary_Msg')
)
);
}
}

@ -17,6 +17,8 @@ use App\Models\DetectLog;
use App\Models\BlockIp;
use App\Models\TelegramSession;
use App\Models\EmailVerify;
use App\Models\UserSubscribeLog;
use App\Models\DetectBanLog;
use App\Services\Config;
use App\Services\Password;
use App\Utils\DNSoverHTTPS;
@ -148,6 +150,9 @@ class Job
}
}
// 清理订阅记录
UserSubscribeLog::where('request_time', '<', date('Y-m-d H:i:s', time() - 86400 * (int) Config::get('subscribeLog_keep_days')))->delete();
NodeInfoLog::where('log_time', '<', time() - 86400 * 3)->delete();
NodeOnlineLog::where('log_time', '<', time() - 86400 * 3)->delete();
TrafficLog::where('log_time', '<', time() - 86400 * 3)->delete();
@ -155,7 +160,10 @@ class Job
Speedtest::where('datetime', '<', time() - 86400 * 3)->delete();
EmailVerify::where('expire_in', '<', time() - 86400 * 3)->delete();
system('rm ' . BASE_PATH . '/storage/*.png', $ret);
Telegram::Send('姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~');
if (Config::get('sendDailyJob_Telegram') == 'true') {
Telegram::Send(Config::get('sendDailyJob_Msg'));
}
//auto reset
$boughts = Bought::all();
@ -521,15 +529,25 @@ class Job
);
}
$notice_text = '喵喵喵~ ' . $node->name . ' 节点掉线了喵~域名解析被切换到了 ' . $Temp_node->name . ' 上了喵~';
$notice_text = str_replace(
array('%node_name%', '%Temp_node_name%'),
array($node->name, $Temp_node->name),
Config::get('sendNodeOffline_Update_Msg')
);
}
}
} else {
$notice_text = '喵喵喵~ ' . $node->name . ' 节点掉线了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeOffline_Msg')
);
}
}
Telegram::Send($notice_text);
if (Config::get('sendNodeOffline_Telegram') == 'true') {
Telegram::Send($notice_text);
}
$myfile = fopen(
BASE_PATH . '/storage/' . $node->id . '.offline',
@ -609,13 +627,23 @@ class Job
}
}
$notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~域名解析被切换回来了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeOnline_Update_Msg')
);
} else {
$notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeOnline_Msg')
);
}
}
Telegram::Send($notice_text);
if (Config::get('sendNodeOnline_Telegram') == 'true') {
Telegram::Send($notice_text);
}
unlink(BASE_PATH . '/storage/' . $node->id . '.offline');
}
@ -853,6 +881,14 @@ class Job
$user->class = 0;
}
// 审计封禁解封
if ($user->detect_ban == 1) {
$logs = DetectBanLog::where('user_id', $user->id)->orderBy("id", "desc")->first();
if (($logs->end_time + $logs->ban_time * 60) <= time() || $logs == null) {
$user->detect_ban = 0;
}
}
$user->save();
}
@ -962,14 +998,24 @@ class Job
$record_id
);
}
$notice_text = '喵喵喵~ ' . $node->name . ' 节点被墙了喵~域名解析被切换到了 ' . $Temp_node->name . ' 上了喵~';
$notice_text = str_replace(
array('%node_name%', '%Temp_node_name%'),
array($node->name, $Temp_node->name),
Config::get('sendNodeGFW_Update_Msg')
);
}
}
} else {
$notice_text = '喵喵喵~ ' . $node->name . ' 节点被墙了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeGFW_Msg')
);
}
}
Telegram::Send($notice_text);
if (Config::get('sendNodeGFW_Telegram') == 'true') {
Telegram::Send($notice_text);
}
$file_node = fopen(BASE_PATH . '/storage/' . $node->id . '.gfw', 'wb+');
fclose($file_node);
} else {
@ -1022,12 +1068,22 @@ class Job
);
}
}
$notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~域名解析被切换回来了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeGFW_recover_Update_Msg')
);
} else {
$notice_text = '喵喵喵~ ' . $node->name . ' 节点恢复了喵~';
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::get('sendNodeGFW_recover_Msg')
);
}
}
Telegram::Send($notice_text);
if (Config::get('sendNodeGFW_recover_Telegram') == 'true') {
Telegram::Send($notice_text);
}
unlink(BASE_PATH . '/storage/' . $node->id . '.gfw');
}
}

@ -8,7 +8,7 @@ class Update
{
public static function update($xcat)
{
global $System_Config;
global $_ENV;
$copy_result = copy(BASE_PATH . '/config/.config.php', BASE_PATH . '/config/.config.php.bak');
if ($copy_result == true) {
echo('备份成功' . PHP_EOL);
@ -33,17 +33,17 @@ class Update
$config_new = file_get_contents(BASE_PATH . '/config/.config.example.php');
//执行版本升级
$version_old = $System_Config['version'] ?? 0;
$version_old = $_ENV['version'] ?? 0;
self::old_to_new($version_old);
//将旧config迁移到新config上
$migrated = array();
foreach ($System_Config as $key => $value_reserve) {
foreach ($_ENV as $key => $value_reserve) {
if ($key == 'config_migrate_notice' || $key == 'version') {
continue;
}
$regex = '/System_Config\[\'' . $key . '\'\].*?;/s';
$regex = '/_ENV\[\'' . $key . '\'\].*?;/s';
$matches_new = array();
preg_match($regex, $config_new, $matches_new);
if (isset($matches_new[0]) == false) {
@ -55,18 +55,18 @@ class Update
preg_match($regex, $config_old, $matches_old);
$config_new = str_replace($matches_new[0], $matches_old[0], $config_new);
$migrated[] = 'System_Config[\'' . $key . '\']';
$migrated[] = '_ENV[\'' . $key . '\']';
}
echo(PHP_EOL);
//检查新增了哪些config
$regex_new = '/System_Config\[\'.*?\'\]/s';
$regex_new = '/_ENV\[\'.*?\'\]/s';
$matches_new_all = array();
preg_match_all($regex_new, $config_new, $matches_new_all);
$differences = array_diff($matches_new_all[0], $migrated);
foreach ($differences as $difference) {
if ($difference == 'System_Config[\'config_migrate_notice\']' ||
$difference == 'System_Config[\'version\']') {
if ($difference == '_ENV[\'config_migrate_notice\']' ||
$difference == '_ENV[\'version\']') {
continue;
}
//匹配注释
@ -95,7 +95,7 @@ class Update
echo('新增配置项通常带有默认值,因此通常即使不作任何改动网站也可以正常运行' . PHP_EOL);
//输出notice
$regex_notice = '/System_Config\[\'config_migrate_notice\'\].*?(?=\';)/s';
$regex_notice = '/_ENV\[\'config_migrate_notice\'\].*?(?=\';)/s';
$matches_notice = array();
preg_match($regex_notice, $config_new, $matches_notice);
$notice_new = $matches_notice[0];
@ -108,8 +108,8 @@ class Update
) + 1
);
echo('以下是迁移附注:');
if (isset($System_Config['config_migrate_notice'])) {
if ($System_Config['config_migrate_notice'] != $notice_new) {
if (isset($_ENV['config_migrate_notice'])) {
if ($_ENV['config_migrate_notice'] != $notice_new) {
echo($notice_new);
}
} else {

@ -0,0 +1,43 @@
<?php
namespace App\Controllers\Admin;
use App\Controllers\AdminController;
use Ozdemir\Datatables\Datatables;
use App\Utils\DatatablesHelper;
class DetectBanLogController extends AdminController
{
public function index($request, $response, $args)
{
$table_config['total_column'] = array("id" => "ID", "user_id" => "用户ID",
"user_name" => "用户名", "email" => "用户邮箱",
"detect_number" => "违规次数", "ban_time" => "封禁时长(分钟)",
"start_time" => "统计开始时间", "end_time" => "统计结束以及封禁开始时间",
"ban_end_time" => "封禁结束时间", "all_detect_number" => "累计违规次数");
$table_config['default_show_column'] = array();
foreach ($table_config['total_column'] as $column => $value) {
array_push($table_config['default_show_column'], $column);
}
$table_config['ajax_url'] = 'ban/ajax';
return $this->view()->assign('table_config', $table_config)->display('admin/detect/ban.tpl');
}
public function ajax_log($request, $response, $args)
{
$datatables = new Datatables(new DatatablesHelper());
$datatables->query('Select detect_ban_log.id,detect_ban_log.user_id,detect_ban_log.user_name,detect_ban_log.email,detect_ban_log.detect_number,detect_ban_log.ban_time,detect_ban_log.start_time,detect_ban_log.end_time,detect_ban_log.all_detect_number,detect_ban_log.end_time as ban_end_time from detect_ban_log');
$datatables->edit('start_time', function ($data) {
return date('Y-m-d H:i:s', $data['start_time']);
});
$datatables->edit('end_time', function ($data) {
return date('Y-m-d H:i:s', $data['end_time']);
});
$datatables->edit('ban_end_time', function ($data) {
return date('Y-m-d H:i:s', $data['ban_end_time']+$data['ban_time']*60);
});
$body = $response->getBody();
$body->write($datatables->generate());
}
}

@ -86,6 +86,10 @@ class NodeController extends AdminController
$node->node_bandwidth_limit = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
$node->bandwidthlimit_resetday = $request->getParam('bandwidthlimit_resetday');
if (in_array($node->sort, array(11, 12, 13))) {
$node->mu_only = 1;
}
$node->save();
$domain_name = explode('.' . Config::get('cloudflare_name'), $node->server);
@ -93,7 +97,15 @@ class NodeController extends AdminController
CloudflareDriver::updateRecord($domain_name[0], $node->node_ip);
}
Telegram::Send('新节点添加~' . $request->getParam('name'));
if (Config::get('sendAddNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::get('sendAddNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = '节点添加成功';
@ -176,9 +188,21 @@ class NodeController extends AdminController
$node->node_bandwidth_limit = $request->getParam('node_bandwidth_limit') * 1024 * 1024 * 1024;
$node->bandwidthlimit_resetday = $request->getParam('bandwidthlimit_resetday');
if (in_array($node->sort, array(11, 12, 13))) {
$node->mu_only = 1;
}
$node->save();
Telegram::Send('节点信息被修改~' . $request->getParam('name'));
if (Config::get('sendUpdateNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$request->getParam('name'),
Config::get('sendUpdateNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = '修改成功';
@ -194,15 +218,21 @@ class NodeController extends AdminController
Radius::DelNas($node->node_ip);
}
$name = $node->name;
if (!$node->delete()) {
$rs['ret'] = 0;
$rs['msg'] = '删除失败';
return $response->getBody()->write(json_encode($rs));
}
Telegram::Send('节点被删除~' . $name);
if (Config::get('sendDeleteNode_Telegram') == 'true') {
Telegram::Send(
str_replace(
'%node_name%',
$node->name,
Config::get('sendDeleteNode_Msg')
)
);
}
$rs['ret'] = 1;
$rs['msg'] = '删除成功';

@ -6,6 +6,7 @@ use App\Models\User;
use App\Models\Ip;
use App\Models\Bought;
use App\Models\Relay;
use App\Models\DetectBanLog;
use App\Controllers\AdminController;
use App\Services\Config;
use App\Services\Auth;
@ -327,6 +328,33 @@ class UserController extends AdminController
$user->forbidden_ip = str_replace(PHP_EOL, ',', $request->getParam('forbidden_ip'));
$user->forbidden_port = str_replace(PHP_EOL, ',', $request->getParam('forbidden_port'));
$detect_ban = (int)$request->getParam('detect_ban');
// 手动解封
if ($user->detect_ban == 1 && $detect_ban == 0) {
$user->detect_ban = 0;
}
// 手动封禁
if ($user->detect_ban == 0 && $detect_ban == 1) {
if ((int)$request->getParam('ban_time') == 0) {
$rs['ret'] = 0;
$rs['msg'] = "修改失败,封禁时长不能为 0";
return $response->getBody()->write(json_encode($rs));
}
$user->detect_ban = 1;
$end_time = date('Y-m-d H:i:s');
$user->last_detect_ban_time = $end_time;
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $user->user_name;
$DetectBanLog->user_id = $user->id;
$DetectBanLog->email = $user->email;
$DetectBanLog->detect_number = '0';
$DetectBanLog->ban_time = (int)$request->getParam('ban_time');
$DetectBanLog->start_time = strtotime('1989-06-04 00:05:00');
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $user->all_detect_number;
$DetectBanLog->save();
}
if (!$user->save()) {
$rs['ret'] = 0;
$rs['msg'] = '修改失败';

@ -60,6 +60,33 @@ class AdminController extends UserController
return $this->view()->assign('table_config', $table_config)->display('admin/invite.tpl');
}
public function chgInvite($request, $response, $args)
{
$prefix = $request->getParam('prefix');
if ($request->getParam('userid')!=NULL && $request->getParam('refid')!=NULL) {
if (strpos($request->getParam('userid'), "@")!=false) {
$user=User::where("email", "=", $request->getParam('userid'))->first();
} else {
$user=User::Where("id", "=", $request->getParam('userid'))->first();
}
if ($user==null) {
$res['ret'] = 0;
$res['msg'] = "邀请者更改失败,检查用户id是否输入正确";
return $response->getBody()->write(json_encode($res));
}
$uid = $user->id;
} else {
$uid=0;
}
$user->ref_by = $request->getParam('refid');
$user->save();
$res['ret'] = 1;
$res['msg'] = "邀请者更改成功";
return $response->getBody()->write(json_encode($res));
}
public function addInvite($request, $response, $args)
{
$num = $request->getParam('num');

@ -56,13 +56,16 @@ class ClientApiController extends BaseController
public function GetSubLink($request, $response, $args)
{
$accessToken = Helper::getParam($request, 'access_token');
$sub = (Helper::getParam($request, 'sub') != ''
? Helper::getParam($request, 'sub')
: 1);
$storage = Factory::createTokenStorage();
$token = $storage->get($accessToken);
$user = User::find($token->userId);
$ssr_sub_token = LinkController::GenerateSSRSubCode($user->id, 0);
$res['ret'] = 1;
$res['msg'] = 'ok';
$res['data'] = Config::get('subUrl') . $ssr_sub_token . '?sub=1';
$res['data'] = Config::get('subUrl') . $ssr_sub_token . '?sub=' . $sub;
return $this->echoJson($response, $res);
}
}

@ -16,6 +16,7 @@ namespace App\Controllers;
use App\Models\User;
use App\Services\Config;
use App\Utils\ConfRender;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;
@ -31,6 +32,22 @@ use Symfony\Component\Yaml\Exception\ParseException;
class ConfController extends BaseController
{
/**
* YAML 转数组
*
* @param string $Content YAML 字符串
*
* @return string
*/
public static function YAML2Array($Content)
{
try {
return Yaml::parse($Content);
} catch (ParseException $exception) {
return printf('无法解析 YAML 字符串: %s', $exception->getMessage());
}
}
/**
* 从远端自定义配置文件生成 Surge 托管配置
*
@ -41,29 +58,23 @@ class ConfController extends BaseController
*
* @return string
*/
public static function getSurgeConfs($User, $AllProxys, $Nodes, $SourceContent)
public static function getSurgeConfs($User, $AllProxys, $Nodes, $Configs, $local = false)
{
try {
$Configs = Yaml::parse($SourceContent);
} catch (ParseException $exception) {
return printf('无法解析 YAML 字符串: %s', $exception->getMessage());
}
$General = self::getSurgeConfGeneral($Configs['General']);
$Proxys = (isset($Configs['Proxy'])
? self::getSurgeConfProxy($Configs['Proxy'])
: '');
if (isset($Configs['ProxyGroup'])) {
$ProxyGroup = self::getSurgeConfProxyGroup(
$Nodes,
$Configs['ProxyGroup']
);
} else {
$ProxyGroup = self::getSurgeConfProxyGroup(
$Nodes,
$Configs['Proxy Group']
);
if (isset($Configs['Proxy Group'])) {
$Configs['ProxyGroup'] = $Configs['Proxy Group'];
}
$Rule = self::getSurgeConfRule($Configs['Rule']);
$ProxyGroups = self::getSurgeConfProxyGroup(
$Nodes,
$Configs['ProxyGroup']
);
$ProxyGroup = self::getSurgeProxyGroup2String($ProxyGroups);
$Rule = self::getSurgeConfRule($Configs['Rule'], $local);
$Conf = '#!MANAGED-CONFIG '
. Config::get('baseUrl') . $_SERVER['REQUEST_URI'] .
"\n\n#---------------------------------------------------#" .
@ -125,13 +136,12 @@ class ConfController extends BaseController
* @param array $Nodes 全部节点数组
* @param array $ProxyGroups Surge 策略组定义
*
* @return string
* @return array
*/
public static function getSurgeConfProxyGroup($Nodes, $ProxyGroups)
{
$return = '';
$return = [];
foreach ($ProxyGroups as $ProxyGroup) {
$str = '';
if (in_array($ProxyGroup['type'], ['select', 'url-test', 'fallback'])) {
$proxies = [];
if (
@ -141,51 +151,130 @@ class ConfController extends BaseController
$proxies = $ProxyGroup['content']['left-proxies'];
}
foreach ($Nodes as $item) {
switch (true) {
case (isset($ProxyGroup['content']['class'])):
if ($item['class'] == $ProxyGroup['content']['class'] && !in_array($item['remark'], $proxies)) {
if (isset($ProxyGroup['content']['regex'])) {
if (preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['remark'])) {
$proxies[] = $item['remark'];
}
} else {
$proxies[] = $item['remark'];
}
}
break;
case (isset($ProxyGroup['content']['noclass'])):
if ($item['class'] != $ProxyGroup['content']['noclass'] && !in_array($item['remark'], $proxies)) {
if (isset($ProxyGroup['content']['regex'])) {
if (preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['remark'])) {
$proxies[] = $item['remark'];
}
} else {
$proxies[] = $item['remark'];
}
}
break;
case (!isset($ProxyGroup['content']['class'])
&& !isset($ProxyGroup['content']['noclass'])
&& isset($ProxyGroup['content']['regex'])
&& preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['remark'])
&& !in_array($item['remark'], $proxies)):
$proxies[] = $item['remark'];
break;
default:
continue;
break;
$item = self::getMatchProxy($item, $ProxyGroup);
if ($item !== null && !in_array($item['remark'], $proxies)) {
$proxies[] = $item['remark'];
}
}
if (isset($ProxyGroup['content']['right-proxies'])) {
$proxies = array_merge($proxies, $ProxyGroup['content']['right-proxies']);
}
$Remarks = implode(', ', $proxies);
$ProxyGroup['proxies'] = $proxies;
}
$return[] = $ProxyGroup;
}
return $return;
}
/**
* 获取匹配的节点
*
* @param array $Proxy 节点
* @param array $Rule 匹配规则
*
* @return array
*/
public static function getMatchProxy($Proxy, $Rule)
{
$return = null;
switch (true) {
case (isset($Rule['content']['class'])):
if ($Proxy['class'] == $Rule['content']['class']) {
if (isset($Rule['content']['regex'])) {
if (preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])) {
$return = $Proxy;
}
} else {
$return = $Proxy;
}
}
break;
case (isset($Rule['content']['noclass'])):
if ($Proxy['class'] != $Rule['content']['noclass']) {
if (isset($Rule['content']['regex'])) {
if (preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])) {
$return = $Proxy;
}
} else {
$return = $Proxy;
}
}
break;
case (!isset($Rule['content']['class'])
&& !isset($Rule['content']['noclass'])
&& isset($Rule['content']['regex'])
&& preg_match('/' . $Rule['content']['regex'] . '/i', $Proxy['remark'])
):
$return = $Proxy;
break;
}
return $return;
}
/**
* Surge ProxyGroup 去除无用策略组
*
* @param array $ProxyGroups 策略组
* @param array $checks 要检查的策略组名
*
* @return array
*/
public static function fixSurgeProxyGroup($ProxyGroups, $checks)
{
if (count($checks) == 0) {
return $ProxyGroups;
}
$clean_names = [];
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (in_array($ProxyGroup['name'], $checks) && count($ProxyGroup['proxies']) == 0) {
$clean_names[] = $ProxyGroup['name'];
continue;
}
$newProxyGroups[] = $ProxyGroup;
}
if (count($clean_names) >= 1) {
$ProxyGroups = $newProxyGroups;
$newProxyGroups = [];
foreach ($ProxyGroups as $ProxyGroup) {
if (!in_array($ProxyGroup['name'], $checks) && $ProxyGroup['type'] != 'ssid') {
$newProxies = [];
foreach ($ProxyGroup['proxies'] as $proxie) {
if (!in_array($proxie, $clean_names)) {
$newProxies[] = $proxie;
}
}
$ProxyGroup['proxies'] = $newProxies;
}
$newProxyGroups[] = $ProxyGroup;
}
}
return $newProxyGroups;
}
/**
* Surge ProxyGroup 转字符串
*
* @param array $ProxyGroups Surge 策略组定义
*
* @return string
*/
public static function getSurgeProxyGroup2String($ProxyGroups)
{
$return = '';
foreach ($ProxyGroups as $ProxyGroup) {
$str = '';
if (in_array($ProxyGroup['type'], ['select', 'url-test', 'fallback'])) {
$proxies = implode(', ', $ProxyGroup['proxies']);
if (in_array($ProxyGroup['type'], ['url-test', 'fallback'])) {
$str .= ($ProxyGroup['name']
. ' = '
. $ProxyGroup['type']
. ', '
. $Remarks
. $proxies
. ', url = ' . $ProxyGroup['url']
. ', interval = ' . $ProxyGroup['interval']);
} else {
@ -193,7 +282,7 @@ class ConfController extends BaseController
. ' = '
. $ProxyGroup['type']
. ', '
. $Remarks);
. $proxies);
}
} elseif ($ProxyGroup['type'] == 'ssid') {
$wifi = '';
@ -225,8 +314,15 @@ class ConfController extends BaseController
*
* @return string
*/
public static function getSurgeConfRule($Rules)
public static function getSurgeConfRule($Rules, $local)
{
// 加载本地规则文件
if ($local) {
$render = ConfRender::getTemplateRender();
return $render->fetch(trim($Rules['source']));
}
// 加载远程规则文件
$return = '';
if (isset($Rules['source']) && $Rules['source'] != '') {
$sourceURL = trim($Rules['source']);
@ -260,13 +356,8 @@ class ConfController extends BaseController
*
* @return string
*/
public static function getClashConfs($User, $AllProxys, $SourceContent)
public static function getClashConfs($User, $AllProxys, $Configs, $local = false)
{
try {
$Configs = Yaml::parse($SourceContent);
} catch (ParseException $exception) {
return printf('无法解析 YAML 字符串: %s', $exception->getMessage());
}
if (isset($Configs['Proxy']) || count($Configs['Proxy']) != 0) {
$tmpProxys = array_merge($AllProxys, $Configs['Proxy']);
} else {
@ -298,7 +389,7 @@ class ConfController extends BaseController
"\n\n"
. Yaml::dump($tmp, 4, 2) .
"\n\n"
. self::getClashConfRule($Configs['Rule']);
. self::getClashConfRule($Configs['Rule'], $local);
return $Conf;
}
@ -351,39 +442,10 @@ class ConfController extends BaseController
$proxies = $ProxyGroup['content']['left-proxies'];
}
foreach ($Nodes as $item) {
switch (true) {
case (isset($ProxyGroup['content']['class'])):
if ($item['class'] == $ProxyGroup['content']['class'] && !in_array($item['name'], $proxies)) {
if (isset($ProxyGroup['content']['regex'])) {
if (preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['name'])) {
$proxies[] = $item['name'];
}
} else {
$proxies[] = $item['name'];
}
}
break;
case (isset($ProxyGroup['content']['noclass'])):
if ($item['class'] != $ProxyGroup['content']['noclass'] && !in_array($item['name'], $proxies)) {
if (isset($ProxyGroup['content']['regex'])) {
if (preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['name'])) {
$proxies[] = $item['name'];
}
} else {
$proxies[] = $item['name'];
}
}
break;
case (!isset($ProxyGroup['content']['class'])
&& !isset($ProxyGroup['content']['noclass'])
&& isset($ProxyGroup['content']['regex'])
&& preg_match('/' . $ProxyGroup['content']['regex'] . '/i', $item['name'])
&& !in_array($item['name'], $proxies)):
$proxies[] = $item['name'];
break;
default:
continue;
break;
$item['remark'] = $item['name'];
$item = self::getMatchProxy($item, $ProxyGroup);
if ($item !== null && !in_array($item['name'], $proxies)) {
$proxies[] = $item['name'];
}
}
if (isset($ProxyGroup['content']['right-proxies'])) {
@ -411,8 +473,15 @@ class ConfController extends BaseController
*
* @return string
*/
public static function getClashConfRule($Rules)
public static function getClashConfRule($Rules, $local)
{
// 加载本地规则文件
if ($local) {
$render = ConfRender::getTemplateRender();
return $render->fetch(trim($Rules['source']));
}
// 加载远程规则文件
$return = ('Rule:' . PHP_EOL);
if (isset($Rules['source']) && $Rules['source'] != '') {
$sourceURL = trim($Rules['source']);

File diff suppressed because it is too large Load Diff

@ -9,7 +9,10 @@ use App\Models\UnblockIp;
use App\Models\Speedtest;
use App\Models\Node;
use App\Models\Auto;
use App\Models\User;
use App\Controllers\BaseController;
use App\Utils\Tools;
use App\Services\Config;
class FuncController extends BaseController
{
@ -58,18 +61,57 @@ class FuncController extends BaseController
if ($rules[0]['dist_node_id'] == -1) {
$server = null;
}
foreach ($rules as $rule) {
$dis = $this->get_dis_node_info($rule['dist_node_id']);
if ($dis != null) {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = $dis->sort;
$rule['dist_node_server'] = $dis->server;
} else {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = null;
$rule['dist_node_server'] = null;
if (Config::get('relay_port_migration') == 'true') {
foreach ($rules as $rule) {
$dis = $this->get_dis_node_info($rule['dist_node_id']);
if ($dis != null) {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = $dis->sort;
if (in_array($dis->sort, [0, 10])) {
$dis_server = explode(';', $dis->server);
$rule['dist_node_server'] = $dis_server[0];
} else {
$rule['dist_node_server'] = $dis->server;
}
if (in_array($dis->sort, [0, 10]) && strpos($dis->server, ';') !== false && $dis->mu_only != -1) {
$muPort = Tools::get_MuOutPortArray($dis->server);
$user = User::where('port', '=', $rule['port'])->first();
if ($user != null) {
if ($user->is_multi_user != 0) {
if ($muPort['type'] == 0) {
if (in_array($rule['port'], array_keys($muPort['port']))) {
$rule['port'] = $muPort['port'][$rule['port']];
}
} else {
$rule['port'] = ($rule['port'] + $muPort['type']);
}
}
}
}
} else {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = null;
$rule['dist_node_server'] = null;
}
}
} else {
foreach ($rules as $rule) {
$dis = $this->get_dis_node_info($rule['dist_node_id']);
if ($dis != null) {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = $dis->sort;
$rule['dist_node_server'] = $dis->server;
} else {
$rule['source_node_sort'] = $node->sort;
$rule['dist_node_sort'] = null;
$rule['dist_node_server'] = null;
}
}
}
$res = [
'ret' => 1,
'data' => $rules,

@ -8,8 +8,11 @@ use App\Models\User;
use App\Models\NodeOnlineLog;
use App\Models\Ip;
use App\Models\DetectLog;
use App\Models\DetectBanLog;
use App\Controllers\BaseController;
use App\Services\Config;
use App\Utils\Tools;
use App\Utils\URL;
class UserController extends BaseController
{
@ -35,50 +38,123 @@ class UserController extends BaseController
$node->node_heartbeat = time();
$node->save();
if ($node->node_group != 0) {
$users_raw = User::where(
static function ($query) use ($node) {
// 节点流量耗尽则返回 null
if (($node->node_bandwidth_limit != 0) && $node->node_bandwidth_limit < $node->node_bandwidth) {
$users = null;
$res = [
'ret' => 1,
'data' => $users
];
return $this->echoJson($response, $res);
}
if (in_array($node->sort, [0, 10]) && $node->mu_only != -1) {
$mu_port_migration = Config::get('mu_port_migration');
} else {
$mu_port_migration = 'false';
}
/*
* 1. 请不要把管理员作为单端口承载用户
* 2. 请不要把真实用户作为单端口承载用户
*/
$users_raw = User::where(
static function ($query) use ($node, $mu_port_migration) {
if ($mu_port_migration == 'true') {
$query->where(
static function ($query1) use ($node) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group);
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group)
->where('is_multi_user', '=', 0)
->where('is_admin', 0);
} else {
$query1->where('class', '>=', $node->node_class)
->where('is_multi_user', '=', 0)
->where('is_admin', 0);
}
}
);
} else {
$query->where(
static function ($query1) use ($node) {
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group);
} else {
$query1->where('class', '>=', $node->node_class);
}
}
)->orwhere('is_admin', 1);
}
)
->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
} else {
$users_raw = User::where(
}
)->where('enable', 1)->where("detect_ban", 0)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
// 单端口承载用户
if ($mu_port_migration == 'true') {
$mu_users_raw = User::where(
static function ($query) use ($node) {
$query->where(
static function ($query1) use ($node) {
$query1->where('class', '>=', $node->node_class);
if ($node->node_group != 0) {
$query1->where('class', '>=', $node->node_class)
->where('node_group', '=', $node->node_group)
->where('is_multi_user', '>', 0);
} else {
$query1->where('class', '>=', $node->node_class)
->where('is_multi_user', '>', 0);
}
}
)->orwhere('is_admin', 1);
}
)->where('enable', 1)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
}
if (($node->node_bandwidth_limit != 0) && $node->node_bandwidth_limit < $node->node_bandwidth) {
$users = null;
$res = [
'ret' => 1,
'data' => $users
];
return $this->echoJson($response, $res);
)->where('enable', 1)->where("detect_ban", 0)->where('expire_in', '>', date('Y-m-d H:i:s'))->get();
$muPort = Tools::get_MuOutPortArray($node->server);
if ($muPort['type'] == 0) {
foreach ($mu_users_raw as $user_raw) {
if ($user_raw->is_multi_user != 0 && in_array($user_raw->port, array_keys($muPort['port']))) {
$user_raw->port = $muPort['port'][$user_raw->port];
}
$users_raw[] = $user_raw;
}
} else {
foreach ($mu_users_raw as $user_raw) {
if ($user_raw->is_multi_user != 0) {
$user_raw->port = ($user_raw->port + $muPort['type']);
}
$users_raw[] = $user_raw;
}
}
}
$users = array();
$key_list = array('email', 'method', 'obfs', 'obfs_param', 'protocol', 'protocol_param',
'forbidden_ip', 'forbidden_port', 'node_speedlimit', 'disconnect_ip',
'is_multi_user', 'id', 'port', 'passwd', 'u', 'd');
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
$users[] = $user_raw;
$users = array();
if (Config::get('keep_connect') == 'true') {
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
$users[] = $user_raw;
} else {
// 流量耗尽用户限速至 1Mbps
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
$user_raw->node_speedlimit = 1;
$users[] = $user_raw;
}
}
} else {
foreach ($users_raw as $user_raw) {
if ($user_raw->transfer_enable > $user_raw->u + $user_raw->d) {
$user_raw = Tools::keyFilter($user_raw, $key_list);
$user_raw->uuid = $user_raw->getUuid();
$users[] = $user_raw;
}
}
}
@ -222,18 +298,49 @@ class UserController extends BaseController
return $this->echoJson($response, $res);
}
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
if (Config::get('enable_auto_detect_ban') == 'true') {
$detect_Users = array();
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
$User = User::find($user_id);
if ($User == null) {
continue;
}
if (!in_array($user_id, $detect_Users)) {
$detect_Users[] = $user_id;
}
$User->all_detect_number++;
$User->save();
}
}
if (count($detect_Users) > 0) {
self::DetectBan($detect_Users);
}
} else {
if (count($data) > 0) {
foreach ($data as $log) {
$list_id = $log['list_id'];
$user_id = $log['user_id'];
// log
$detect_log = new DetectLog();
$detect_log->user_id = $user_id;
$detect_log->list_id = $list_id;
$detect_log->node_id = $node_id;
$detect_log->datetime = time();
$detect_log->save();
}
}
}
@ -243,4 +350,74 @@ class UserController extends BaseController
];
return $this->echoJson($response, $res);
}
public function DetectBan($detect_Users)
{
foreach ($detect_Users as $user_id) {
$User = User::find($user_id);
if ($User == null) {
continue;
}
if ($User->detect_ban == 1 || ($User->is_admin && Config::get('auto_detect_ban_allow_admin') == 'true') || in_array($User->id, Config::get('auto_detect_ban_allow_users'))) {
continue;
}
if (Config::get('auto_detect_ban_type') == '1') {
$last_DetectBanLog = DetectBanLog::where('user_id', $user_id)->orderBy("id", "desc")->first();
$last_all_detect_number = (
$last_DetectBanLog == null
? 0
: (int) $last_DetectBanLog->all_detect_number
);
$detect_number = ($User->all_detect_number - $last_all_detect_number);
if ($detect_number >= Config::get('auto_detect_ban_number')) {
$last_detect_ban_time = $User->last_detect_ban_time;
$end_time = date('Y-m-d H:i:s');
$User->detect_ban = 1;
$User->last_detect_ban_time = $end_time;
$User->save();
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $User->user_name;
$DetectBanLog->user_id = $User->id;
$DetectBanLog->email = $User->email;
$DetectBanLog->detect_number = $detect_number;
$DetectBanLog->ban_time = Config::get('auto_detect_ban_time');
$DetectBanLog->start_time = strtotime($last_detect_ban_time);
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $User->all_detect_number;
$DetectBanLog->save();
}
} else {
$number = $User->all_detect_number;
$tmp = 0;
foreach (Config::get('auto_detect_ban') as $key => $value) {
if ($number >= $key) {
if ($key >= $tmp) {
$tmp = $key;
}
}
}
if ($tmp != 0) {
if (Config::get('auto_detect_ban')[$tmp]['type'] == 'kill') {
$User->kill_user();
} else {
$last_detect_ban_time = $User->last_detect_ban_time;
$end_time = date('Y-m-d H:i:s');
$User->detect_ban = 1;
$User->last_detect_ban_time = $end_time;
$User->save();
$DetectBanLog = new DetectBanLog();
$DetectBanLog->user_name = $User->user_name;
$DetectBanLog->user_id = $User->id;
$DetectBanLog->email = $User->email;
$DetectBanLog->detect_number = $number;
$DetectBanLog->ban_time = Config::get('auto_detect_ban')[$tmp]['time'];
$DetectBanLog->start_time = strtotime('1989-06-04 00:05:00');
$DetectBanLog->end_time = strtotime($end_time);
$DetectBanLog->all_detect_number = $number;
$DetectBanLog->save();
}
}
}
}
}
}

@ -37,6 +37,7 @@ use App\Models\BlockIp;
use App\Models\UnblockIp;
use App\Models\Payback;
use App\Models\Relay;
use App\Models\UserSubscribeLog;
use App\Utils\QQWry;
use App\Utils\GA;
use App\Utils\Geetest;
@ -475,19 +476,19 @@ class UserController extends BaseController
}
$array_node = array();
$array_node['id']=$node->id;
$array_node['class']=$node->node_class;
$array_node['name']=$node->name;
$array_node['id'] = $node->id;
$array_node['class'] = $node->node_class;
$array_node['name'] = $node->name;
if ($node->sort == 13) {
$server = Tools::ssv2Array($node->server);
$array_node['server'] = $server['add'];
} else {
$array_node['server'] = $node->server;
}
$array_node['sort']=$node->sort;
$array_node['info']=$node->info;
$array_node['mu_only']=$node->mu_only;
$array_node['group']=$node->node_group;
$array_node['sort'] = $node->sort;
$array_node['info'] = $node->info;
$array_node['mu_only'] = $node->mu_only;
$array_node['group'] = $node->node_group;
$array_node['raw_node'] = $node;
$regex = Config::get('flag_regex');
@ -501,7 +502,7 @@ class UserController extends BaseController
$sort = $array_node['sort'];
$array_node['online_user'] = 0;
foreach ($onlineLogs as $log) {
if ($log['node_id'] != $node->id) {
continue;
@ -513,12 +514,12 @@ class UserController extends BaseController
}
break;
}
// check node status
// check node status
// 0: new node; -1: offline; 1: online
$node_heartbeat = $node->node_heartbeat + 300;
$array_node['online'] = -1;
if (!in_array($sort, array(0, 7, 8, 10, 11, 12, 13)) || $node_heartbeat == 300 ) {
if (!in_array($sort, array(0, 7, 8, 10, 11, 12, 13)) || $node_heartbeat == 300) {
$array_node['online'] = 0;
} elseif ($node_heartbeat > time()) {
$array_node['online'] = 1;
@ -532,8 +533,8 @@ class UserController extends BaseController
}
}
$array_node['traffic_used'] = (int)Tools::flowToGB($node->node_bandwidth);
$array_node['traffic_limit'] = (int)Tools::flowToGB($node->node_bandwidth_limit);
$array_node['traffic_used'] = (int) Tools::flowToGB($node->node_bandwidth);
$array_node['traffic_limit'] = (int) Tools::flowToGB($node->node_bandwidth_limit);
if ($node->node_speedlimit == 0.0) {
$array_node['bandwidth'] = 0;
} elseif ($node->node_speedlimit >= 1024.00) {
@ -555,7 +556,7 @@ class UserController extends BaseController
->assign('user', $user)
->registerClass('URL', URL::class)
->display('user/node.tpl');
}
}
public function node_old($request, $response, $args)
@ -571,7 +572,7 @@ class UserController extends BaseController
$node_prefix = array();
$node_flag_file = array();
$node_method = array();
$a = 0;//命名的什么JB变量
$a = 0; //命名的什么JB变量
$node_order = array();
$node_alive = array();
$node_prealive = array();
@ -627,9 +628,9 @@ class UserController extends BaseController
}
if ($node->node_bandwidth_limit == 0) {
$node_bandwidth[$name_cheif] = (int)($node->node_bandwidth / 1024 / 1024 / 1024) . ' GB 已用';
$node_bandwidth[$name_cheif] = (int) ($node->node_bandwidth / 1024 / 1024 / 1024) . ' GB 已用';
} else {
$node_bandwidth[$name_cheif] = (int)($node->node_bandwidth / 1024 / 1024 / 1024) . ' GB / ' . (int)($node->node_bandwidth_limit / 1024 / 1024 / 1024) . ' GB - ' . $node->bandwidthlimit_resetday . ' 日重置';
$node_bandwidth[$name_cheif] = (int) ($node->node_bandwidth / 1024 / 1024 / 1024) . ' GB / ' . (int) ($node->node_bandwidth_limit / 1024 / 1024 / 1024) . ' GB - ' . $node->bandwidthlimit_resetday . ' 日重置';
}
if ($node_tempalive != '暂无数据') {
@ -648,7 +649,7 @@ class UserController extends BaseController
$nodeLoad = $node->getNodeLoad();
if (isset($nodeLoad[0]['load'])) {
$node_latestload[$name_cheif] = ((float)(explode(' ', $nodeLoad[0]['load']))[0]) * 100;
$node_latestload[$name_cheif] = ((float) (explode(' ', $nodeLoad[0]['load']))[0]) * 100;
} else {
$node_latestload[$name_cheif] = null;
}
@ -663,8 +664,8 @@ class UserController extends BaseController
}
}
}
$node_prefix = (object)$node_prefix;
$node_order = (object)$node_order;
$node_prefix = (object) $node_prefix;
$node_order = (object) $node_order;
$tools = new Tools();
return $this->view()->assign('relay_rules', $relay_rules)->assign('node_class', $node_class)->assign('node_isv6', $node_isv6)->assign('tools', $tools)->assign('node_method', $node_method)->assign('node_muport', $node_muport)->assign('node_bandwidth', $node_bandwidth)->assign('node_heartbeat', $node_heartbeat)->assign('node_prefix', $node_prefix)->assign('node_flag_file', $node_flag_file)->assign('node_prealive', $node_prealive)->assign('node_order', $node_order)->assign('user', $user)->assign('node_alive', $node_alive)->assign('node_latestload', $node_latestload)->registerClass('URL', URL::class)->display('user/node.tpl');
}
@ -751,11 +752,11 @@ class UserController extends BaseController
foreach ($totallogin as $single) {
//if(isset($useripcount[$single->userid]))
{
if (!isset($userloginip[$single->ip])) {
//$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location = $iplocation->getlocation($single->ip);
$userloginip[$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
if (!isset($userloginip[$single->ip])) {
//$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location = $iplocation->getlocation($single->ip);
$userloginip[$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
}
}
@ -764,16 +765,16 @@ class UserController extends BaseController
{
$single->ip = Tools::getRealIp($single->ip);
$is_node = Node::where('node_ip', $single->ip)->first();
if ($is_node) {
continue;
}
if ($is_node) {
continue;
}
if (!isset($userip[$single->ip])) {
//$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location = $iplocation->getlocation($single->ip);
$userip[$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
if (!isset($userip[$single->ip])) {
//$useripcount[$single->userid]=$useripcount[$single->userid]+1;
$location = $iplocation->getlocation($single->ip);
$userip[$single->ip] = iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
}
}
}
@ -1244,8 +1245,7 @@ class UserController extends BaseController
try {
Mail::send($to, $subject, 'news/warn.tpl', [
'user' => $user, 'text' => $text
], [
]);
], []);
} catch (Exception $e) {
echo $e->getMessage();
}
@ -1261,11 +1261,11 @@ class UserController extends BaseController
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
$context = stream_context_create($opts);
file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
}
@ -1311,8 +1311,7 @@ class UserController extends BaseController
try {
Mail::send($to, $subject, 'news/warn.tpl', [
'user' => $user, 'text' => $text
], [
]);
], []);
} catch (Exception $e) {
echo $e->getMessage();
}
@ -1327,11 +1326,11 @@ class UserController extends BaseController
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
$context = stream_context_create($opts);
file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
$useScFtqq = Config::get('ScFtqq_SCKEY');
@ -1346,8 +1345,7 @@ class UserController extends BaseController
try {
Mail::send($to, $subject, 'news/warn.tpl', [
'user' => $user, 'text' => $text
], [
]);
], []);
} catch (Exception $e) {
echo $e->getMessage();
}
@ -1362,11 +1360,11 @@ class UserController extends BaseController
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
));
$context = stream_context_create($opts);
file_get_contents('https://sc.ftqq.com/' . $ScFtqq_SCKEY . '.send', false, $context);
}
@ -1886,24 +1884,85 @@ class UserController extends BaseController
$return = '';
switch ($type) {
case 'ss':
$return .= URL::getAllUrl($user, 0, 1).PHP_EOL;
break;
$return .= URL::getAllUrl($user, 0, 1) . PHP_EOL;
break;
case 'ssr':
$return .= URL::getAllUrl($user, 0, 0).PHP_EOL;
break;
$return .= URL::getAllUrl($user, 0, 0) . PHP_EOL;
break;
case 'ssd':
$return .= URL::getAllSSDUrl($user).PHP_EOL;
break;
$return .= URL::getAllSSDUrl($user) . PHP_EOL;
break;
case 'v2ray':
$return .= URL::getAllVMessUrl($user).PHP_EOL;
break;
$return .= URL::getAllVMessUrl($user) . PHP_EOL;
break;
default:
$return .= '悟空别闹!';
break;
break;
}
$newResponse = $response->withHeader('Content-type', ' application/octet-stream; charset=utf-8')->withHeader('Cache-Control', 'no-store, no-cache, must-revalidate')->withHeader('Content-Disposition', ' attachment; filename=node.txt');
$newResponse->getBody()->write($return);
return $newResponse;
}
public function subscribe_log($request, $response, $args)
{
$pageNum = $request->getQueryParams()['page'] ?? 1;
$logs = UserSubscribeLog::orderBy('id', 'desc')->where('user_id', $this->user->id)->paginate(15, ['*'], 'page', $pageNum);
$logs->setPath('/user/subscribe_log');
$iplocation = new QQWry();
return $this->view()->assign('logs', $logs)->assign('iplocation', $iplocation)->display('user/subscribe_log.tpl');
}
public function getPcClient($request, $response, $args)
{
$zipArc = new \ZipArchive();
$user_token = LinkController::GenerateSSRSubCode($this->user->id, 0);
$type = trim($request->getQueryParams()['type']);
// 临时文件存放路径
$temp_file_path = '../storage/';
// 客户端文件存放路径
$client_path = '../resources/clients/';
switch ($type) {
case 'ss-win':
$temp_file_path .= $type . '_' . $user_token . '.zip';
$user_config_file_name = 'gui-config.json';
$content = LinkController::getSSPcConf($this->user);
$client_path .= $type . '/';
break;
case 'ssd-win':
$temp_file_path .= $type . '_' . $user_token . '.zip';
$user_config_file_name = 'gui-config.json';
$content = LinkController::getSSDPcConf($this->user);
$client_path .= $type . '/';
break;
case 'ssr-win':
$temp_file_path .= $type . '_' . $user_token . '.zip';
$user_config_file_name = 'gui-config.json';
$content = LinkController::getSSRPcConf($this->user);
$client_path .= $type . '/';
break;
default:
return 'gg';
}
// 文件存在则先删除
if (is_file($temp_file_path)) {
unlink($temp_file_path);
}
// 超链接文件内容
$site_url_content = '[InternetShortcut]' . PHP_EOL . 'URL=' . Config::get('baseUrl');
// 创建 zip 并添加内容
$zipArc->open($temp_file_path, \ZipArchive::CREATE);
$zipArc->addFromString($user_config_file_name, $content);
$zipArc->addFromString('点击访问_' . Config::get('appName') . '.url', $site_url_content);
Tools::folderToZip($client_path, $zipArc, strlen($client_path));
$zipArc->close();
$newResponse = $response->withHeader('Content-type', ' application/octet-stream')->withHeader('Content-Disposition', ' attachment; filename=' . $type . '.zip');
$newResponse->getBody()->write(file_get_contents($temp_file_path));
unlink($temp_file_path);
return $newResponse;
}
}

@ -0,0 +1,9 @@
<?php
namespace App\Models;
class DetectBanLog extends Model
{
protected $connection = "default";
protected $table = "detect_ban_log";
}

@ -13,6 +13,8 @@ use App\Utils\GA;
use App\Utils\QQWry;
use App\Utils\Radius;
use Ramsey\Uuid\Uuid;
use App\Models\DetectLog;
use App\Models\DetectBanLog;
class User extends Model
{
@ -37,8 +39,8 @@ class User extends Model
public function getGravatarAttribute()
{
// $hash = md5(strtolower(trim($this->attributes['email'])));
return '/images/Avatar.jpg';//.$hash;
$hash = md5(strtolower(trim($this->attributes['email'])));
return 'https://gravatar.loli.net/avatar/' . $hash;
}
public function isAdmin()
@ -56,7 +58,11 @@ class User extends Model
public function getMuMd5()
{
$str = str_replace(array('%id', '%suffix'), array($this->attributes['id'], Config::get('mu_suffix')), Config::get('mu_regex'));
$str = str_replace(
array('%id', '%suffix'),
array($this->attributes['id'], Config::get('mu_suffix')),
Config::get('mu_regex')
);
preg_match_all("|%-?[1-9]\d*m|U", $str, $matches, PREG_PATTERN_ORDER);
foreach ($matches[0] as $key) {
$key_match = str_replace(array('%', 'm'), '', $key);
@ -128,7 +134,10 @@ class User extends Model
public function getUuid()
{
return Uuid::uuid3(Uuid::NAMESPACE_DNS, $this->attributes['id'] . '|' . $this->attributes['passwd'])->toString();
return Uuid::uuid3(
Uuid::NAMESPACE_DNS,
$this->attributes['id'] . '|' . $this->attributes['passwd']
)->toString();
}
public function trafficUsagePercent()
@ -199,7 +208,10 @@ class User extends Model
public function getGAurl()
{
$ga = new GA();
$url = $ga->getUrl(urlencode(Config::get('appName') . '-' . $this->attributes['user_name'] . '-两步验证码'), $this->attributes['ga_token']);
$url = $ga->getUrl(
urlencode(Config::get('appName') . '-' . $this->attributes['user_name'] . '-两步验证码'),
$this->attributes['ga_token']
);
return $url;
}
@ -320,22 +332,39 @@ class User extends Model
$location = $iplocation->getlocation($reg_location);
$reg_location .= "\n" . iconv('gbk', 'utf-8//IGNORE', $location['country'] . $location['area']);
$return_array = array('DT_RowId' => 'row_1_' . $id, $id, $id,
$this->attributes['user_name'], $this->attributes['remark'],
$this->attributes['email'], $this->attributes['money'],
$im_type, $im_value,
$this->attributes['node_group'], $account_expire_in,
$this->attributes['class'], $class_expire_in,
$this->attributes['passwd'], $this->attributes['port'],
$return_array = array(
'DT_RowId' => 'row_1_' . $id,
$id,
$id,
$this->attributes['user_name'],
$this->attributes['remark'],
$this->attributes['email'],
$this->attributes['money'],
$im_type,
$im_value,
$this->attributes['node_group'],
$account_expire_in,
$this->attributes['class'],
$class_expire_in,
$this->attributes['passwd'],
$this->attributes['port'],
$this->attributes['method'],
$this->attributes['protocol'], $this->attributes['obfs'],
$this->online_ip_count(), $this->lastSsTime(),
$used_traffic, $enable_traffic,
$this->lastCheckInTime(), $today_traffic,
$is_enable, $this->attributes['reg_date'],
$this->attributes['protocol'],
$this->attributes['obfs'],
$this->online_ip_count(),
$this->lastSsTime(),
$used_traffic,
$enable_traffic,
$this->lastCheckInTime(),
$today_traffic,
$is_enable,
$this->attributes['reg_date'],
$reg_location,
$this->attributes['auto_reset_day'], $this->attributes['auto_reset_bandwidth'],
$ref_user_id, $ref_user_name);
$this->attributes['auto_reset_day'],
$this->attributes['auto_reset_bandwidth'],
$ref_user_id,
$ref_user_name
);
return $return_array;
}
@ -353,4 +382,75 @@ class User extends Model
}
return round($top_up, 2);
}
// 最后一次被封禁的时间
public function last_detect_ban_time()
{
return ($this->attributes['last_detect_ban_time'] == '1989-06-04 00:05:00'
? '未被封禁过'
: $this->attributes['last_detect_ban_time']
);
}
// 当前解封时间
public function relieve_time()
{
if ($this->attributes['detect_ban'] == 1) {
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->orderBy("id", "desc")->first();
$time = ($logs->end_time + $logs->ban_time * 60);
return date('Y-m-d H:i:s', $time);
} else {
return '当前未被封禁';
}
}
// 累计被封禁的次数
public function detect_ban_number()
{
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->get();
return count($logs);
}
// 最后一次封禁的违规次数
public function user_detect_ban_number()
{
$logs = DetectBanLog::where('user_id', $this->attributes['id'])->orderBy("id", "desc")->first();
return $logs->detect_number;
}
public function yesterdayIncome()
{
return Code::where('usedatetime', 'like', date('Y-m-d%', strtotime('-1 days')))->sum(number);
}
public function todayIncome()
{
return Code::where('usedatetime', 'like', date('Y-m-d%'))->sum(number);
}
public function thisMonthIncome()
{
return Code::where('usedatetime', 'like', date('Y-m%'))->sum(number);
}
public function lastMonthIncome()
{
return Code::where('usedatetime', 'like', date('Y-m%', strtotime('-1 months')))->sum(number);
}
public function totalIncome()
{
return Code::where('usedatetime', 'like', date('%'))->sum(number);
}
public function paidUserCount()
{
return self::where('class', '!=', '0')->count();
}
public function disableReason()
{
$reason_id = DetectLog::where('user_id', '=', $this->attributes['id'])->orderBy('id', 'DESC')->first();
$reason = DetectRule::where('id', '=', $reason_id->list_id)->get();
return $reason[0]->text;
}
}

@ -0,0 +1,554 @@
<?php
namespace App\Services;
class AppsProfiles
{
/**
* Surge 策略组配置
*
* @return array
*/
public static function Surge()
{
$Apps_Profiles = [
'lhie1' => [
'Checks' => ['🇭🇰 香港', '🇯🇵 日本', '🇸🇬 坡坡', '🇨🇳 台湾', '🇺🇸 美国', '🇰🇷 韩国', '🇨🇳 中继'],
'ProxyGroup' => [
[
'name' => '🍃 Proxy',
'type' => 'select',
'content' => [
'left-proxies' => ['🇭🇰 香港', '🇯🇵 日本', '🇸🇬 坡坡', '🇨🇳 台湾', '🇺🇸 美国', '🇰🇷 韩国', '🇨🇳 中继', '🚀 Direct']
]
],
[
'name' => '🍂 Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🍃 Proxy', '🇨🇳 中继']
]
],
[
'name' => '🍎 Only',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🇭🇰 香港', '🇯🇵 日本', '🇸🇬 坡坡', '🇨🇳 台湾', '🇺🇸 美国', '🇰🇷 韩国', '🇨🇳 中继']
]
],
[
'name' => '☁️ Others',
'type' => 'select',
'content' => [
'left-proxies' => ['🍃 Proxy', '🍂 Domestic']
]
],
[
'name' => '🇭🇰 香港',
'type' => 'select',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇯🇵 日本',
'type' => 'select',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇸🇬 坡坡',
'type' => 'select',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇨🇳 台湾',
'type' => 'select',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇺🇸 美国',
'type' => 'select',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇰🇷 韩国',
'type' => 'select',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇨🇳 中继',
'type' => 'select',
'content' => [
'regex' => '(中继|中转|中国|回国|China)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
]
]
],
'123456' => [
'Checks' => [],
'ProxyGroup' => [
[
'name' => '🍃 Proxy',
'type' => 'select',
'content' => [
'regex' => '(.*)'
]
],
[
'name' => '🍂 Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🍃 Proxy']
]
],
[
'name' => '🍎 Only',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🍃 Proxy']
]
],
[
'name' => '☁️ Others',
'type' => 'select',
'content' => [
'left-proxies' => ['🍃 Proxy', '🍂 Domestic']
]
]
]
]
];
return $Apps_Profiles;
}
/**
* Surfboard 策略组配置
*
* @return array
*/
public static function Surfboard()
{
$Apps_Profiles = [
'lhie1' => [
'Checks' => ['🇭🇰 香港', '🇯🇵 日本', '🇸🇬 坡坡', '🇨🇳 台湾', '🇺🇸 美国', '🇰🇷 韩国', '🇨🇳 中继'],
'ProxyGroup' => [
[
'name' => '🍃 Proxy',
'type' => 'select',
'content' => [
'left-proxies' => ['🇭🇰 香港', '🇯🇵 日本', '🇸🇬 坡坡', '🇨🇳 台湾', '🇺🇸 美国', '🇰🇷 韩国', '🇨🇳 中继', '🚀 Direct']
]
],
[
'name' => '🍂 Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🍃 Proxy', '🇨🇳 中继']
]
],
[
'name' => '☁️ Others',
'type' => 'select',
'content' => [
'left-proxies' => ['🍃 Proxy', '🍂 Domestic']
]
],
[
'name' => '🇭🇰 香港',
'type' => 'select',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇯🇵 日本',
'type' => 'select',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇸🇬 坡坡',
'type' => 'select',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇨🇳 台湾',
'type' => 'select',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇺🇸 美国',
'type' => 'select',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇰🇷 韩国',
'type' => 'select',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '🇨🇳 中继',
'type' => 'select',
'content' => [
'regex' => '(中继|中转|中国|回国|China)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
]
]
],
'123456' => [
'Checks' => [],
'ProxyGroup' => [
[
'name' => '🍃 Proxy',
'type' => 'select',
'content' => [
'regex' => '(.*)'
]
],
[
'name' => '🍂 Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['🚀 Direct', '🍃 Proxy']
]
],
[
'name' => '☁️ Others',
'type' => 'select',
'content' => [
'left-proxies' => ['🍃 Proxy', '🍂 Domestic']
]
]
]
]
];
return $Apps_Profiles;
}
/**
* Clash 策略组配置
*
* @return array
*/
public static function Clash()
{
$Apps_Profiles = [
'lhie1' => [
'Checks' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继'],
'ProxyGroup' => [
[
'name' => '香港',
'type' => 'url-test',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '日本',
'type' => 'url-test',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '坡坡',
'type' => 'url-test',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '美国',
'type' => 'url-test',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '台湾',
'type' => 'url-test',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '韩国',
'type' => 'url-test',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '中继',
'type' => 'url-test',
'content' => [
'regex' => '(中继|中转|中国|回国|China)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => 'Proxy',
'type' => 'select',
'content' => [
'left-proxies' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'Proxy', '中继']
]
],
[
'name' => 'AsianTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Domestic', 'Proxy', '中继']
]
],
[
'name' => 'GlobalTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy', '香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Others',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy', 'Domestic']
]
]
]
],
'ConnersHua_Pro' => [
'Checks' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继'],
'ProxyGroup' => [
[
'name' => '香港',
'type' => 'url-test',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '日本',
'type' => 'url-test',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '坡坡',
'type' => 'url-test',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '美国',
'type' => 'url-test',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '台湾',
'type' => 'url-test',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '韩国',
'type' => 'url-test',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '中继',
'type' => 'url-test',
'content' => [
'regex' => '(中继|中转|中国|回国|China|CN)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => 'PROXY',
'type' => 'select',
'content' => [
'left-proxies' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Final',
'type' => 'select',
'content' => [
'left-proxies' => ['PROXY', 'DIRECT']
]
],
[
'name' => 'ForeignMedia',
'type' => 'select',
'content' => [
'left-proxies' => ['PROXY', '香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'DomesticMedia',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'PROXY', '中继']
]
],
[
'name' => 'Apple',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'PROXY']
]
],
[
'name' => 'Hijacking',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'REJECT']
]
]
]
],
'ConnersHua_BacktoCN' => [
'Checks' => [],
'ProxyGroup' => [
[
'name' => 'PROXY',
'type' => 'select',
'content' => [
'regex' => '(中继|中转|中国|回国|China)'
]
]
]
],
'123456' => [
'Checks' => [],
'ProxyGroup' => [
[
'name' => 'Proxy',
'type' => 'select',
'content' => [
'regex' => '(.*)'
]
],
[
'name' => 'Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'Proxy']
]
],
[
'name' => 'AsianTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Domestic', 'Proxy']
]
],
[
'name' => 'GlobalTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy']
]
],
[
'name' => 'Others',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy', 'Domestic']
]
]
]
]
];
return $Apps_Profiles;
}
}

@ -4,16 +4,10 @@ namespace App\Services;
class Config
{
// TODO: remove
public static function get($key)
{
global $System_Config;
return $System_Config[$key];
}
public static function set($key, $value)
{
global $System_Config;
$System_Config[$key] = $value;
return $_ENV[$key];
}
public static function getPublicConfig()
@ -53,7 +47,14 @@ class Config
'captcha_provider' => self::get('captcha_provider'),
'enable_email_verify' => self::get('enable_email_verify'),
'protocol_specify' => self::get('protocol_specify'),
'clash_Profiles' => self::get('clash_Profiles')
'subscribeLog' => self::get('subscribeLog'),
'subscribeLog_keep_days' => self::get('subscribeLog_keep_days'),
'enable_auto_detect_ban' => self::get('enable_auto_detect_ban'),
'auto_detect_ban_type' => self::get('auto_detect_ban_type'),
'auto_detect_ban_number' => self::get('auto_detect_ban_number'),
'auto_detect_ban_time' => self::get('auto_detect_ban_time'),
'auto_detect_ban' => self::get('auto_detect_ban'),
'subscribe_client' => self::get('subscribe_client')
];
}
@ -86,9 +87,8 @@ class Config
public static function getMuKey()
{
global $System_Config;
$muKeyList = array_key_exists('muKeyList', $System_Config) ? $System_Config['muKeyList'] : [' '];
return array_merge(explode(',', $System_Config['muKey']), $muKeyList);
$muKeyList = array_key_exists('muKeyList', $_ENV) ? $_ENV['muKeyList'] : [' '];
return array_merge(explode(',', $_ENV['muKey']), $muKeyList);
}
public static function getSupportParam($type)

@ -450,10 +450,9 @@ class Tools
if ($server[1] == '0' || $server[1] == '') {
$item['port'] = 443;
} else {
$item['port'] = (int)$server[1];
$item['port'] = (int) $server[1];
}
$item['aid'] = (int)$server[2];
$item['aid'] = (int) $server[2];
$item['net'] = 'tcp';
$item['type'] = 'none';
if (count($server) >= 4) {
@ -480,7 +479,7 @@ class Tools
unset($item['server']);
}
if (array_key_exists('outside_port', $item)) {
$item['port'] = (int)$item['outside_port'];
$item['port'] = (int) $item['outside_port'];
unset($item['outside_port']);
}
if (isset($item['inside_port'])) {
@ -509,7 +508,7 @@ class Tools
if ($server[1] == '0' || $server[1] == '') {
$item['port'] = 443;
} else {
$item['port'] = (int)$server[1];
$item['port'] = (int) $server[1];
}
if (count($server) >= 4) {
$item['net'] = $server[3];
@ -531,7 +530,7 @@ class Tools
unset($item['server']);
}
if (array_key_exists('outside_port', $item)) {
$item['port'] = (int)$item['outside_port'];
$item['port'] = (int) $item['outside_port'];
unset($item['outside_port']);
}
}
@ -568,4 +567,229 @@ class Tools
'port' => $node_port
];
}
public static function get_MuOutPortArray($server)
{
$type = 0; //偏移
$port = []; //指定
$node_server = explode(';', $server);
if (strpos($node_server[1], 'port') !== false) {
$item = URL::parse_args($node_server[1]);
if (strpos($item['port'], '#') !== false) {
if (strpos($item['port'], '+') !== false) {
$args_explode = explode('+', $item['port']);
foreach ($args_explode as $arg) {
$port[substr($arg, 0, strpos($arg, '#'))] = (int) substr($arg, strpos($arg, '#') + 1);
}
} else {
$port[substr($item['port'], 0, strpos($item['port'], '#'))] = (int) substr($item['port'], strpos($item['port'], '#') + 1);
}
} else {
$$type = (int) $item['port'];
}
}
return [
'type' => $type,
'port' => $port
];
}
// 请将冷门的国家或地区放置在上方,热门的中继起源放置在下方
// 以便于兼容如:【上海 -> 美国】等节点名称
private static $emoji = [
"🇦🇷" => [
"阿根廷"
],
"🇦🇹" => [
"奥地利",
"维也纳"
],
"🇦🇺" => [
"澳大利亚",
"悉尼"
],
"🇧🇷" => [
"巴西",
"圣保罗"
],
"🇨🇦" => [
"加拿大",
"蒙特利尔",
"温哥华"
],
"🇨🇭" => [
"瑞士",
"苏黎世"
],
"🇩🇪" => [
"德国",
"法兰克福"
],
"🇫🇮" => [
"芬兰",
"赫尔辛基"
],
"🇫🇷" => [
"法国",
"巴黎"
],
"🇬🇧" => [
"英国",
"伦敦"
],
"🇮🇩" => [
"印尼",
"印度尼西亚",
"雅加达"
],
"🇮🇪" => [
"爱尔兰",
"都柏林"
],
"🇮🇳" => [
"印度",
"孟买"
],
"🇮🇹" => [
"意大利",
"米兰"
],
"🇰🇵" => [
"朝鲜"
],
"🇲🇾" => [
"马来西亚"
],
"🇳🇱" => [
"荷兰",
"阿姆斯特丹"
],
"🇵🇭" => [
"菲律宾"
],
"🇷🇴" => [
"罗马尼亚"
],
"🇷🇺" => [
"俄罗斯",
"伯力",
"莫斯科",
"圣彼得堡",
"西伯利亚",
"新西伯利亚"
],
"🇸🇬" => [
"新加坡"
],
"🇹🇭" => [
"泰国",
"曼谷"
],
"🇹🇷" => [
"土耳其",
"伊斯坦布尔"
],
"🇺🇲" => [
"美国",
"波特兰",
"俄勒冈",
"凤凰城",
"费利蒙",
"硅谷",
"拉斯维加斯",
"洛杉矶",
"圣克拉拉",
"西雅图",
"芝加哥",
"沪美"
],
"🇻🇳" => [
"越南"
],
"🇿🇦" => [
"南非"
],
"🇰🇷" => [
"韩国",
"首尔"
],
"🇲🇴" => [
"澳门"
],
"🇯🇵" => [
"日本",
"东京",
"大阪",
"埼玉",
"沪日"
],
"🇹🇼" => [
"台湾",
"台北",
"台中"
],
"🇭🇰" => [
"香港",
"深港"
],
"🇨🇳" => [
"中国",
"江苏",
"北京",
"上海",
"深圳",
"杭州",
"徐州",
"宁波",
"镇江"
]
];
public static function addEmoji($Name)
{
$done = [
'index' => -1,
'emoji' => ''
];
foreach (self::$emoji as $key => $value) {
foreach ($value as $item) {
$index = strpos($Name, $item);
if ($index !== false) {
$done['index'] = $index;
$done['emoji'] = $key;
continue 2;
}
}
}
return ($done['index'] == -1
? $Name
: ($done['emoji'] . ' ' . $Name));
}
/**
* Add files and sub-directories in a folder to zip file.
* @param string $folder
* @param ZipArchive $zipFile
* @param int $exclusiveLength Number of text to be exclusived from the file path.
*/
public static function folderToZip($folder, &$zipFile, $exclusiveLength)
{
$handle = opendir($folder);
while (false !== $f = readdir($handle)) {
if ($f != '.' && $f != '..') {
$filePath = "$folder/$f";
// Remove prefix from file path before add to zip.
$localPath = substr($filePath, $exclusiveLength);
if (is_file($filePath)) {
$zipFile->addFile($filePath, $localPath);
} elseif (is_dir($filePath)) {
// Add sub-directory.
$zipFile->addEmptyDir($localPath);
self::folderToZip($filePath, $zipFile, $exclusiveLength);
}
}
}
closedir($handle);
}
}

@ -7,6 +7,7 @@ use App\Models\Node;
use App\Models\Relay;
use App\Services\Config;
use App\Controllers\LinkController;
use App\Controllers\ConfController;
class URL
{
@ -138,24 +139,13 @@ class URL
return $new_user;
}
public static function getAllItems(
$user,
$is_mu = 0,
$is_ss = 0,
$getV2rayPlugin = 1
) {
public static function getAllItems($user, $is_mu = 0, $is_ss = 0, $emoji = 0)
{
$return_array = array();
if ($user->is_admin) {
$nodes = Node::where(
static function ($query) use ($getV2rayPlugin) {
if ($getV2rayPlugin) {
$query->where('sort', 0)
->orwhere('sort', 10)
->orwhere('sort', 13);
} else {
$query->where('sort', 0)
->orwhere('sort', 10);
}
static function ($query) {
$query->where('sort', 0)->orwhere('sort', 10);
}
)
->where('type', '1')
@ -163,15 +153,8 @@ class URL
->get();
} else {
$nodes = Node::where(
static function ($query) use ($getV2rayPlugin) {
if ($getV2rayPlugin) {
$query->where('sort', 0)
->orwhere('sort', 10)
->orwhere('sort', 13);
} else {
$query->where('sort', 0)
->orwhere('sort', 10);
}
static function ($query) {
$query->where('sort', 0)->orwhere('sort', 10);
}
)
->where(
@ -220,12 +203,12 @@ class URL
if (($relay_rule != null) && $relay_rule->dist_node() != null) {
$relay_rule_id = $relay_rule->id;
}
$item = self::getItem($user, $node, 0, $relay_rule_id, $is_ss);
$item = self::getItem($user, $node, 0, $relay_rule_id, $is_ss, $emoji);
if ($item != null) {
$return_array[] = $item;
}
} else {
$item = self::getItem($user, $node, 0, 0, $is_ss);
$item = self::getItem($user, $node, 0, 0, $is_ss, $emoji);
if ($item != null) {
$return_array[] = $item;
}
@ -239,12 +222,12 @@ class URL
if (($relay_rule != null) && $relay_rule->dist_node() != null) {
$relay_rule_id = $relay_rule->id;
}
$item = self::getItem($user, $node, $mu_node->server, $relay_rule_id, $is_ss);
$item = self::getItem($user, $node, $mu_node->server, $relay_rule_id, $is_ss, $emoji);
if ($item != null) {
$return_array[] = $item;
}
} else {
$item = self::getItem($user, $node, $mu_node->server, 0, $is_ss);
$item = self::getItem($user, $node, $mu_node->server, 0, $is_ss, $emoji);
if ($item != null) {
$return_array[] = $item;
}
@ -252,6 +235,7 @@ class URL
}
}
}
return $return_array;
}
@ -261,12 +245,12 @@ class URL
if (strtotime($user->expire_in) < time()) {
return $return_url;
}
$items = self::getAllItems($user, $is_mu, $is_ss, $getV2rayPlugin);
$items = self::getAllItems($user, $is_mu, $is_ss);
foreach ($items as $item) {
$return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
$is_mu = $is_mu == 0 ? 1 : 0;
$items = self::getAllItems($user, $is_mu, $is_ss, $getV2rayPlugin);
$items = self::getAllItems($user, $is_mu, $is_ss);
foreach ($items as $item) {
$return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
@ -274,6 +258,51 @@ class URL
return $return_url;
}
/**
* 获取全部节点 Url
*
* @param object $user 用户
* @param int $is_ss 是否 ss
* @param int $getV2rayPlugin 是否获取 V2rayPlugin 节点
* @param array $Rule 节点筛选规则
* @param bool $find 是否筛选节点
*
* @return string
*/
public static function get_NewAllUrl($user, $is_ss, $getV2rayPlugin, $Rule, $find, $emoji = 0)
{
$return_url = '';
if (strtotime($user->expire_in) < time()) {
return $return_url;
}
if ($getV2rayPlugin === 0) {
$items = array_merge(
self::getAllItems($user, 0, $is_ss, $emoji),
self::getAllItems($user, 1, $is_ss, $emoji)
);
} else {
$items = array_merge(
self::getAllItems($user, 0, $is_ss, $emoji),
self::getAllItems($user, 1, $is_ss, $emoji),
self::getAllV2RayPluginItems($user, $emoji)
);
}
if ($find) {
foreach ($items as $item) {
$item = ConfController::getMatchProxy($item, $Rule);
if ($item !== null) {
$return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
}
} else {
foreach ($items as $item) {
$return_url .= self::getItemUrl($item, $is_ss) . PHP_EOL;
}
}
return $return_url;
}
public static function getItemUrl($item, $is_ss)
{
$ss_obfs_list = Config::getSupportParam('ss_obfs');
@ -297,7 +326,9 @@ class URL
if ($is_ss == 2) {
$personal_info = $item['method'] . ':' . $item['passwd'] . '@' . $item['address'] . ':' . $item['port'];
$ssurl = 'ss://' . Tools::base64_url_encode($personal_info);
$ssurl .= '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark']);
$ssurl .= (Config::get('add_appName_to_ss_uri') == 'true'
? '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark'])
: '#' . rawurlencode($item['remark']));
} else {
$personal_info = $item['method'] . ':' . $item['passwd'];
$ssurl = 'ss://' . Tools::base64_url_encode($personal_info) . '@' . $item['address'] . ':' . $item['port'];
@ -313,20 +344,100 @@ class URL
if ($item['obfs_param'] != '' && $item['obfs'] != 'v2ray') {
$plugin .= ';obfs-host=' . $item['obfs_param'];
}
$ssurl .= '?plugin=' . rawurlencode($plugin);
$ssurl .= '/?plugin=' . rawurlencode($plugin) . '&group=' . Tools::base64_url_encode(Config::get('appName'));
} else {
$ssurl .= '/?group=' . Tools::base64_url_encode(Config::get('appName'));
}
$ssurl .= '#' . rawurlencode(
Config::get('appName') . ' - ' . $item['remark']
);
$ssurl .= (Config::get('add_appName_to_ss_uri') == 'true'
? '#' . rawurlencode(Config::get('appName') . ' - ' . $item['remark'])
: '#' . rawurlencode($item['remark']));
}
return $ssurl;
}
public static function getV2Url($user, $node, $arrout = 0)
/**
* 获取 V2RayPlugin 全部节点
*
* @param object $user 用户
*
* @return array
*/
public static function getAllV2RayPluginItems($user, $emoji = 0)
{
$return_array = array();
if ($user->is_admin) {
$nodes = Node::where('sort', 13)
->where('type', '1')
->orderBy('name')
->get();
} else {
$nodes = Node::where('sort', 13)
->where(
static function ($query) use ($user) {
$query->where('node_group', '=', $user->node_group)
->orWhere('node_group', '=', 0);
}
)
->where('type', '1')
->where('node_class', '<=', $user->class)
->orderBy('name')
->get();
}
foreach ($nodes as $node) {
$item = self::getV2RayPluginItem($user, $node, $emoji);
if ($item != null) {
$return_array[] = $item;
}
}
return $return_array;
}
/**
* 获取 V2RayPlugin 节点
*
* @param object $user 用户
* @param object $node 节点
*
* @return array
*/
public static function getV2RayPluginItem($user, $node, $emoji = 0)
{
// 非 AEAD 加密无法使用
if (!in_array($user->method, Config::getSupportParam('ss_aead_method'))) {
return null;
}
$return_array = Tools::ssv2Array($node->server);
$return_array['remark'] = ($emoji == 1
? Tools::addEmoji($node->name)
: $node->name);
$return_array['address'] = $return_array['add'];
$return_array['method'] = $user->method;
$return_array['passwd'] = $user->passwd;
$return_array['protocol'] = 'origin';
$return_array['protocol_param'] = '';
$return_array['obfs'] = 'v2ray';
if ($return_array['tls'] == 'tls' && $return_array['net'] == 'ws') {
$return_array['obfs_param'] = ('mode=ws;security=tls;path=' . $return_array['path'] .
';host=' . $return_array['host']);
} else {
$return_array['obfs_param'] = ('mode=ws;security=none;path=' . $return_array['path'] .
';host=' . $return_array['host']);
}
$return_array['path'] = ($return_array['path'] . '?redirect=' . $user->getMuMd5());
$return_array['class'] = $node->node_class;
$return_array['group'] = Config::get('appName');
return $return_array;
}
public static function getV2Url($user, $node, $arrout = 0, $emoji = 0)
{
$item = Tools::v2Array($node->server);
$item['v'] = '2';
$item['ps'] = $node->name;
$item['ps'] = ($emoji == 1
? Tools::addEmoji($node->name)
: $node->name);
$item['id'] = $user->getUuid();
$item['class'] = $node->node_class;
if ($arrout == 0) {
@ -338,7 +449,7 @@ class URL
return $item;
}
public static function getAllVMessUrl($user, $arrout = 0)
public static function getAllVMessUrl($user, $arrout = 0, $emoji = 0)
{
if ($user->is_admin) {
$nodes = Node::where(
@ -370,12 +481,12 @@ class URL
if ($arrout == 0) {
$result = '';
foreach ($nodes as $node) {
$result .= (self::getV2Url($user, $node, $arrout) . "\n");
$result .= (self::getV2Url($user, $node, $arrout, $emoji) . "\n");
}
} else {
$result = [];
foreach ($nodes as $node) {
$result[] = self::getV2Url($user, $node, $arrout);
$result[] = self::getV2Url($user, $node, $arrout, $emoji);
}
}
return $result;
@ -457,9 +568,11 @@ class URL
$array_server[] = $server;
$server_index++;
continue;
} else {
$node_server = explode(';', $node->server);
$server['server'] = $node_server[0];
}
$server['id'] = $server_index;
$server['server'] = $node->server;
//判断是否是中转起源节点
$relay_rule = Relay::where('source_node_id', $node->id)->where(
static function ($query) use ($user) {
@ -502,6 +615,12 @@ class URL
$server['id'] = $server_index;
$server['remarks'] = $node->name . ' - 单多' . $node_muport->server . '端口';
$server['port'] = $node_muport->server;
// 端口偏移
if (strpos($node->server, ';') !== false) {
$node_tmp = Tools::OutPort($node->server, $node->name, $node_muport->server);
$server['port'] = $node_tmp['port'];
$server['remarks'] = $node->name . ' - 单多' . $node_tmp['port'] . '端口';
}
$server['encryption'] = $muport_user->method;
$server['password'] = $muport_user->passwd;
$server['plugin'] = 'simple-obfs'; //目前只支持这个
@ -573,7 +692,7 @@ class URL
* obfs
* obfs_param
*/
public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0)
public static function getItem($user, $node, $mu_port = 0, $relay_rule_id = 0, $is_ss = 0, $emoji = 0)
{
$relay_rule = Relay::where('id', $relay_rule_id)->where(
static function ($query) use ($user) {
@ -585,7 +704,7 @@ class URL
if ($relay_rule != null) {
$node_name .= ' - ' . $relay_rule->dist_node()->name;
}
if ($mu_port != 0 && $node->sort != 13) {
if ($mu_port != 0) {
$mu_user = User::where('port', '=', $mu_port)->where('is_multi_user', '<>', 0)->first();
if ($mu_user == null) {
return;
@ -606,41 +725,31 @@ class URL
}
$user = self::getSSRConnectInfo($user);
}
if ($node->sort == 13) {
$return_array = Tools::ssv2Array($node->server);
$return_array['address'] = $return_array['add'];
$return_array['protocol'] = 'origin';
$return_array['protocol_param'] = '';
$return_array['obfs'] = 'v2ray';
$return_array['path'] = ($return_array['path'] . '?redirect=' . $user->getMuMd5());
if ($return_array['tls'] == 'tls' && $return_array['net'] == 'ws') {
$return_array['obfs_param'] = ('mode=ws;security=tls;path=' . $return_array['path'] .
';host=' . $return_array['host']);
} else {
$return_array['obfs_param'] = ('mode=ws;security=none;path=' . $return_array['path'] .
';host=' . $return_array['host']);
}
} else {
$return_array['address'] = $node->server;
$return_array['port'] = $user->port;
$return_array['protocol'] = $user->protocol;
$return_array['protocol_param'] = $user->protocol_param;
$return_array['obfs'] = $user->obfs;
$return_array['obfs_param'] = $user->obfs_param;
if (strpos($node->server, ';') !== false) {
$node_tmp = Tools::OutPort($node->server, $node->name, $mu_port);
if ($mu_port != 0) {
$return_array['port'] = $node_tmp['port'];
$node_name = $node_tmp['name'];
}
$return_array['address'] = $node_tmp['address'];
$return_array['address'] = $node->server;
$return_array['port'] = $user->port;
$return_array['protocol'] = $user->protocol;
$return_array['protocol_param'] = $user->protocol_param;
$return_array['obfs'] = $user->obfs;
$return_array['obfs_param'] = $user->obfs_param;
if (strpos($node->server, ';') !== false) {
$node_tmp = Tools::OutPort($node->server, $node->name, $mu_port);
if ($mu_port != 0) {
$return_array['port'] = $node_tmp['port'];
$node_name = $node_tmp['name'];
}
$return_array['address'] = $node_tmp['address'];
}
$return_array['passwd'] = $user->passwd;
$return_array['method'] = $user->method;
$return_array['remark'] = $node_name;
$return_array['remark'] = ($emoji == 1
? Tools::addEmoji($node_name)
: $node_name);
$return_array['class'] = $node->node_class;
$return_array['group'] = Config::get('appName');
$return_array['ratio'] = ($relay_rule != null
? $node->traffic_rate + $relay_rule->dist_node()->traffic_rate
: $node->traffic_rate);
return $return_array;
}
@ -649,36 +758,49 @@ class URL
return clone $user;
}
public static function getUserTraffic($user, $type)
public static function getUserInfo($user, $type, $traffic_class_expire)
{
$group_name = Config::get('appName');
if (strtotime($user->expire_in) > time()) {
if ($user->transfer_enable == 0) {
$userTraffic = '剩余流量:0.00%';
$return = '';
// 订阅信息
$info_array = (count(Config::get('sub_message')) != 0
? (array) Config::get('sub_message')
: []);
if ($traffic_class_expire !== 0) {
// 用户账户及流量信息
if (strtotime($user->expire_in) > time()) {
if ($user->transfer_enable == 0) {
$info_array[] = '剩余流量:0.00%';
} else {
$info_array[] = '剩余流量:' . number_format(($user->transfer_enable - $user->u - $user->d) / $user->transfer_enable * 100, 2) . '% ' . $user->unusedTraffic();
}
$info_array[] = '过期时间:' . $user->class_expire;
} else {
$userTraffic = '剩余流量:' . number_format(($user->transfer_enable - $user->u - $user->d) / $user->transfer_enable * 100, 2) . '% ' . $user->unusedTraffic();
$info_array[] = '账户已过期,请续费后使用';
}
$userClassExpire = '过期时间:' . $user->class_expire;
} else {
$userTraffic = '账户已过期,请续费后使用';
$userClassExpire = '账户已过期,请续费后使用';
}
switch ($type) {
case 1: // SSR
$getUserTraffic = 'ssr://' . Tools::base64_url_encode('www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode($userTraffic) . '&group=' . Tools::base64_url_encode($group_name)) . PHP_EOL;
$getUserClassExpiration = 'ssr://' . Tools::base64_url_encode('www.google.com:1:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode($userClassExpire) . '&group=' . Tools::base64_url_encode($group_name)) . PHP_EOL;
break;
case 2: // SS
$getUserTraffic = 'ss://' . Tools::base64_url_encode('chacha20:YnJlYWt3YWxs@www.google.com:2') . '#' . rawurlencode($userTraffic) . PHP_EOL;
$getUserClassExpiration = 'ss://' . Tools::base64_url_encode('chacha20:YnJlYWt3YWxs@www.google.com:2') . '#' . rawurlencode($userClassExpire) . PHP_EOL;
break;
case 3: // V2
$userTrafficArray = ['v' => '2', 'ps' => $userTraffic, 'add' => 'www.google.com', 'port' => '3', 'id' => '2661b5f8-8062-34a5-9371-a44313a75b6b', 'aid' => '16', 'net' => 'tcp', 'type' => 'none', 'host' => '', 'tls' => ''];
$userClassExpirationArray = ['v' => '2', 'ps' => $userClassExpire, 'add' => 'www.google.com', 'port' => '3', 'id' => '2661b5f8-8062-34a5-9371-a44313a75b6b', 'aid' => '16', 'net' => 'tcp', 'type' => 'none', 'host' => '', 'tls' => ''];
$getUserTraffic = 'vmess://' . base64_encode(json_encode($userTrafficArray, JSON_UNESCAPED_UNICODE)) . PHP_EOL;
$getUserClassExpiration = 'vmess://' . base64_encode(json_encode($userClassExpirationArray, JSON_UNESCAPED_UNICODE)) . PHP_EOL;
break;
}
return $getUserTraffic . $getUserClassExpiration;
}
$group_name = Config::get('appName');
foreach ($info_array as $item) {
switch ($type) {
case 'ss':
$return .= 'ss://' . Tools::base64_url_encode('chacha20:breakwall') . '@www.google.com:10086' . '/?group=' . Tools::base64_url_encode($group_name) . '#' . rawurlencode($item) . PHP_EOL;
break;
case 'ssr':
$return .= 'ssr://' . Tools::base64_url_encode('www.google.com:10086:auth_chain_a:chacha20:tls1.2_ticket_auth:YnJlYWt3YWxs/?obfsparam=&protoparam=&remarks=' . Tools::base64_url_encode($item) . '&group=' . Tools::base64_url_encode($group_name)) . PHP_EOL;
break;
case 'v2ray':
$v2ray = ['v' => '2', 'ps' => $item, 'add' => 'www.google.com', 'port' => '10086', 'id' => '2661b5f8-8062-34a5-9371-a44313a75b6b', 'aid' => '2', 'net' => 'tcp', 'type' => 'none', 'host' => '', 'tls' => ''];
$return .= 'vmess://' . base64_encode(json_encode($v2ray, JSON_UNESCAPED_UNICODE)) . PHP_EOL;
break;
case 'quantumult_v2':
$quantumult_v2 = base64_encode($item . ' = vmess, ' . 'www.google.com' . ', ' . '10086' . ', chacha20-ietf-poly1305, "2661b5f8-8062-34a5-9371-a44313a75b6b", group=' . $group_name . '_v2') . PHP_EOL;
$return .= 'vmess://' . base64_encode($quantumult_v2) . PHP_EOL;
break;
}
}
return $return;
}
}

@ -25,21 +25,14 @@
"chen-see/chen-pay": "^1.0@dev",
"league/omnipay": "^3",
"lokielse/omnipay-alipay": "*",
"remotelyliving/php-dns": "3.0.6",
"charlottedunois/yasmin": "*",
"khanamiryan/qrcode-detector-decoder": "*",
"remotelyliving/php-dns": "3.0.6",
"symfony/yaml": "^4.4@dev"
},
"autoload": {
"classmap": [],
"psr-4": {
"App\\": "app/"
}
},
"config": {
"secure-http": false
},
"minimum-stability": "dev",
"require-dev": {
"khanamiryan/qrcode-detector-decoder": "*"
}
}
}

@ -5,330 +5,466 @@
//config迁移附注(由开发者填写本次config迁移后需要注意的地方,站长勿动)
//如需换行,直接换行即可,无需换行符
//【新增/删除】config无需写入迁移附注
$System_Config['config_migrate_notice']=
$_ENV['config_migrate_notice']=
'enable_geetest_* 已变更为 enable_*_captcha
crisp已被替换为mylivechat
telegrma_qrcode被重命名为qrcode
';
$System_Config['version']='1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
$_ENV['version']='1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
//基本设置--------------------------------------------------------------------------------------------
$System_Config['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$System_Config['debug'] = false; //正式环境请确保为 false
$System_Config['appName'] = 'sspanel'; //站点名称
$System_Config['baseUrl'] = 'http://url.com'; //站点地址
$System_Config['subUrl'] = $System_Config['baseUrl'].'/link/'; //订阅地址,如需和站点名称相同,请不要修改
$System_Config['muKey'] = 'NimaQu'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
$System_Config['db_driver'] = 'mysql'; //数据库程序
$System_Config['db_host'] = 'localhost'; //数据库地址
$System_Config['db_database'] = 'sspanel'; //数据库名
$System_Config['db_username'] = 'root'; //数据库用户名
$System_Config['db_password'] = 'sspanel'; //用户名对应的密码
//新旧首页设置--------------------------------------------------------------------------------------------
$System_Config['newIndex'] = 'true'; //使用新的 Node.js 开发的首页请填写 true,其他值为使用先前的首页,如您使用其他主题请保持 true
$_ENV['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$_ENV['debug'] = false; //正式环境请确保为 false
$_ENV['appName'] = 'sspanel'; //站点名称
$_ENV['baseUrl'] = 'http://url.com'; //站点地址
$_ENV['subUrl'] = $_ENV['baseUrl'].'/link/'; //订阅地址,如需和站点名称相同,请不要修改
$_ENV['muKey'] = 'NimaQu'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
$_ENV['db_driver'] = 'mysql'; //数据库程序
$_ENV['db_host'] = 'localhost'; //数据库地址
$_ENV['db_database'] = 'sspanel'; //数据库名
$_ENV['db_username'] = 'root'; //数据库用户名
$_ENV['db_password'] = 'sspanel'; //用户名对应的密码
// 新旧首页设置--------------------------------------------------------------------------------------------
$_ENV['newIndex'] = 'true'; //使用新的 Node.js 开发的首页请填写 true,其他值为使用先前的首页,如您使用其他主题请保持 true
// 订阅中的公告信息
// 使用数组形式,将会添加在订阅列表的顶端
// 可用于为用户推送最新地址等信息,尽可能简短且数量不宜太多
$_ENV['sub_message'] = [];
//邮件设置--------------------------------------------------------------------------------------------
$System_Config['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$System_Config['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题
$_ENV['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$_ENV['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题
# mailgun
$System_Config['mailgun_key'] = '';
$System_Config['mailgun_domain'] = '';
$System_Config['mailgun_sender'] = '';
$_ENV['mailgun_key'] = '';
$_ENV['mailgun_domain'] = '';
$_ENV['mailgun_sender'] = '';
# smtp
$System_Config['smtp_host'] = '';
$System_Config['smtp_username'] = '';
$System_Config['smtp_port'] = '465';
$System_Config['smtp_name'] = '';
$System_Config['smtp_sender'] = '';
$System_Config['smtp_passsword'] = '';
$System_Config['smtp_ssl'] = 'true';
$_ENV['smtp_host'] = '';
$_ENV['smtp_username'] = '';
$_ENV['smtp_port'] = '465';
$_ENV['smtp_name'] = '';
$_ENV['smtp_sender'] = '';
$_ENV['smtp_passsword'] = '';
$_ENV['smtp_ssl'] = 'true';
# sendgrid
$System_Config['sendgrid_key'] = '';
$System_Config['sendgrid_sender'] = '';
$_ENV['sendgrid_key'] = '';
$_ENV['sendgrid_sender'] = '';
//备份设置--------------------------------------------------------------------------------------------
$System_Config['auto_backup_email']=''; //接收备份的邮箱
$System_Config['auto_backup_passwd']=''; //备份的压缩密码
$System_Config['backup_notify']='true'; //备份通知到TG群中
$_ENV['auto_backup_email']=''; //接收备份的邮箱
$_ENV['auto_backup_passwd']=''; //备份的压缩密码
$_ENV['backup_notify']='true'; //备份通知到TG群中
//用户注册设置-----------------------------------------------------------------------------------------
$System_Config['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$System_Config['defaultTraffic'] = '1'; //用户初始流量 单位GB
$System_Config['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天)
$System_Config['user_class_default']='0'; //用户注册等级,在注册时设置。
$System_Config['user_class_expire_default']='24'; //用户等级过期时间,在注册时设置。(小时)
$System_Config['user_conn']='0'; //用户注册客户端数量限制,0为不限制
$System_Config['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制
$System_Config['reg_auto_reset_day']='0'; //注册时的流量重置日,0为不重置
$System_Config['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0为不重置
$System_Config['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$System_Config['reg_method']='rc4-md5'; //注册时默认加密方式
$System_Config['reg_protocol']='origin'; //注册时默认协议
$System_Config['reg_protocol_param']=''; //注册时默认协议参数
$System_Config['reg_obfs']='plain'; //注册时默认混淆方式
$System_Config['reg_obfs_param']=''; //注册时默认混淆参数
$System_Config['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$System_Config['min_port']='10000'; //用户端口池最小值
$System_Config['max_port']='65535'; //用户端口池最大值
$System_Config['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$System_Config['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$System_Config['mu_regex']='%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
$_ENV['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$_ENV['defaultTraffic'] = '1'; //用户初始流量 单位GB
$_ENV['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天)
$_ENV['user_class_default']='0'; //用户注册等级,在注册时设置。
$_ENV['user_class_expire_default']='24'; //用户等级过期时间,在注册时设置。(小时)
$_ENV['user_conn']='0'; //用户注册客户端数量限制,0为不限制
$_ENV['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制
$_ENV['reg_auto_reset_day']='0'; //注册时的流量重置日,0为不重置
$_ENV['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0为不重置
$_ENV['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$_ENV['reg_method']='chacha20-ietf'; //注册时默认加密方式
$_ENV['reg_protocol']='auth_aes128_sha1'; //注册时默认协议
$_ENV['reg_protocol_param']=''; //注册时默认协议参数
$_ENV['reg_obfs']='http_simple'; //注册时默认混淆方式
$_ENV['reg_obfs_param']='www.jd.hk'; //注册时默认混淆参数
$_ENV['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$_ENV['min_port']='10000'; //用户端口池最小值
$_ENV['max_port']='65535'; //用户端口池最大值
$_ENV['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$_ENV['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$_ENV['mu_regex']='%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
#邀请链接
$System_Config['inviteNum'] = '10'; //注册后的邀请链接可用次数
$System_Config['invite_get_money']='1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$System_Config['invite_price']='-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$System_Config['custom_invite_price']='-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
$_ENV['inviteNum'] = '10'; //注册后的邀请链接可用次数
$_ENV['invite_get_money']='1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$_ENV['invite_price']='-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$_ENV['custom_invite_price']='-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
#邮箱验证
$System_Config['enable_email_verify']='false'; //是否启用注册邮箱验证码
$System_Config['email_verify_ttl']='3600'; //邮箱验证码有效期
$System_Config['email_verify_iplimit']='10'; //验证码有效期内,单IP可请求验证码次数
$_ENV['enable_email_verify']='false'; //是否启用注册邮箱验证码
$_ENV['email_verify_ttl']='3600'; //邮箱验证码有效期
$_ENV['email_verify_iplimit']='10'; //验证码有效期内,单IP可请求验证码次数
//已注册用户设置---------------------------------------------------------------------------------------
#基础
$System_Config['checkinMin'] = '1'; //用户签到最少流量 单位MB
$System_Config['checkinMax'] = '50'; //用户签到最多流量
$System_Config['auto_clean_uncheck_days']='-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭
$System_Config['auto_clean_unused_days']='-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭
$System_Config['auto_clean_min_money']='1'; //余额低于多少的0级用户可以被清理
$System_Config['code_payback']='20'; //充值返利百分比
$System_Config['invite_gift']='2'; //邀请新用户获得流量奖励,单位G
$System_Config['enable_bought_reset']='true'; //购买时是否重置流量
$System_Config['enable_bought_extend']='true'; //购买时是否延长等级期限(同等级配套)
$System_Config['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$System_Config['port_price_specify']='-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
$_ENV['checkinMin'] = '1'; //用户签到最少流量 单位MB
$_ENV['checkinMax'] = '50'; //用户签到最多流量
$_ENV['auto_clean_uncheck_days']='-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭
$_ENV['auto_clean_unused_days']='-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭
$_ENV['auto_clean_min_money']='1'; //余额低于多少的0级用户可以被清理
$_ENV['code_payback']='20'; //充值返利百分比
$_ENV['invite_gift']='2'; //邀请新用户获得流量奖励,单位G
$_ENV['enable_bought_reset']='true'; //购买时是否重置流量
$_ENV['enable_bought_extend']='true'; //购买时是否延长等级期限(同等级配套)
$_ENV['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$_ENV['port_price_specify']='-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
#高级
$System_Config['class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,单位GB,小于0时不重置
$System_Config['account_expire_delete_days']='-1'; //账户到期几天之后会删除账户,小于0时不删除
$System_Config['enable_kill']='true'; //是否允许用户注销账户
$System_Config['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$System_Config['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$System_Config['mergeSub'] = 'false'; //合并订阅设置 可选项 false / true,此项在 Rico && GeekQu 仓库已废弃
$System_Config['protocol_specify'] = 'true'; //允许用户自行切换加密、协议、混淆,允许请填写 true,禁止用户自行修改将使用下方配置的方案
$_ENV['class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,单位GB,小于0时不重置
$_ENV['account_expire_delete_days']='-1'; //账户到期几天之后会删除账户,小于0时不删除
$_ENV['enable_kill']='true'; //是否允许用户注销账户
$_ENV['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$_ENV['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$_ENV['mergeSub'] = 'false'; //合并订阅设置 可选项 false / true,此项在 Rico && GeekQu 仓库已废弃
$_ENV['protocol_specify'] = 'true'; //允许用户自行切换加密、协议、混淆,允许请填写 true,禁止用户自行修改将使用下方配置的方案
$_ENV['keep_connect'] = 'false'; //是否开启用户流量耗尽后降低速率至 1Mbps 而不断网
#加密、协议、混淆切换方案
$System_Config['user_agreement_scheme'] = [
$_ENV['user_agreement_scheme'] = [
['id'=>1,'name'=>'SS 推荐配置','method'=>'chacha20-ietf-poly1305','protocol'=>'origin','obfs'=>'plain'],
['id'=>2,'name'=>'SSR 推荐配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1','obfs'=>'http_simple_compatible'],
['id'=>3,'name'=>'SS/SSR 兼容配置','method'=>'chacha20-ietf','protocol'=>'auth_aes128_sha1_compatible','obfs'=>'plain']
];
$_ENV['subscribeLog'] = 'false'; //是否记录用户订阅日志
$_ENV['subscribeLog_keep_days'] = '7'; //订阅记录保留天数
//Bot 设置--------------------------------------------------------------------------------------------
#通用
$System_Config['qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$System_Config['finance_public']='false'; //财务报告是否向群公开
$System_Config['enable_welcome_message']='true'; //机器人发送欢迎消息
$_ENV['qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$_ENV['finance_public']='false'; //财务报告是否向群公开
$_ENV['enable_welcome_message']='true'; //机器人发送欢迎消息
#Discord
$System_Config['enable_discord']='false'; //是否开启Discord bot(仍未完成)
$System_Config['discord_token']=''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请
$_ENV['enable_discord']='false'; //是否开启Discord bot(仍未完成)
$_ENV['discord_token']=''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请
#Telegram
$System_Config['enable_telegram']='false'; //是否开启Telegram bot
$System_Config['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请
$System_Config['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$System_Config['enable_tuling']='false'; //是否开启图灵机器人
$System_Config['tuling_apikey']=''; //图灵机器人API Key
$System_Config['tuling_apisecert']=''; //图灵机器人密钥
$System_Config['telegram_bot']='_bot'; //Telegram 机器人账号
$System_Config['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应
$System_Config['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
$_ENV['enable_telegram']='false'; //是否开启Telegram bot
$_ENV['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请
$_ENV['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$_ENV['enable_tuling']='false'; //是否开启图灵机器人
$_ENV['tuling_apikey']=''; //图灵机器人API Key
$_ENV['tuling_apisecert']=''; //图灵机器人密钥
$_ENV['telegram_bot']='_bot'; //Telegram 机器人账号
$_ENV['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应
$_ENV['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
//沟通设置--------------------------------------------------------------------------------------------
#客服系统设置,注册地址 https://www.mylivechat.com
$System_Config['enable_mylivechat']='false'; //是否开启客服系统
$System_Config['mylivechat_id']='null'; //客服系统ID
$_ENV['enable_mylivechat']='false'; //是否开启客服系统
$_ENV['mylivechat_id']='null'; //客服系统ID
# PushBear 基于微信模板的向关注了二维码的用户以微信方式推送消息 https://pushbear.ftqq.com/
$System_Config['usePushBear'] = 'false'; // true 启用 false 禁用
$System_Config['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错
$_ENV['usePushBear'] = 'false'; // true 启用 false 禁用
$_ENV['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错
#工单系统设置
$System_Config['enable_ticket']='true'; //是否开启工单系统
$System_Config['mail_ticket']='true'; //是否开启工单邮件提醒
$_ENV['enable_ticket']='true'; //是否开启工单系统
$_ENV['mail_ticket']='true'; //是否开启工单邮件提醒
# Server酱 用户提交新工单或者回复工单时用微信提醒机场主 http://sc.ftqq.com/
$System_Config['useScFtqq'] = 'false'; //是否开启工单Server酱提醒
$System_Config['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错
$_ENV['useScFtqq'] = 'false'; //是否开启工单Server酱提醒
$_ENV['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错
#管理员联系方式设置
$System_Config['enable_admin_contact']='false'; //是否开启管理员联系方式
$System_Config['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$System_Config['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$System_Config['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
$_ENV['enable_admin_contact']='false'; //是否开启管理员联系方式
$_ENV['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$_ENV['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$_ENV['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
//验证码设置------------------------------------------------------------------------------------------
$System_Config['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$_ENV['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$System_Config['recaptcha_sitekey'] = '';
$System_Config['recaptcha_secret'] = '';
$_ENV['recaptcha_sitekey'] = '';
$_ENV['recaptcha_secret'] = '';
$System_Config['geetest_id'] = '';
$System_Config['geetest_key'] = '';
$_ENV['geetest_id'] = '';
$_ENV['geetest_key'] = '';
$System_Config['enable_reg_captcha'] = 'false'; //启用注册验证码
$System_Config['enable_login_captcha'] = 'false'; //启用登录验证码
$System_Config['enable_checkin_captcha'] = 'false'; //启用签到验证码
$_ENV['enable_reg_captcha'] = 'false'; //启用注册验证码
$_ENV['enable_login_captcha'] = 'false'; //启用登录验证码
$_ENV['enable_checkin_captcha'] = 'false'; //启用签到验证码
//支付系统设置----------------------------------------------------------------------------------------
#取值 none | codepay | trimepay | f2fpay | chenAlipay | paymentwall | spay |tomatopay | payjs
$System_Config['payment_system']='none';
$_ENV['payment_system']='none';
#codepay码支付
#wiki地址:https://goo.gl/dRwRDi http://t.cn/RnsWjtB
$System_Config['codepay_id']=''; //码支付ID
$System_Config['codepay_key']=''; //码支付通信密钥
$_ENV['codepay_id']=''; //码支付ID
$_ENV['codepay_key']=''; //码支付通信密钥
#alipay,f2fpay
$System_Config['f2fpay_app_id']='';
$System_Config['f2fpay_p_id']='';
$System_Config['alipay_public_key']='';
$System_Config['merchant_private_key']='';
$System_Config['f2fNotifyUrl']=null; //自定义当面付回调地址
$_ENV['f2fpay_app_id']='';
$_ENV['f2fpay_p_id']='';
$_ENV['alipay_public_key']='';
$_ENV['merchant_private_key']='';
$_ENV['f2fNotifyUrl']=null; //自定义当面付回调地址
#PaymentWall
$System_Config['pmw_publickey']='';
$System_Config['pmw_privatekey']='';
$System_Config['pmw_widget']='m2_1';
$System_Config['pmw_height']='350px';
$_ENV['pmw_publickey']='';
$_ENV['pmw_privatekey']='';
$_ENV['pmw_widget']='m2_1';
$_ENV['pmw_height']='350px';
#alipay,spay
$System_Config['alipay_id']='';
$System_Config['alipay_key']='';
$System_Config['amount']=[2,23,233,2333,23333]; //充值金额选项设定
$_ENV['alipay_id']='';
$_ENV['alipay_key']='';
$_ENV['amount']=[2,23,233,2333,23333]; //充值金额选项设定
#alipay,zfbjk.com
$System_Config['zfbjk_pid']='';
$System_Config['zfbjk_key']='';
$System_Config['zfbjk_qrcodeurl']='';
$_ENV['zfbjk_pid']='';
$_ENV['zfbjk_key']='';
$_ENV['zfbjk_qrcodeurl']='';
#Trimepay https://portal.trimepay.com/#/auth/register/134
$System_Config['trimepay_appid']=''; //AppID
$System_Config['trimepay_secret']=''; //AppSecret
$_ENV['trimepay_appid']=''; //AppID
$_ENV['trimepay_secret']=''; //AppSecret
# BitPay 数字货币支付(比特币、以太坊、EOS等) 商户后台获取授权码 https://merchants.mugglepay.com/
# 客服和技术 24x7 在线支持: https://t.me/joinchat/GLKSKhUnE4GvEAPgqtChAQ
$System_Config['bitpay_secret']='';
$_ENV['bitpay_secret']='';
#PayJs
$System_Config['payjs_mchid']='';
$System_Config['payjs_key']='';
$_ENV['payjs_mchid']='';
$_ENV['payjs_key']='';
//其他面板显示设置------------------------------------------------------------------------------------------
#用户文档
$System_Config['enable_documents'] = 'true'; //是否允许未登陆用户查看文档中心
$System_Config['documents_name'] = $System_Config['appName'] . ' 文档中心'; //文档中心名称
$System_Config['remote_documents'] = 'true'; //是否从远程加载文档中心,否的话请执行 php xcat initdocuments
$System_Config['documents_source'] = 'https://raw.githubusercontent.com/GeekQu/PANEL_DOC/master/GeekQu'; //远程文档加载地址
$_ENV['enable_documents'] = 'true'; //是否允许未登陆用户查看文档中心
$_ENV['documents_name'] = $_ENV['appName'] . ' 文档中心'; //文档中心名称
$_ENV['remote_documents'] = 'true'; //是否从远程加载文档中心,否的话请执行 php xcat initdocuments
$_ENV['documents_source'] = 'https://raw.githubusercontent.com/GeekQu/PANEL_DOC/master/GeekQu'; //远程文档加载地址
#后台商品列表 销量统计
$System_Config['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】
$_ENV['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】
#国旗
$System_Config['enable_flag']='false'; //启用该项之前务必先仔细阅读教程
$System_Config['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
$_ENV['enable_flag']='false'; //启用该项之前务必先仔细阅读教程
$_ENV['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
#捐赠
$System_Config['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开)
$_ENV['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开)
#iOS账户显示
$System_Config['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能
$System_Config['display_ios_topup']='0'; //满足等级要求后,累计充值高于多少的用户可以看见
$System_Config['ios_account']=''; //iOS账户
$System_Config['ios_password']=''; //iOS密码
$_ENV['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能
$_ENV['display_ios_topup']='0'; //满足等级要求后,累计充值高于多少的用户可以看见
$_ENV['ios_account']=''; //iOS账户
$_ENV['ios_password']=''; //iOS密码
//节点检测-----------------------------------------------------------------------------------------------
#GFW检测,请通过crontab进行【开启/关闭】
$System_Config['detect_gfw_interval']='3600'; //检测间隔,单位:秒,低于推荐值会爆炸
$System_Config['detect_gfw_port']='22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$System_Config['detect_gfw_url']='https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$System_Config['detect_gfw_judge']='$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$System_Config['detect_gfw_count']='3'; //尝试次数
$_ENV['detect_gfw_interval']='3600'; //检测间隔,单位:秒,低于推荐值会爆炸
$_ENV['detect_gfw_port']='22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$_ENV['detect_gfw_url']='https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$_ENV['detect_gfw_judge']='$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$_ENV['detect_gfw_count']='3'; //尝试次数
#离线检测
$System_Config['enable_detect_offline']='true';
$_ENV['enable_detect_offline']='true';
#离线检测是否推送到Server酱 请配置好上文的Server配置
$System_Config['enable_detect_offline_useScFtqq']='true';
$_ENV['enable_detect_offline_useScFtqq']='true';
//以下所有均为高级设置(一般用不上,不用改---------------------------------------------------------------------
#杂项
$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$System_Config['rememberMeDuration']='7'; //登录时记住账号时长天数
$System_Config['authDriver'] = 'cookie'; //不能更改此项
$System_Config['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$System_Config['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$System_Config['sessionDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['cacheDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['tokenDriver'] = 'db'; //可选: db,redis
$System_Config['jump_delay']='1200'; //跳转延时,单位ms,不建议太长
$System_Config['theme'] = 'material'; //主题
$System_Config['pacp_offset']='-20000'; //VPN 端口偏移
$System_Config['pacpp_offset']='-20000';
$System_Config['Speedtest_duration']='6'; //显示多长时间的测速记录
$System_Config['login_warn']='false'; //异地登陆提示
$System_Config['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$System_Config['db_charset'] = 'utf8';
$System_Config['db_collation'] = 'utf8_general_ci';
$System_Config['db_prefix'] = '';
$System_Config['muKeyList'] = [' ']; //多 key 列表
$_ENV['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$_ENV['rememberMeDuration']='7'; //登录时记住账号时长天数
$_ENV['authDriver'] = 'cookie'; //不能更改此项
$_ENV['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$_ENV['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$_ENV['sessionDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['cacheDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['tokenDriver'] = 'db'; //可选: db,redis
$_ENV['jump_delay']='1200'; //跳转延时,单位ms,不建议太长
$_ENV['theme'] = 'material'; //主题
$_ENV['pacp_offset']='-20000'; //VPN 端口偏移
$_ENV['pacpp_offset']='-20000';
$_ENV['Speedtest_duration']='6'; //显示多长时间的测速记录
$_ENV['login_warn']='false'; //异地登陆提示
$_ENV['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$_ENV['db_charset'] = 'utf8';
$_ENV['db_collation'] = 'utf8_general_ci';
$_ENV['db_prefix'] = '';
$_ENV['muKeyList'] = [' ']; //多 key 列表
$_ENV['mu_port_migration'] = 'false'; //为后端直接下发偏移后的端口
$_ENV['relay_port_migration'] = 'false'; //为中转规则下发偏移后的端口,此项未经测试
$_ENV['add_emoji_to_node_name'] = 'false'; //为部分订阅中默认添加 emoji
$_ENV['add_appName_to_ss_uri'] = 'true'; //为 SS 节点名称中添加站点名
$_ENV['subscribe_client'] = 'false'; //下载协议客户端时附带节点和订阅信息
// 审计自动封禁开关
$_ENV['enable_auto_detect_ban'] = 'false';
// 管理员不受审计限制
$_ENV['auto_detect_ban_allow_admin'] = 'true';
// 审计封禁的例外用户 ID
$_ENV['auto_detect_ban_allow_users'] = [];
// 审计封禁判断类型:
// - 1 = 仁慈模式,每触碰多少次封禁一次
// - 2 = 疯狂模式,累计触碰次数按阶梯进行不同时长的封禁
$_ENV['auto_detect_ban_type'] = '1';
// 仁慈模式每次执行封禁所需的触发次数
$_ENV['auto_detect_ban_number'] = '30';
// 仁慈模式每次封禁的时长 (分钟)
$_ENV['auto_detect_ban_time'] = '60';
// 疯狂模式阶梯
// key 为触发次数
// - type:可选 time 按时间 或 kill 删号
// - time:时间,单位分钟
$_ENV['auto_detect_ban'] = [
100 => [
'type' => 'time',
'time' => '120'
],
300 => [
'type' => 'time',
'time' => '720'
],
600 => [
'type' => 'time',
'time' => '4320'
],
1000 => [
'type' => 'kill',
'time' => '0'
]
];
#aws
$System_Config['aws_access_key_id'] = '';
$System_Config['aws_secret_access_key'] = '';
$_ENV['aws_access_key_id'] = '';
$_ENV['aws_secret_access_key'] = '';
#redis
$System_Config['redis_scheme'] = 'tcp';
$System_Config['redis_host'] = '127.0.0.1';
$System_Config['redis_port'] = '6379';
$System_Config['redis_database'] = '0';
$System_Config['redis_password']= '';
$_ENV['redis_scheme'] = 'tcp';
$_ENV['redis_host'] = '127.0.0.1';
$_ENV['redis_port'] = '6379';
$_ENV['redis_database'] = '0';
$_ENV['redis_password']= '';
#Radius设置
$System_Config['enable_radius']='false'; //是否开启Radius
$System_Config['radius_db_host']=''; //以下4项为Radius数据库设置
$System_Config['radius_db_database']='';
$System_Config['radius_db_user']='';
$System_Config['radius_db_password']='';
$System_Config['radius_secret']=''; //Radius连接密钥
$_ENV['enable_radius']='false'; //是否开启Radius
$_ENV['radius_db_host']=''; //以下4项为Radius数据库设置
$_ENV['radius_db_database']='';
$_ENV['radius_db_user']='';
$_ENV['radius_db_password']='';
$_ENV['radius_secret']=''; //Radius连接密钥
#Cloudxns
$System_Config['enable_cloudxns']='false'; //是否开启Cloudxns
$System_Config['cloudxns_apikey']=''; //自己去 cloudxns.net 申请
$System_Config['cloudxns_apisecret']='';
$System_Config['cloudxns_domain']=''; //你的域名
$_ENV['enable_cloudxns']='false'; //是否开启Cloudxns
$_ENV['cloudxns_apikey']=''; //自己去 cloudxns.net 申请
$_ENV['cloudxns_apisecret']='';
$_ENV['cloudxns_domain']=''; //你的域名
#Cloudflare
$System_Config['cloudflare_enable']='false'; //是否开启 Cloudflare 解析
$System_Config['cloudflare_email']='user@example.com'; //Cloudflare 邮箱地址
$System_Config['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$System_Config['cloudflare_name']='example.com'; //域名
$_ENV['cloudflare_enable']='false'; //是否开启 Cloudflare 解析
$_ENV['cloudflare_email']='user@example.com'; //Cloudflare 邮箱地址
$_ENV['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$_ENV['cloudflare_name']='example.com'; //域名
#不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转
$System_Config['relay_insecure_mode']='false'; //强烈推荐不开启
$_ENV['relay_insecure_mode']='false'; //强烈推荐不开启
#是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符
$System_Config['enable_analytics_code']='false';
$System_Config['sspanelAnalysis'] = 'true';
$_ENV['enable_analytics_code']='false';
$_ENV['sspanelAnalysis'] = 'true';
//自定义设置---------------------------------------------------------------------
//是否向 Telegram 群组推送系统今天的运行状况
$_ENV['sendDiary_Telegram'] = 'true';
//自定义向 Telegram 群组推送系统今天的运行状况的信息
$_ENV['sendDiary_Msg'] = ('各位老爷少奶奶,我来为大家报告一下系统今天的运行状况哈~' . PHP_EOL
. '今日签到人数:%getTodayCheckinUser%' . PHP_EOL
. '今日使用总流量:%lastday_total%' . PHP_EOL
. '晚安~');
//是否向 Telegram 群组推送数据库清理通知
$_ENV['sendDailyJob_Telegram'] = 'true';
//自定义向 Telegram 群组推送数据库清理通知的信息
$_ENV['sendDailyJob_Msg'] = '姐姐姐姐,数据库被清理了,感觉身体被掏空了呢~';
//是否向 Telegram 群组推送节点掉线通知
$_ENV['sendNodeOffline_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点掉线已切换通知的信息
$_ENV['sendNodeOffline_Update_Msg'] = '喵喵喵~ %node_name% 节点掉线了喵~域名解析被切换到了 %Temp_node_name% 上了喵~';
//自定义向 Telegram 群组推送节点掉线通知的信息
$_ENV['sendNodeOffline_Msg'] = '喵喵喵~ %node_name% 节点掉线了喵~';
//是否向 Telegram 群组推送节点上线通知
$_ENV['sendNodeOnline_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点上线已切换通知的信息
$_ENV['sendNodeOnline_Update_Msg'] = '喵喵喵~ %node_name% 节点恢复了喵~域名解析被切换回来了喵~';
//自定义向 Telegram 群组推送节点上线通知的信息
$_ENV['sendNodeOnline_Msg'] = '喵喵喵~ %node_name% 节点恢复了喵~';
//是否向 Telegram 群组推送节点被墙通知
$_ENV['sendNodeGFW_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点被墙已切换通知的信息
$_ENV['sendNodeGFW_Update_Msg'] = '喵喵喵~ %node_name% 节点被墙了喵~域名解析被切换到了 %Temp_node_name% 上了喵~';
//自定义向 Telegram 群组推送节点被墙通知的信息
$_ENV['sendNodeGFW_Msg'] = '喵喵喵~ %node_name% 节点被墙了喵~';
//是否向 Telegram 群组推送节点被墙恢复通知
$_ENV['sendNodeGFW_recover_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点被墙恢复已切换通知的信息
$_ENV['sendNodeGFW_recover_Update_Msg'] = '喵喵喵~ %node_name% 节点恢复了喵~域名解析被切换回来了喵~';
//自定义向 Telegram 群组推送节点被墙恢复通知的信息
$_ENV['sendNodeGFW_recover_Msg'] = '喵喵喵~ %node_name% 节点恢复了喵~';
//是否向 Telegram 群组推送节点新增通知
$_ENV['sendAddNode_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点新增通知的信息
$_ENV['sendAddNode_Msg'] = '新节点添加~ %node_name%';
//是否向 Telegram 群组推送节点修改通知
$_ENV['sendUpdateNode_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点修改通知的信息
$_ENV['sendUpdateNode_Msg'] = '节点信息被修改~ %node_name%';
//是否向 Telegram 群组推送节点删除通知
$_ENV['sendDeleteNode_Telegram'] = 'true';
//自定义向 Telegram 群组推送节点删除通知的信息
$_ENV['sendDeleteNode_Msg'] = '节点被删除~ %node_name%';
#在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
@ -336,239 +472,11 @@ $list = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}
// Clash 策略组配置
$System_Config['clash_Profiles'] = [
'lhie1' => [
'Checks' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继'],
'ProxyGroup' => [
[
'name' => '香港',
'type' => 'url-test',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '日本',
'type' => 'url-test',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '坡坡',
'type' => 'url-test',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '美国',
'type' => 'url-test',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '台湾',
'type' => 'url-test',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '韩国',
'type' => 'url-test',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '中继',
'type' => 'url-test',
'content' => [
'regex' => '(中继|中转|中国|回国|China|CN)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => 'Proxy',
'type' => 'select',
'content' => [
'left-proxies' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Domestic',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'Proxy', '中继']
]
],
[
'name' => 'AsianTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Domestic', 'Proxy', '中继']
]
],
[
'name' => 'GlobalTV',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy', '香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Others',
'type' => 'select',
'content' => [
'left-proxies' => ['Proxy', 'Domestic']
]
]
]
],
'ConnersHua_Pro' => [
'Checks' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继'],
'ProxyGroup' => [
[
'name' => '香港',
'type' => 'url-test',
'content' => [
'regex' => '(香港|HK)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '日本',
'type' => 'url-test',
'content' => [
'regex' => '(日本|JP)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '坡坡',
'type' => 'url-test',
'content' => [
'regex' => '(新加坡|SG)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '美国',
'type' => 'url-test',
'content' => [
'regex' => '(美国|US)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '台湾',
'type' => 'url-test',
'content' => [
'regex' => '(台湾|TW)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '韩国',
'type' => 'url-test',
'content' => [
'regex' => '(韩国|KR)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => '中继',
'type' => 'url-test',
'content' => [
'regex' => '(中继|中转|中国|回国|China|CN)'
],
'url' => 'http://www.qualcomm.cn/generate_204',
'interval' => 3600
],
[
'name' => 'PROXY',
'type' => 'select',
'content' => [
'left-proxies' => ['香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'Final',
'type' => 'select',
'content' => [
'left-proxies' => ['PROXY', 'DIRECT']
]
],
[
'name' => 'ForeignMedia',
'type' => 'select',
'content' => [
'left-proxies' => ['PROXY', '香港', '日本', '坡坡', '台湾', '美国', '韩国', '中继']
]
],
[
'name' => 'DomesticMedia',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'PROXY', '中继']
]
],
[
'name' => 'Apple',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'PROXY']
]
],
[
'name' => 'Hijacking',
'type' => 'select',
'content' => [
'left-proxies' => ['DIRECT', 'REJECT']
]
]
]
],
'ConnersHua_BacktoCN' => [
'Checks' => [],
'ProxyGroup' => [
[
'name' => 'PROXY',
'type' => 'select',
'content' => [
'regex' => '(中继|中转|中国|回国|China|CN)'
]
]
]
]
];
// make replace System_Config with env
// make replace _ENV with env
function findKeyName($name) {
global $System_Config;
foreach($System_Config as $configKey => $configValue) {
global $_ENV;
foreach($_ENV as $configKey => $configValue) {
if (strtoupper($configKey) == $name) {
return $configKey;
}
@ -578,15 +486,15 @@ function findKeyName($name) {
}
foreach(getenv() as $envKey => $envValue) {
global $System_Config;
global $_ENV;
$envUpKey = strtoupper($envKey);
// Key starts with UIM_
if (substr($envUpKey, 0 , 4) == "UIM_") {
// Vaild env key, set to System_Config
// Vaild env key, set to _ENV
$configKey = substr($envUpKey, 4);
$realKey = findKeyName($configKey);
if ($realKey != NULL) {
$System_Config[$realKey] = $envValue;
$_ENV[$realKey] = $envValue;
}
}
}

@ -36,7 +36,7 @@ $container['notAllowedHandler'] = static function ($c) {
};
};
if ($debug == false) {
if (DEBUG == false) {
$container['errorHandler'] = static function ($c) {
return static function ($request, $response, $exception) use ($c) {
return $response->withAddedHeader('Location', '/500');
@ -79,6 +79,9 @@ $app->group('/user', function () {
$this->get('/detect', App\Controllers\UserController::class . ':detect_index');
$this->get('/detect/log', App\Controllers\UserController::class . ':detect_log');
// 订阅记录
$this->get('/subscribe_log', App\Controllers\UserController::class . ':subscribe_log');
$this->get('/disable', App\Controllers\UserController::class . ':disable');
$this->get('/shop', App\Controllers\UserController::class . ':shop');
@ -144,6 +147,9 @@ $app->group('/user', function () {
// getUserAllURL
$this->get('/getUserAllURL', App\Controllers\UserController::class . ':getUserAllURL');
// getPcClient
$this->get('/getPcClient', App\Controllers\UserController::class . ':getPcClient');
//Reconstructed Payment System
$this->post('/payment/purchase', App\Services\Payment::class . ':purchase');
$this->get('/payment/return', App\Services\Payment::class . ':returnHTML');
@ -272,6 +278,10 @@ $app->group('/admin', function () {
$this->get('/subscribe', App\Controllers\Admin\SubscribeLogController::class . ':index');
$this->post('/subscribe/ajax', App\Controllers\Admin\SubscribeLogController::class . ':ajax_subscribe_log');
// Detect Ban Mange
$this->get('/detect/ban', App\Controllers\Admin\DetectBanLogController::class . ':index');
$this->post('/detect/ban/ajax', App\Controllers\Admin\DetectBanLogController::class . ':ajax_log');
// Code Mange
$this->get('/code', App\Controllers\Admin\CodeController::class . ':index');
$this->get('/code/create', App\Controllers\Admin\CodeController::class . ':create');
@ -298,6 +308,7 @@ $app->group('/admin', function () {
$this->get('/profile', App\Controllers\AdminController::class . ':profile');
$this->get('/invite', App\Controllers\AdminController::class . ':invite');
$this->post('/invite', App\Controllers\AdminController::class . ':addInvite');
$this->post('/chginvite', App\Controllers\AdminController::class . ':chgInvite');
$this->get('/sys', App\Controllers\AdminController::class . ':sys');
$this->get('/logout', App\Controllers\AdminController::class . ':logout');
$this->post('/payback/ajax', App\Controllers\AdminController::class . ':ajax_payback');

@ -0,0 +1 @@
请将已解压的客户端存放在对应文件夹中

@ -0,0 +1,3 @@
尊敬的用户您好:
如您在使用上遇到问题,请注意在我们的网站上查询相关的教程或联系我们。

@ -0,0 +1,3 @@
尊敬的用户您好:
如您在使用上遇到问题,请注意在我们的网站上查询相关的教程或联系我们。

@ -0,0 +1,3 @@
尊敬的用户您好:
如您在使用上遇到问题,请注意在我们的网站上查询相关的教程或联系我们。

@ -12,18 +12,10 @@ udp-replay = true
[Proxy]
🚀 Direct = direct
{$ss_group}
{$All_Proxy}
[Proxy Group]
🍈 Select = select{$ss_name}
🍃 Proxy = select, 🏃 Auto, 🍈 Select, 🚀 Direct
🍂 Domestic = select, 🚀 Direct, 🍃 Proxy
☁️ Others = select, 🍃 Proxy, 🚀 Direct
🏃 Auto = url-test{$ss_name}, url = http://www.gstatic.com/generate_204, interval = 1200
{$ProxyGroups}
[Rule]
{include file='rule/PROXY.conf'}

@ -14,7 +14,7 @@ enhanced-mode-by-rule = false
exclude-simple-hostnames = true
ipv6 = true
replica = false
{if $surge == 3}
{if $surge >= 3}
http-listen = 0.0.0.0:8234
socks5-listen = 0.0.0.0:8235
internet-test-url = http://baidu.com
@ -35,24 +35,13 @@ use-keyword-filter = false
[Proxy]
🚀 Direct = direct
{$proxy_group}
{$All_Proxy}
[Proxy Group]
🍃 Proxy = select, 🏃 Auto, 🍈 Select, 🚀 Direct
🍂 Domestic = select, 🚀 Direct, 🍃 Proxy
☁️ Others = select, 🍃 Proxy, 🚀 Direct
🍎 Only = select, 🚀 Direct, 🍃 Proxy
🍈 Select = select{$proxy_name}
🏃 Auto = url-test{$proxy_name}, url = http://www.gstatic.com/generate_204, interval = 1200
{$ProxyGroups}
[Rule]
{if $surge == 3}
{if $surge >= 3}
RULE-SET,SYSTEM,🍎 Only
RULE-SET,https://raw.githubusercontent.com/lhie1/Rules/master/Surge3/Proxy.list,🍃 Proxy
RULE-SET,https://raw.githubusercontent.com/lhie1/Rules/master/Surge3/Domestic.list,🍂 Domestic
@ -69,18 +58,7 @@ FINAL,☁️ Others,dns-failed
[Host]
localhost = 127.0.0.1
syria.sy = 127.0.0.1
*.1688.com = server:223.6.6.6
*.fliggy.com = server:223.6.6.6
*.aliqin.com = server:223.6.6.6
*.tmall.com = server:223.6.6.6
*.taobao.com = server:223.6.6.6
*.ali*.com = server:223.6.6.6
*.upyun.com = server:223.6.6.6
*.mmstat.com = server:223.6.6.6
*.jd.com = server:119.29.29.29
*.qq.com = server:119.29.29.29
*buyimg.com = server:119.29.29.29
*gtimg.* = server:119.29.29.29
{literal}
[URL Rewrite]
// Google_Service_HTTPS_Jump

@ -15,6 +15,13 @@
<div class="card-main">
<div class="card-inner">
<p>系统中金额流转记录。</p>
<p>
今日流水:¥{$user->todayIncome()}<br/>
昨日流水:¥{$user->yesterdayIncome()}<br/>
这月流水:¥{$user->thisMonthIncome()}<br/>
上月流水:¥{$user->lastMonthIncome()}<br/>
总共流水:¥{$user->totalIncome()}
</p>
<p>显示表项:
{include file='table/checkbox.tpl'}
</p>

@ -0,0 +1,42 @@
{include file='admin/main.tpl'}
<main class="content">
<div class="content-header ui-content-header">
<div class="container">
<h1 class="content-heading">审计封禁记录</h1>
</div>
</div>
<div class="container">
<div class="col-lg-12 col-md-12">
<section class="content-inner margin-top-no">
<div class="card">
<div class="card-main">
<div class="card-inner">
<p>系统中所有审计封禁记录。</p>
<p>显示表项:
{include file='table/checkbox.tpl'}
</p>
</div>
</div>
</div>
<div class="table-responsive">
{include file='table/table.tpl'}
</div>
</div>
</div>
</main>
{include file='admin/footer.tpl'}
<script>
{include file='table/js_1.tpl'}
$(document).ready(function(){
{include file='table/js_2.tpl'}
});
</script>

@ -16,7 +16,32 @@
</div>
</div>
</div>
<div class="card">
<div class="card-main">
<div class="card-inner">
<div class="form-group form-group-label">
<label class="floating-label" for="userid">需要修改邀请者的用户</label>
<input class="form-control maxwidth-edit" id="userid" type="text">
<p class="form-control-guide"><i class="material-icons">info</i>填写用户的ID</p>
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="refid">邀请者的ID</label>
<input class="form-control maxwidth-edit" id="refid" type="number">
</div>
</div>
<div class="card-action">
<div class="card-action-btn pull-left">
<a class="btn btn-flat waves-attach" id="confirm"><span class="icon">check</span>&nbsp;更改</a>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-main">
@ -104,6 +129,33 @@
}
})
})
$$.getElementById('confirm').addEventListener('click', () => {
$.ajax({
type: "POST",
url: "/admin/chginvite",
dataType: "json",
data: {
prefix: $$.getElementById('confirm').value,
userid: $$.getElementById('userid').value,
refid: $$.getElementById('refid').value,
},
success: data => {
if (data.ret) {
$("#result").modal();
$$.getElementById('msg').innerHTML = data.msg;
window.setTimeout("location.href='/admin/invite'", {$config['jump_delay']} );
} else {
$("#result").modal();
$$.getElementById('msg').innerHTML = data.msg;
}
// window.location.reload();
},
error: jqXHR => {
alert(`发生错误:${ldelim}jqXHR.status{rdelim}`);
}
})
})
window.addEventListener('load', () => {
{include file='table/js_2.tpl'}

@ -112,7 +112,9 @@
<li><a href="/admin/user"><i class="icon icon-lg">supervisor_account</i>&nbsp;用户列表</a></li>
<li><a href="/admin/relay"><i class="icon icon-lg">compare_arrows</i>&nbsp;中转规则</a></li>
<li><a href="/admin/invite"><i class="icon icon-lg">loyalty</i>&nbsp;邀请与返利</a></li>
{if $config['subscribeLog']=='true'}
<li><a href="/admin/subscribe"><i class="icon icon-lg">dialer_sip</i>&nbsp;订阅记录</a></li>
{/if}
<li><a href="/admin/login"><i class="icon icon-lg">text_fields</i>&nbsp;登录记录</a></li>
<li><a href="/admin/alive"><i class="icon icon-lg">important_devices</i>&nbsp;在线IP</a></li>
</ul>
@ -121,6 +123,7 @@
<ul class="menu-collapse collapse in" id="ui_menu_detect">
<li><a href="/admin/detect"><i class="icon icon-lg">account_balance</i>&nbsp;审计规则</a></li>
<li><a href="/admin/detect/log"><i class="icon icon-lg">assignment_late</i>&nbsp;审计记录</a></li>
<li><a href="/admin/detect/ban"><i class="icon icon-lg">text_fields</i>&nbsp;审计封禁</a></li>
</ul>

@ -13,7 +13,7 @@
<div class="card">
<div class="card-main">
<div class="card-inner">
<p>这里是订阅记录。</p>
<p>这里是所有用户最近 {$config['subscribeLog_keep_days']} 天的订阅记录。</p>
<p>显示表项: {include file='table/checkbox.tpl'}</p>
</div>
</div>

@ -84,6 +84,52 @@
</div>
</div>
<div class="card">
<div class="card-main">
<div class="card-inner">
<div class="form-group form-group-label">
<div class="checkbox switch">
<label for="detect_ban">
<input {if $edit_user->detect_ban==1}checked{/if} class="access-hide" id="detect_ban" type="checkbox"><span class="switch-toggle"></span>审计已封禁
</label>
</div>
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="ban_time">手动封禁时长 (分钟),不封禁不要修改</label>
<input class="form-control maxwidth-edit" id="ban_time" type="text"
value="0">
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="last_detect_ban_time">最后一次被封禁的时间</label>
<input class="form-control maxwidth-edit" id="last_detect_ban_time" type="text"
value="{$edit_user->last_detect_ban_time()}" readonly>
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="relieve_time">当前解封时间</label>
<input class="form-control maxwidth-edit" id="relieve_time" type="text"
value="{$edit_user->relieve_time()}" readonly>
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="detect_ban_number">累计封禁次数</label>
<input class="form-control maxwidth-edit" id="detect_ban_number" type="text"
value="{if $edit_user->detect_ban_number()==0}好耶!标杆用户,没有被审计封禁过耶{else}太坏了,这位用户累计被封禁过 {$edit_user->detect_ban_number()} 次呢{/if}" readonly>
</div>
<div class="form-group form-group-label">
<label class="floating-label" for="all_detect_number">累计违规次数</label>
<input class="form-control maxwidth-edit" id="all_detect_number" type="text"
value="{$edit_user->all_detect_number}" readonly>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-main">
<div class="card-inner">
@ -317,6 +363,12 @@
var ga_enable = 0;
}
if(document.getElementById('detect_ban').checked) {
var detect_ban=1;
} else {
var detect_ban=0;
}
$.ajax({
type: "PUT",
url: "/admin/user/{$edit_user->id}",
@ -339,6 +391,8 @@
enable,
is_admin,
ga_enable,
detect_ban: detect_ban,
ban_time: $$getValue('ban_time'),
ref_by: $$getValue('ref_by'),
forbidden_ip: $$getValue('forbidden_ip'),
forbidden_port: $$getValue('forbidden_port'),

@ -14,6 +14,9 @@
<div class="card-main">
<div class="card-inner">
<p>系统中所有用户的列表。</p>
<p>
付费用户:{$user->paidUserCount()}
</p>
<p>显示表项:
{include file='table/checkbox.tpl'}
</p>
@ -275,4 +278,4 @@
})
</script>
</script>

@ -15,6 +15,22 @@
<div class="card-inner">
<p>为了爱与和平,也同时为了系统的正常运行,特制定了如下过滤规则,当您使用节点执行这些动作时,您的通信就会被截断。</p>
<p>关于隐私:注意,我们仅用以下规则进行实时匹配和记录匹配到的规则,您的通信方向和通信内容我们不会做任何记录,请您放心。也请您理解我们对于这些不当行为的管理,谢谢。</p>
{if $config['enable_auto_detect_ban']=='true'}
{if $config['auto_detect_ban_type']=='1'}
<p>请注意,每当您触发审计规则 <strong>{$config['auto_detect_ban_number']}</strong> 次,将会被停止使用服务 <strong>{$config['auto_detect_ban_time']}</strong> 分钟</p>
{else}
<p>请注意,审计将以以下规则执行:</p>
<dl class="dl-horizontal">
{foreach $config['auto_detect_ban'] as $key => $value}
{if $value['type']=='kill'}
<dt>触碰审计规则达 {$key} 次,将会被直接删除账号</dt>
{else}
<dt>触碰审计规则达 {$key} 次,将被封禁 {$value['time']} 分钟</dt>
{/if}
{/foreach}
</dl>
{/if}
{/if}
</div>
</div>
</div>

@ -15,7 +15,10 @@
<div class="card">
<div class="card-main">
<div class="card-inner">
<p>您由于某些原因而被管理员禁用了账户,请联系管理员。</p>
<p>您由于以下原因而被管理员禁用了账户,请联系管理员。</p>
<p>
禁用原因:{$user->disableReason()}
</p>
{if $config["enable_admin_contact"] == 'true'}
<p>管理员联系方式:</p>
{if $config["admin_contact1"]!=null}

@ -984,16 +984,17 @@
})
</script>
{/literal}
<script>
$(function(){
new Clipboard('.reset-link');
});
$(".reset-link").click(function () {
$("#result").modal();
$("#msg").html("已重置您的订阅链接,请变更或添加您的订阅链接!");
window.setTimeout("location.href='/user/url_reset'", {$config['jump_delay']});
});
$(function () {
new Clipboard('.reset-link');
});
$(".reset-link").click(function () {
$("#result").modal();
$$.getElementById('msg').innerHTML = '已重置您的订阅链接,请变更或添加您的订阅链接!';
window.setTimeout("location.href='/user/url_reset'", {$config['jump_delay']});
});
</script>
<script>
@ -1006,19 +1007,21 @@
data: {
id: $("#agreement_scheme").val()
},
success: function (data) {
success: (data) => {
if (data.ret) {
$("#result").modal();
$("#msg").html(data.msg);
window.setTimeout("location.href='/user/edit'", {$config['jump_delay']});
$$.getElementById('msg').innerHTML = data.msg;
window.setTimeout("location.href='/user/edit'", {$config['jump_delay']});
} else {
$("#result").modal();
$("#msg").html(data.msg);
$$.getElementById('msg').innerHTML = data.msg;
}
},
error: function (jqXHR) {
error: (jqXHR) => {
$("#result").modal();
$("#msg").html(data.msg+" 出现了一些错误。");
$$.getElementById('msg').innerHTML = `${
data.msg
} 出现了一些错误`;
}
})
})
@ -1026,4 +1029,3 @@
</script>
{/literal}

@ -151,6 +151,22 @@ table tr td:first-child {
<div class="col-xx-12 col-sm-5">
{if $user->detect_ban==1}
<div class="card">
<div class="card-main">
<div class="card-inner margin-bottom-no">
<p class="card-heading"><i class="icon icon-md">account_circle</i>账户违规</p>
{if $user->user_detect_ban_number()==0}
<p><strong>您好,您的账户因触碰了审计规则或其他原因,目前被暂停使用</strong></p>
{else}
<p><strong>您好,您的账户因触碰了 {$user->user_detect_ban_number()} 次审计规则,目前被暂停使用</strong></p>
{/if}
<p><strong>解除时间:{$user->relieve_time()}</strong></p>
</div>
</div>
</div>
{/if}
<div class="card">
<div class="card-main">
<div class="card-inner margin-bottom-no">
@ -397,23 +413,39 @@ table tr td:first-child {
</div>
<div class="tab-pane fade" id="sub_center_windows">
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="https://github.com/CGDF-Github/SSD-Windows/releases"><i class="material-icons">save_alt</i> 下载</a> SSD - [ SS ]:</p>
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="{if $config["subscribe_client"]=='true'}/user/getPcClient?type=ss-win{else}https://github.com/shadowsocks/shadowsocks-windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SS - [ SS ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/Shadowsocks"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a id="win_ss" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ss","#win_ss","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="{if $config["subscribe_client"]=='true'}/user/getPcClient?type=ssd-win{else}https://github.com/CGDF-Github/SSD-Windows/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSD - [ SS ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/ShadowsocksD"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssd"]}"><i class="material-icons icon-sm">how_to_vote</i>拷贝链接</a>.<a id="win_ssd" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ssd","#win_ssd","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="https://github.com/Fndroid/clash_for_windows_pkg/releases"><i class="material-icons">save_alt</i> 下载</a> Clash for Windows - [ SS/VMess ]:</p>
<p><span class="icon icon-lg text-white">filter_3</span> <a class="btn-dl" href="{if $config["subscribe_client"]=='true'}/user/getPcClient?type=ssr-win{else}https://github.com/shadowsocksrr/shadowsocksr-csharp/releases{/if}"><i class="material-icons">save_alt</i> 下载</a> SSR(R) - [ SS/SSR ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/ShadowsocksR"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssr"]}&extend=1"><i class="material-icons icon-sm">how_to_vote</i>订阅链接</a>.<a id="win_ssr" class="copy-config btn-dl" onclick=Copyconfig("/user/getUserAllURL?type=ssr","#win_ssr","")><i class="material-icons icon-sm">how_to_vote</i>全部 URL</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_4</span> <a class="btn-dl" href="https://github.com/Fndroid/clash_for_windows_pkg/releases"><i class="material-icons">save_alt</i> 下载</a> Clash for Windows - [ SS/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/Windows/Clash-for-Windows"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="btn-dl" href="{$subInfo["clash"]}"><i class="material-icons icon-sm">how_to_vote</i>配置下载</a>.<a class="btn-dl" href="clash://install-config?url={urlencode($subInfo["clash"])}"><i class="material-icons icon-sm">how_to_vote</i>Clash for Windows 一键导入</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_5</span> <a class="btn-dl" href="https://t.me/clashr4ssr"><i class="material-icons">save_alt</i> 下载</a> ClashR for Windows - [ SS/SSR/VMess ]:</p>
<p>教程文档:自行摸索</p>
<p>使用方式:<a class="btn-dl" href="{$subInfo["clashr"]}"><i class="material-icons icon-sm">how_to_vote</i>配置下载</a>.<a class="btn-dl" href="clash://install-config?url={urlencode($subInfo["clashr"])}"><i class="material-icons icon-sm">how_to_vote</i>ClashR for Windows 一键导入</a></p>
</div>
<div class="tab-pane fade" id="sub_center_mac">
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="https://nssurge.com/mac/v3/Surge-latest.zip"><i class="material-icons">save_alt</i> 下载</a> Surge - [ SS ]:</p>
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="https://nssurge.com/mac/v3/Surge-latest.zip"><i class="material-icons">save_alt</i> 下载</a> Surge - [ SS/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/macOS/Surge"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge3"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 托管</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge_node"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 节点</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge2"]}"><i class="material-icons icon-sm">how_to_vote</i>2.x 托管</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge4"]}"><i class="material-icons icon-sm">how_to_vote</i>4.x 托管</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge3"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 托管</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge_node"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 节点</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge2"]}"><i class="material-icons icon-sm">how_to_vote</i>2.x 托管</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="https://github.com/yichengchen/clashX/releases"><i class="material-icons">save_alt</i> 下载</a> ClashX - [ SS/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/macOS/ClashX"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="btn-dl" href="{$subInfo["clash"]}"><i class="material-icons icon-sm">how_to_vote</i>配置下载</a>.<a class="btn-dl" href="clash://install-config?url={urlencode($subInfo["clash"])}"><i class="material-icons icon-sm">how_to_vote</i>ClashX 一键导入</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_3</span> <a class="btn-dl" href="https://t.me/clashr4ssr"><i class="material-icons">save_alt</i> 下载</a> ClashXR - [ SS/SSR/VMess ]:</p>
<p>教程文档:自行摸索</p>
<p>使用方式:<a class="btn-dl" href="{$subInfo["clashr"]}"><i class="material-icons icon-sm">how_to_vote</i>配置下载</a>.<a class="btn-dl" href="clash://install-config?url={urlencode($subInfo["clashr"])}"><i class="material-icons icon-sm">how_to_vote</i>ClashXR 一键导入</a></p>
</div>
<div class="tab-pane fade" id="sub_center_ios">
@ -435,9 +467,9 @@ table tr td:first-child {
<hr/>
{/if}
{/if}
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="https://itunes.apple.com/us/app/surge-3/id1442620678?ls=1&mt=8"><i class="material-icons">save_alt</i> 下载</a> Surge - [ SS ]:</p>
<p><span class="icon icon-lg text-white">filter_1</span> <a class="btn-dl" href="https://itunes.apple.com/us/app/surge-3/id1442620678?ls=1&mt=8"><i class="material-icons">save_alt</i> 下载</a> Surge - [ SS/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/iOS/Surge"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="btn-dl" href="surge3:///install-config?url={urlencode($subInfo["surge3"])}"><i class="material-icons icon-sm">how_to_vote</i>3.x 一键</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge_node"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 节点</a>.<a class="btn-dl" href="surge:///install-config?url={urlencode($subInfo["surge2"])}"><i class="material-icons icon-sm">how_to_vote</i>2.x 一键</a></p>
<p>使用方式:<a class="btn-dl" href="surge3:///install-config?url={urlencode($subInfo["surge4"])}"><i class="material-icons icon-sm">how_to_vote</i>4.x 一键</a>.<a class="btn-dl" href="surge3:///install-config?url={urlencode($subInfo["surge3"])}"><i class="material-icons icon-sm">how_to_vote</i>3.x 一键</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["surge_node"]}"><i class="material-icons icon-sm">how_to_vote</i>3.x 节点</a>.<a class="btn-dl" href="surge:///install-config?url={urlencode($subInfo["surge2"])}"><i class="material-icons icon-sm">how_to_vote</i>2.x 一键</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_2</span> <a class="btn-dl" href="https://itunes.apple.com/us/app/kitsunebi-proxy-utility/id1446584073?ls=1&mt=8"><i class="material-icons">save_alt</i> 下载</a> Kitsunebi - [ SS/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/iOS/Kitsunebi"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
@ -445,7 +477,7 @@ table tr td:first-child {
<hr/>
<p><span class="icon icon-lg text-white">filter_3</span> <a class="btn-dl" href="https://itunes.apple.com/us/app/quantumult/id1252015438?ls=1&mt=8"><i class="material-icons">save_alt</i> 下载</a> Quantumult - [ SS/SSR/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/iOS/Quantumult_sub"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["quantumult_v2"]}"><i class="material-icons icon-sm">how_to_vote</i>V2 订阅</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssr"]}&extend=1"><i class="material-icons icon-sm">how_to_vote</i>SSR 订阅</a>.<a id="quan_sub" class="copy-config btn-dl" onclick=Copyconfig("{$subInfo["quantumult_sub"]}","#quan_sub","quantumult://settings?configuration=clipboard")><i class="material-icons icon-sm">how_to_vote</i>完整订阅配置</a>.<a id="quan_conf" class="copy-config btn-dl" onclick=Copyconfig("{$subInfo["quantumult_conf"]}","#quan_conf","quantumult://settings?configuration=clipboard")><i class="material-icons icon-sm">how_to_vote</i>完整策略组配置</a></p>
<p>使用方式:<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["quantumult_v2"]}&extend=1"><i class="material-icons icon-sm">how_to_vote</i>V2 订阅</a>.<a class="copy-text btn-dl" data-clipboard-text="{$subInfo["ssr"]}&extend=1"><i class="material-icons icon-sm">how_to_vote</i>SSR 订阅</a>.<a id="quan_sub" class="copy-config btn-dl" onclick=Copyconfig("{$subInfo["quantumult_sub"]}","#quan_sub","quantumult://settings?configuration=clipboard")><i class="material-icons icon-sm">how_to_vote</i>完整订阅配置</a>.<a id="quan_conf" class="copy-config btn-dl" onclick=Copyconfig("{$subInfo["quantumult_conf"]}","#quan_conf","quantumult://settings?configuration=clipboard")><i class="material-icons icon-sm">how_to_vote</i>完整策略组配置</a></p>
<hr/>
<p><span class="icon icon-lg text-white">filter_4</span> <a class="btn-dl" href="https://itunes.apple.com/us/app/shadowrocket/id932747118?mt=8"><i class="material-icons">save_alt</i> 下载</a> Shadowrocket - [ SS/SSR/VMess ]:</p>
<p>教程文档:<a class="btn-dl" href="/doc/#/iOS/Shadowrocket"><i class="material-icons icon-sm">how_to_vote</i>点击查看</a></p>
@ -488,11 +520,7 @@ table tr td:first-child {
</div>
{include file='dialog.tpl'}
</div>
</div>
</section>
</section>
</div>
</main>
@ -508,37 +536,6 @@ table tr td:first-child {
return new Date(str_date_splited[0], str_date_splited[1] - 1, str_date_splited[2], str_date_splited[3], str_date_splited[4], str_date_splited[5]);
}
/*
* Author: neoFelhz & CloudHammer
* https://github.com/CloudHammer/CloudHammer/make-sspanel-v3-mod-great-again
* License: MIT license & SATA license
*/
function CountDown() {
var levelExpire = DateParse("{$user->class_expire}");
var accountExpire = DateParse("{$user->expire_in}");
var nowDate = new Date();
var a = nowDate.getTime();
var b = levelExpire - a;
var c = accountExpire - a;
var levelExpireDays = Math.floor(b / (24 * 3600 * 1000));
var accountExpireDays = Math.floor(c / (24 * 3600 * 1000));
if (levelExpireDays < 0 || levelExpireDays > 315360000000) {
document.getElementById('days-level-expire').innerHTML = "无限期";
for (var i = 0; i < document.getElementsByClassName('label-level-expire').length; i += 1) {
document.getElementsByClassName('label-level-expire')[i].style.display = 'none';
}
} else {
document.getElementById('days-level-expire').innerHTML = levelExpireDays;
}
if (accountExpireDays < 0 || accountExpireDays > 315360000000) {
document.getElementById('days-account-expire').innerHTML = "无限期";
for (var i = 0; i < document.getElementsByClassName('label-account-expire').length; i += 1) {
document.getElementsByClassName('label-account-expire')[i].style.display = 'none';
}
} else {
document.getElementById('days-account-expire').innerHTML = accountExpireDays;
}
}
</script>
<script>
@ -615,8 +612,6 @@ table tr td:first-child {
threshold: 15
});
myShakeEvent.start();
CountDown();
window.addEventListener('shake', shakeEventDidOccur, false);
function shakeEventDidOccur() {
if ("vibrate" in navigator) {

@ -33,7 +33,7 @@
<a class="dropdown-toggle padding-left-no padding-right-no" data-toggle="dropdown">
{if $user->isLogin}
<span class="access-hide">{$user->user_name}</span>
<span class="icon icon-cd margin-right">account_circle</span>
<span class="avatar avatar-sm"><img src="{$user->gravatar}"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li>
@ -44,6 +44,9 @@
<a class="padding-right-cd waves-attach" href="/user/logout"><span
class="icon icon-lg margin-right">exit_to_app</span>登出</a>
</li>
<li>
<a href="//en.gravatar.com/" target="view_window"><i class="icon icon-md t4-text">insert_photo</i>设置头像</a>
</li>
</ul>
{else}
<span class="access-hide">未登录</span>
@ -85,6 +88,12 @@
<a href="/user/trafficlog"><i class="icon icon-lg">hourglass_empty</i>&nbsp;流量记录</a>
</li>
{if $config['subscribeLog']=='true'}
<li>
<a href="/user/subscribe_log"><i class="icon icon-lg">important_devices</i>&nbsp;订阅记录</a>
</li>
{/if}
{if $config['enable_ticket']=='true'}
<li>
<a href="/user/ticket"><i class="icon icon-lg">question_answer</i>&nbsp;工单系统</a>

@ -196,6 +196,7 @@
</p>
<p><a href="{URL::getItemUrl($ssr_item, 0)}">iOS 上用 Safari
打开点我即可直接添加</a></p>
<p><button class="copy-text btn btn-subscription" type="button" data-clipboard-text="{URL::getItemUrl($ssr_item, 0)}">拷贝SSR链接</button></p>
{/if}
{else}
<p>您好,您目前的 加密方式,混淆,或者协议设置在 ShadowsocksR 客户端下无法连接。请您选用 Shadowsocks 客户端来连接,或者到
@ -213,6 +214,7 @@
</p>
<p><a href="{URL::getItemUrl($ss_item, 1)}">iOS 上用 Safari 打开点我即可直接添加</a>
</p>
<p><button class="copy-text btn btn-subscription" type="button" data-clipboard-text="{URL::getItemUrl($ss_item, 1)}">拷贝SS链接</button></p>
{/if}
{else}
<p>您好,您目前的 加密方式,混淆,或者协议设置在 Shadowsocks 客户端下无法连接。请您选用 ShadowsocksR 客户端来连接,或者到
@ -319,7 +321,16 @@
<script src="https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs@gh-pages/qrcode.min.js"></script>
<script>
$(function(){
new Clipboard('.copy-text');
});
$(".copy-text").click(function () {
$("#result").modal();
$("#msg").html("已复制到您的剪贴板,请您继续接下来的操作。");
});
</script>
<script>
$(function () {
new Clipboard('.copy-text');

@ -0,0 +1,62 @@
{include file='user/main.tpl'}
<main class="content">
<div class="content-header ui-content-header">
<div class="container">
<h1 class="content-heading">订阅记录</h1>
</div>
</div>
<div class="container">
<div class="col-lg-12 col-md-12">
<section class="content-inner margin-top-no">
<div class="card">
<div class="card-main">
<div class="card-inner">
<p>您可在此查询您账户最近 {$config['subscribeLog_keep_days']} 天的订阅记录,确保您的账户没有被盗用。</p>
</div>
</div>
</div>
<div class="card">
<div class="card-main">
<div class="card-inner">
<div class="card-table">
<div class="table-responsive table-user">
{$logs->render()}
<table class="table">
<tr>
<th>ID</th>
<th>订阅类型</th>
<th>IP</th>
<th>归属地</th>
<th>时间</th>
<th>User-Agent</th>
</tr>
{foreach $logs as $log}
<tr>
<td>#{$log->id}</td>
<td>{$log->subscribe_type}</td>
<td>{$log->request_ip}</td>
{assign var="location" value=$iplocation->getlocation($log->request_ip)}
<td>{iconv("gbk", "utf-8//IGNORE", $location.country)} {iconv("gbk", "utf-8//IGNORE", $location.area)}</td>
<td>{$log->request_time}</td>
<td>{$log->request_user_agent}</td>
</tr>
{/foreach}
</table>
{$logs->render()}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
{include file='user/footer.tpl'}

@ -0,0 +1,20 @@
--
-- 审计封禁日志
--
CREATE TABLE IF NOT EXISTS `detect_ban_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(128) NOT NULL COMMENT '用户名',
`user_id` int(11) NOT NULL COMMENT '用户 ID',
`email` varchar(32) NOT NULL COMMENT '用户邮箱',
`detect_number` int(11) NOT NULL COMMENT '本次违规次数',
`ban_time` int(11) NOT NULL COMMENT '本次封禁时长',
`start_time` bigint(20) NOT NULL COMMENT '统计开始时间',
`end_time` bigint(20) NOT NULL COMMENT '统计结束时间',
`all_detect_number` int(11) NOT NULL COMMENT '累计违规次数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='审计封禁日志';
ALTER TABLE `user` ADD `detect_ban` int(2) NOT NULL DEFAULT '0' AFTER `enable`;
ALTER TABLE `user` ADD `last_detect_ban_time` datetime DEFAULT '1989-06-04 00:05:00' AFTER `detect_ban`;
ALTER TABLE `user` ADD `all_detect_number` int(11) NOT NULL DEFAULT '0' AFTER `last_detect_ban_time`;

@ -697,4 +697,41 @@ ALTER TABLE `paylist`
ALTER TABLE `paylist`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;ALTER TABLE `user_traffic_log` CHANGE `u` `u` BIGINT(20) NOT NULL, CHANGE `d` `d` BIGINT(20) NOT NULL;
ALTER TABLE `user` ADD `discord` BIGINT NULL AFTER `telegram_id`;
ALTER TABLE `user` ADD `discord` BIGINT NULL AFTER `telegram_id`;
--
-- 用户订阅日志
--
CREATE TABLE IF NOT EXISTS `user_subscribe_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(128) NOT NULL COMMENT '用户名',
`user_id` int(11) NOT NULL COMMENT '用户 ID',
`email` varchar(32) NOT NULL COMMENT '用户邮箱',
`subscribe_type` varchar(20) DEFAULT NULL COMMENT '获取的订阅类型',
`request_ip` varchar(20) DEFAULT NULL COMMENT '请求 IP',
`request_time` datetime DEFAULT NULL COMMENT '请求时间',
`request_user_agent` text COMMENT '请求 UA 信息',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户订阅日志';
--
-- 审计封禁日志
--
CREATE TABLE IF NOT EXISTS `detect_ban_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(128) NOT NULL COMMENT '用户名',
`user_id` int(11) NOT NULL COMMENT '用户 ID',
`email` varchar(32) NOT NULL COMMENT '用户邮箱',
`detect_number` int(11) NOT NULL COMMENT '本次违规次数',
`ban_time` int(11) NOT NULL COMMENT '本次封禁时长',
`start_time` bigint(20) NOT NULL COMMENT '统计开始时间',
`end_time` bigint(20) NOT NULL COMMENT '统计结束时间',
`all_detect_number` int(11) NOT NULL COMMENT '累计违规次数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='审计封禁日志';
ALTER TABLE `user` ADD `detect_ban` int(2) NOT NULL DEFAULT '0' AFTER `enable`;
ALTER TABLE `user` ADD `last_detect_ban_time` datetime DEFAULT '1989-06-04 00:05:00' AFTER `detect_ban`;
ALTER TABLE `user` ADD `all_detect_number` int(11) NOT NULL DEFAULT '0' AFTER `last_detect_ban_time`;

@ -5,318 +5,312 @@
//config迁移附注(由开发者填写本次config迁移后需要注意的地方,站长勿动)
//如需换行,直接换行即可,无需换行符
//【新增/删除】config无需写入迁移附注
$System_Config['config_migrate_notice']=
'enable_geetest_* 已变更为 enable_*_captcha
$_ENV['config_migrate_notice'] =
'enable_geetest_* 已变更为 enable_*_captcha
crisp已被替换为mylivechat
telegrma_qrcode被重命名为qrcode
';
$System_Config['version']='1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
$_ENV['version'] = '1'; //仅当涉及【需要修改config以外的文件】时才需要+1,站长勿动
//基本设置--------------------------------------------------------------------------------------------
$System_Config['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$System_Config['debug'] = true; //正式环境请确保为 false
$System_Config['appName'] = 'sspanel uim test'; //站点名称
$System_Config['baseUrl'] = 'http://sspanel.host:23480'; //站点地址
$System_Config['subUrl'] = $System_Config['baseUrl'].'/link/'; //订阅地址,如需和站点名称相同,请不要修改
$System_Config['muKey'] = 'NimaQu'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
$System_Config['db_driver'] = 'mysql'; //数据库程序
$System_Config['db_host'] = 'localhost'; //数据库地址
$System_Config['db_database'] = 'sspanel'; //数据库名
$System_Config['db_username'] = 'root'; //数据库用户名
$System_Config['db_password'] = 'sspanel'; //用户名对应的密码
$_ENV['key'] = '1145141919810'; //!!! 瞎 jb 修改此key为随机字符串确保网站安全 !!!
$_ENV['debug'] = true; //正式环境请确保为 false
$_ENV['appName'] = 'sspanel uim test'; //站点名称
$_ENV['baseUrl'] = 'http://sspanel.host:23480'; //站点地址
$_ENV['subUrl'] = $_ENV['baseUrl'] . '/link/'; //订阅地址,如需和站点名称相同,请不要修改
$_ENV['muKey'] = 'NimaQu'; //用于校验魔改后端请求,可以随意修改,但请保持前后端一致,否则节点不能工作!
$_ENV['db_driver'] = 'mysql'; //数据库程序
$_ENV['db_host'] = 'localhost'; //数据库地址
$_ENV['db_database'] = 'sspanel'; //数据库名
$_ENV['db_username'] = 'root'; //数据库用户名
$_ENV['db_password'] = 'sspanel'; //用户名对应的密码
//邮件设置--------------------------------------------------------------------------------------------
$System_Config['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$System_Config['sendPageLimit']= 50; //发信分页 解决大站发公告超时问题
$_ENV['mailDriver'] = 'none'; //发送邮件方式:none / mailgun / smtp / sendgrid
$_ENV['sendPageLimit'] = 50; //发信分页 解决大站发公告超时问题
# mailgun
$System_Config['mailgun_key'] = '';
$System_Config['mailgun_domain'] = '';
$System_Config['mailgun_sender'] = '';
$_ENV['mailgun_key'] = '';
$_ENV['mailgun_domain'] = '';
$_ENV['mailgun_sender'] = '';
# smtp
$System_Config['smtp_host'] = '';
$System_Config['smtp_username'] = '';
$System_Config['smtp_port'] = '465';
$System_Config['smtp_name'] = '';
$System_Config['smtp_sender'] = '';
$System_Config['smtp_passsword'] = '';
$System_Config['smtp_ssl'] = 'true';
$_ENV['smtp_host'] = '';
$_ENV['smtp_username'] = '';
$_ENV['smtp_port'] = '465';
$_ENV['smtp_name'] = '';
$_ENV['smtp_sender'] = '';
$_ENV['smtp_passsword'] = '';
$_ENV['smtp_ssl'] = 'true';
# sendgrid
$System_Config['sendgrid_key'] = '';
$System_Config['sendgrid_sender'] = '';
$_ENV['sendgrid_key'] = '';
$_ENV['sendgrid_sender'] = '';
//备份设置--------------------------------------------------------------------------------------------
$System_Config['auto_backup_email']=''; //接收备份的邮箱
$System_Config['auto_backup_passwd']=''; //备份的压缩密码
$System_Config['backup_notify'] = 'false'; //备份通知到TG群中
$_ENV['auto_backup_email'] = ''; //接收备份的邮箱
$_ENV['auto_backup_passwd'] = ''; //备份的压缩密码
$_ENV['backup_notify'] = 'false'; //备份通知到TG群中
//用户注册设置-----------------------------------------------------------------------------------------
$System_Config['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$System_Config['defaultTraffic'] = '1'; //用户初始流量 单位GB
$System_Config['user_expire_in_default']='3650'; //用户账户过期时间,在注册时设置。(天)
$System_Config['user_class_default']='0'; //用户注册等级,在注册时设置。
$System_Config['user_class_expire_default']='24'; //用户等级过期时间,在注册时设置。(小时)
$System_Config['user_conn']='0'; //用户注册客户端数量限制,0为不限制
$System_Config['user_speedlimit']='0'; //用户注册速度默认限制,0为不限制
$System_Config['reg_auto_reset_day']='0'; //注册时的流量重置日,0为不重置
$System_Config['reg_auto_reset_bandwidth']='0'; //需要重置的流量,0为不重置
$System_Config['ramdom_group']='0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$System_Config['reg_method']='rc4-md5'; //注册时默认加密方式
$System_Config['reg_protocol']='origin'; //注册时默认协议
$System_Config['reg_protocol_param']=''; //注册时默认协议参数
$System_Config['reg_obfs']='plain'; //注册时默认混淆方式
$System_Config['reg_obfs_param']=''; //注册时默认混淆参数
$System_Config['reg_forbidden_ip']='127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$System_Config['min_port']='10000'; //用户端口池最小值
$System_Config['max_port']='65535'; //用户端口池最大值
$System_Config['reg_forbidden_port']=''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$System_Config['mu_suffix']='microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$System_Config['mu_regex']='%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
$_ENV['register_mode'] = 'open'; //注册模式。close:关闭,open:开放,invite:仅限邀请码
$_ENV['defaultTraffic'] = '1'; //用户初始流量 单位GB
$_ENV['user_expire_in_default'] = '3650'; //用户账户过期时间,在注册时设置。(天)
$_ENV['user_class_default'] = '0'; //用户注册等级,在注册时设置。
$_ENV['user_class_expire_default'] = '24'; //用户等级过期时间,在注册时设置。(小时)
$_ENV['user_conn'] = '0'; //用户注册客户端数量限制,0为不限制
$_ENV['user_speedlimit'] = '0'; //用户注册速度默认限制,0为不限制
$_ENV['reg_auto_reset_day'] = '0'; //注册时的流量重置日,0为不重置
$_ENV['reg_auto_reset_bandwidth'] = '0'; //需要重置的流量,0为不重置
$_ENV['ramdom_group'] = '0'; //注册时随机分组,注册时随机分配到的分组,多个分组请用英文半角逗号分隔。
$_ENV['reg_method'] = 'rc4-md5'; //注册时默认加密方式
$_ENV['reg_protocol'] = 'origin'; //注册时默认协议
$_ENV['reg_protocol_param'] = ''; //注册时默认协议参数
$_ENV['reg_obfs'] = 'plain'; //注册时默认混淆方式
$_ENV['reg_obfs_param'] = ''; //注册时默认混淆参数
$_ENV['reg_forbidden_ip'] = '127.0.0.0/8,::1/128'; //注册时默认禁止访问IP列表,半角英文逗号分割
$_ENV['min_port'] = '10000'; //用户端口池最小值
$_ENV['max_port'] = '65535'; //用户端口池最大值
$_ENV['reg_forbidden_port'] = ''; //注册时默认禁止访问端口列表,半角英文逗号分割,支持端口段
$_ENV['mu_suffix'] = 'microsoft.com'; //单端口多用户混淆参数后缀,可以随意修改,但请保持前后端一致
$_ENV['mu_regex'] = '%5m%id.%suffix'; //单端口多用户混淆参数表达式,%5m代表取用户特征 md5 的前五位,%id 代表用户id,%suffix 代表上面这个后缀。
#邀请链接
$System_Config['inviteNum'] = '10'; //注册后的邀请链接可用次数
$System_Config['invite_get_money']='1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$System_Config['invite_price']='-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$System_Config['custom_invite_price']='-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
$_ENV['inviteNum'] = '10'; //注册后的邀请链接可用次数
$_ENV['invite_get_money'] = '1'; //新用户通过私人邀请链接注册时,获得奖励金额(作为初始资金)
$_ENV['invite_price'] = '-1'; //用户购买邀请码所需要的价格,价格小于0时视为不开放购买
$_ENV['custom_invite_price'] = '-1'; //用户定制邀请码所需要的价格,价格小于0时视为不开放购买
#邮箱验证
$System_Config['enable_email_verify']='false'; //是否启用注册邮箱验证码
$System_Config['email_verify_ttl']='3600'; //邮箱验证码有效期
$System_Config['email_verify_iplimit']='10'; //验证码有效期内,单IP可请求验证码次数
$_ENV['enable_email_verify'] = 'false'; //是否启用注册邮箱验证码
$_ENV['email_verify_ttl'] = '3600'; //邮箱验证码有效期
$_ENV['email_verify_iplimit'] = '10'; //验证码有效期内,单IP可请求验证码次数
//已注册用户设置---------------------------------------------------------------------------------------
#基础
$System_Config['checkinMin'] = '1'; //用户签到最少流量 单位MB
$System_Config['checkinMax'] = '50'; //用户签到最多流量
$System_Config['auto_clean_uncheck_days']='-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭
$System_Config['auto_clean_unused_days']='-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭
$System_Config['auto_clean_min_money']='1'; //余额低于多少的0级用户可以被清理
$System_Config['code_payback']='20'; //充值返利百分比
$System_Config['invite_gift']='2'; //邀请新用户获得流量奖励,单位G
$System_Config['enable_bought_reset']='true'; //购买时是否重置流量
$System_Config['enable_bought_extend']='true'; //购买时是否延长等级期限(同等级配套)
$System_Config['port_price']='-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$System_Config['port_price_specify']='-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
$_ENV['checkinMin'] = '1'; //用户签到最少流量 单位MB
$_ENV['checkinMax'] = '50'; //用户签到最多流量
$_ENV['auto_clean_uncheck_days'] = '-1'; //自动清理多少天没签到的0级用户,小于等于0时关闭
$_ENV['auto_clean_unused_days'] = '-1'; //自动清理多少天没使用的0级用户,小于等于0时关闭
$_ENV['auto_clean_min_money'] = '1'; //余额低于多少的0级用户可以被清理
$_ENV['code_payback'] = '20'; //充值返利百分比
$_ENV['invite_gift'] = '2'; //邀请新用户获得流量奖励,单位G
$_ENV['enable_bought_reset'] = 'true'; //购买时是否重置流量
$_ENV['enable_bought_extend'] = 'true'; //购买时是否延长等级期限(同等级配套)
$_ENV['port_price'] = '-1'; //用户随机重置端口所需要的价格,价格小于0时视为不开放购买
$_ENV['port_price_specify'] = '-1'; //用户指明钦定端口所需要的价格,价格小于0时视为不开放购买
#高级
$System_Config['class_expire_reset_traffic']='0'; //等级到期时重置为的流量值,单位GB,小于0时不重置
$System_Config['account_expire_delete_days']='-1'; //账户到期几天之后会删除账户,小于0时不删除
$System_Config['enable_kill']='true'; //是否允许用户注销账户
$System_Config['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$System_Config['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$System_Config['mergeSub'] = 'false'; //合并订阅设置 可选项 false / true
$_ENV['class_expire_reset_traffic'] = '0'; //等级到期时重置为的流量值,单位GB,小于0时不重置
$_ENV['account_expire_delete_days'] = '-1'; //账户到期几天之后会删除账户,小于0时不删除
$_ENV['enable_kill'] = 'true'; //是否允许用户注销账户
$_ENV['notify_limit_mode'] = 'false'; //false为关闭,per为按照百分比提醒,mb为按照固定剩余流量提醒
$_ENV['notify_limit_value'] = '20'; //当上一项为per时,此处填写百分比;当上一项为mb时,此处填写流量
$_ENV['mergeSub'] = 'false'; //合并订阅设置 可选项 false / true
//Bot 设置--------------------------------------------------------------------------------------------
#通用
$System_Config['qrcode']='zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$System_Config['finance_public']='false'; //财务报告是否向群公开
$System_Config['enable_welcome_message']='true'; //机器人发送欢迎消息
$_ENV['qrcode'] = 'zxing_local'; //二维码解码方式,online,phpzbar,zxing_online,zxing_local
$_ENV['finance_public'] = 'false'; //财务报告是否向群公开
$_ENV['enable_welcome_message'] = 'true'; //机器人发送欢迎消息
#Discord
$System_Config['enable_discord']='false'; //是否开启Discord bot(仍未完成)
$System_Config['discord_token']=''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请
$_ENV['enable_discord'] = 'false'; //是否开启Discord bot(仍未完成)
$_ENV['discord_token'] = ''; //Discord bot,bot 的 token,在 https://discordapp.com/developers/applications/ 申请
#Telegram
$System_Config['enable_telegram']='false'; //是否开启Telegram bot
$System_Config['telegram_token']=''; //Telegram bot,bot 的 token ,跟 father bot 申请
$System_Config['telegram_chatid']=''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$System_Config['enable_tuling']='false'; //是否开启图灵机器人
$System_Config['tuling_apikey']=''; //图灵机器人API Key
$System_Config['tuling_apisecert']=''; //图灵机器人密钥
$System_Config['telegram_bot']='_bot'; //Telegram 机器人账号
$System_Config['telegram_group_quiet']='false'; //Telegram 机器人在群组中不回应
$System_Config['telegram_request_token']=''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
$_ENV['enable_telegram'] = 'false'; //是否开启Telegram bot
$_ENV['telegram_token'] = ''; //Telegram bot,bot 的 token ,跟 father bot 申请
$_ENV['telegram_chatid'] = ''; //Telegram bot,群组会话 ID,把机器人拉进群里之后跟他 /ping 一下即可得到。
$_ENV['enable_tuling'] = 'false'; //是否开启图灵机器人
$_ENV['tuling_apikey'] = ''; //图灵机器人API Key
$_ENV['tuling_apisecert'] = ''; //图灵机器人密钥
$_ENV['telegram_bot'] = '_bot'; //Telegram 机器人账号
$_ENV['telegram_group_quiet'] = 'false'; //Telegram 机器人在群组中不回应
$_ENV['telegram_request_token'] = ''; //Telegram 机器人请求Key,随意设置,由大小写英文和数字组成,更新这个参数之后请 php xcat setTelegram
//沟通设置--------------------------------------------------------------------------------------------
#客服系统设置,注册地址 https://www.mylivechat.com
$System_Config['enable_mylivechat']='false'; //是否开启客服系统
$System_Config['mylivechat_id']='null'; //客服系统ID
$_ENV['enable_mylivechat'] = 'false'; //是否开启客服系统
$_ENV['mylivechat_id'] = 'null'; //客服系统ID
# PushBear 基于微信模板的向关注了二维码的用户以微信方式推送消息 https://pushbear.ftqq.com/
$System_Config['usePushBear'] = 'false'; // true 启用 false 禁用
$System_Config['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错
$_ENV['usePushBear'] = 'false'; // true 启用 false 禁用
$_ENV['PushBear_sendkey'] = ''; //请填写您在PushBear获取的sendkey 请仔细检查勿粘贴错
#工单系统设置
$System_Config['enable_ticket']='true'; //是否开启工单系统
$System_Config['mail_ticket']='true'; //是否开启工单邮件提醒
$_ENV['enable_ticket'] = 'true'; //是否开启工单系统
$_ENV['mail_ticket'] = 'true'; //是否开启工单邮件提醒
# Server酱 用户提交新工单或者回复工单时用微信提醒机场主 http://sc.ftqq.com/
$System_Config['useScFtqq'] = 'false'; //是否开启工单Server酱提醒
$System_Config['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错
$_ENV['useScFtqq'] = 'false'; //是否开启工单Server酱提醒
$_ENV['ScFtqq_SCKEY'] = ''; //请填写您在Server酱获取的SCKEY 请仔细检查勿粘贴错
#管理员联系方式设置
$System_Config['enable_admin_contact']='false'; //是否开启管理员联系方式
$System_Config['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$System_Config['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$System_Config['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
$_ENV['enable_admin_contact'] = 'false'; //是否开启管理员联系方式
$_ENV['admin_contact1'] = 'QQ:1233456'; //QQ、邮箱、微信仅用于举例
$_ENV['admin_contact2'] = '邮箱123456@qq.com'; //也可以写电话、tg等其他联系方式
$_ENV['admin_contact3'] = '微信~123456'; //没有格式要求,想怎么写就怎么写,可留空
//验证码设置------------------------------------------------------------------------------------------
$System_Config['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$_ENV['captcha_provider'] = 'recaptcha'; //取值 recaptcha | geetest(极验)
$System_Config['recaptcha_sitekey'] = '';
$System_Config['recaptcha_secret'] = '';
$_ENV['recaptcha_sitekey'] = '';
$_ENV['recaptcha_secret'] = '';
$System_Config['geetest_id'] = '';
$System_Config['geetest_key'] = '';
$_ENV['geetest_id'] = '';
$_ENV['geetest_key'] = '';
$System_Config['enable_reg_captcha'] = 'false'; //启用注册验证码
$System_Config['enable_login_captcha'] = 'false'; //启用登录验证码
$System_Config['enable_checkin_captcha'] = 'false'; //启用签到验证码
$_ENV['enable_reg_captcha'] = 'false'; //启用注册验证码
$_ENV['enable_login_captcha'] = 'false'; //启用登录验证码
$_ENV['enable_checkin_captcha'] = 'false'; //启用签到验证码
//支付系统设置----------------------------------------------------------------------------------------
#取值 none | codepay | trimepay | f2fpay | chenAlipay | paymentwall | spay |tomatopay
$System_Config['payment_system']='none';
$_ENV['payment_system'] = 'none';
#codepay码支付
#wiki地址:https://goo.gl/dRwRDi http://t.cn/RnsWjtB
$System_Config['codepay_id']=''; //码支付ID
$System_Config['codepay_key']=''; //码支付通信密钥
$_ENV['codepay_id'] = ''; //码支付ID
$_ENV['codepay_key'] = ''; //码支付通信密钥
#alipay,f2fpay
$System_Config['f2fpay_app_id']='';
$System_Config['f2fpay_p_id']='';
$System_Config['alipay_public_key']='';
$System_Config['merchant_private_key']='';
$System_Config['f2fNotifyUrl']=null; //自定义当面付回调地址
$_ENV['f2fpay_app_id'] = '';
$_ENV['f2fpay_p_id'] = '';
$_ENV['alipay_public_key'] = '';
$_ENV['merchant_private_key'] = '';
$_ENV['f2fNotifyUrl'] = null; //自定义当面付回调地址
#PaymentWall
$System_Config['pmw_publickey']='';
$System_Config['pmw_privatekey']='';
$System_Config['pmw_widget']='m2_1';
$System_Config['pmw_height']='350px';
$_ENV['pmw_publickey'] = '';
$_ENV['pmw_privatekey'] = '';
$_ENV['pmw_widget'] = 'm2_1';
$_ENV['pmw_height'] = '350px';
#alipay,spay
$System_Config['alipay_id']='';
$System_Config['alipay_key']='';
$System_Config['amount']=[2,23,233,2333,23333]; //充值金额选项设定
$_ENV['alipay_id'] = '';
$_ENV['alipay_key'] = '';
$_ENV['amount'] = [2, 23, 233, 2333, 23333]; //充值金额选项设定
#alipay,zfbjk.com
$System_Config['zfbjk_pid']='';
$System_Config['zfbjk_key']='';
$System_Config['zfbjk_qrcodeurl']='';
$_ENV['zfbjk_pid'] = '';
$_ENV['zfbjk_key'] = '';
$_ENV['zfbjk_qrcodeurl'] = '';
#Trimepay https://portal.trimepay.com/#/auth/register/134
$System_Config['trimepay_appid']=''; //AppID
$System_Config['trimepay_secret']=''; //AppSecret
$_ENV['trimepay_appid'] = ''; //AppID
$_ENV['trimepay_secret'] = ''; //AppSecret
# BitPay 数字货币支付(比特币、以太坊、EOS等) 商户后台获取授权码 https://merchants.mugglepay.com/
# 客服和技术 24x7 在线支持: https://t.me/joinchat/GLKSKhUnE4GvEAPgqtChAQ
$System_Config['bitpay_secret']='';
$_ENV['bitpay_secret'] = '';
//其他面板显示设置------------------------------------------------------------------------------------------
#后台商品列表 销量统计
$System_Config['sales_period']='30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】
$_ENV['sales_period'] = '30'; //统计指定周期内的销量,值为【expire/任意大于0的整数】
#国旗
$System_Config['enable_flag']='false'; //启用该项之前务必先仔细阅读教程
$System_Config['flag_regex']='/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
$_ENV['enable_flag'] = 'false'; //启用该项之前务必先仔细阅读教程
$_ENV['flag_regex'] = '/.*?(?=\s)/'; //从站点全名中匹配【国家/地区】的正则表达式(php版)
#捐赠
$System_Config['enable_donate']='false'; //是否显示用户捐赠(所有收入将被公开)
$_ENV['enable_donate'] = 'false'; //是否显示用户捐赠(所有收入将被公开)
#iOS账户显示
$System_Config['display_ios_class']='-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能
$System_Config['display_ios_topup']='0'; //满足等级要求后,累计充值高于多少的用户可以看见
$System_Config['ios_account']=''; //iOS账户
$System_Config['ios_password']=''; //iOS密码
$_ENV['display_ios_class'] = '-1'; //至少等级为多少的用户可以看见,小于0时关闭此功能
$_ENV['display_ios_topup'] = '0'; //满足等级要求后,累计充值高于多少的用户可以看见
$_ENV['ios_account'] = ''; //iOS账户
$_ENV['ios_password'] = ''; //iOS密码
//节点检测-----------------------------------------------------------------------------------------------
#GFW检测,请通过crontab进行【开启/关闭】
$System_Config['detect_gfw_interval']='3600'; //检测间隔,单位:秒,低于推荐值会爆炸
$System_Config['detect_gfw_port']='22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$System_Config['detect_gfw_url']='https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$System_Config['detect_gfw_judge']='$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$System_Config['detect_gfw_count']='3'; //尝试次数
$_ENV['detect_gfw_interval'] = '3600'; //检测间隔,单位:秒,低于推荐值会爆炸
$_ENV['detect_gfw_port'] = '22'; //所有节点服务器都打开的TCP端口,常用的为22(SSH端口)
$_ENV['detect_gfw_url'] = 'https://cn-qz-tcping.torch.njs.app/{ip}/{port}'; //检测节点是否被gfw墙了的API的URL
$_ENV['detect_gfw_judge'] = '$json_tcping[\'status\']=="true"'; //判断是否被墙的依据,json_tcping为上方URL返回的json数组
$_ENV['detect_gfw_count'] = '3'; //尝试次数
#离线检测
$System_Config['enable_detect_offline']='true';
$_ENV['enable_detect_offline'] = 'true';
#离线检测是否推送到Server酱 请配置好上文的Server配置
$System_Config['enable_detect_offline_useScFtqq']='true';
$_ENV['enable_detect_offline_useScFtqq'] = 'true';
//V2Ray相关设置------------------------------------------------------------------------------------------
$System_Config['v2ray_port']='443'; //V2Ray端口
$System_Config['v2ray_protocol']='HTTP/2 + TLS'; //V2Ray协议
$System_Config['v2ray_alter_id']='32';
$System_Config['v2ray_level']='0';
$_ENV['v2ray_port'] = '443'; //V2Ray端口
$_ENV['v2ray_protocol'] = 'HTTP/2 + TLS'; //V2Ray协议
$_ENV['v2ray_alter_id'] = '32';
$_ENV['v2ray_level'] = '0';
//以下所有均为高级设置(一般用不上,不用改---------------------------------------------------------------------
#杂项
$System_Config['enable_login_bind_ip']='false'; //是否将登陆线程和IP绑定
$System_Config['rememberMeDuration']='7'; //登录时记住账号时长天数
$System_Config['authDriver'] = 'cookie'; //不能更改此项
$System_Config['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$System_Config['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$System_Config['sessionDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['cacheDriver'] = 'cookie'; //可选: cookie,redis
$System_Config['tokenDriver'] = 'db'; //可选: db,redis
$System_Config['jump_delay']='1200'; //跳转延时,单位ms,不建议太长
$System_Config['theme'] = 'material'; //主题
$System_Config['pacp_offset']='-20000'; //VPN 端口偏移
$System_Config['pacpp_offset']='-20000';
$System_Config['Speedtest_duration']='6'; //显示多长时间的测速记录
$System_Config['login_warn']='false'; //异地登陆提示
$System_Config['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$System_Config['db_charset'] = 'utf8';
$System_Config['db_collation'] = 'utf8_general_ci';
$System_Config['db_prefix'] = '';
$System_Config['muKeyList'] = [' ']; //多 key 列表
$_ENV['enable_login_bind_ip'] = 'false'; //是否将登陆线程和IP绑定
$_ENV['rememberMeDuration'] = '7'; //登录时记住账号时长天数
$_ENV['authDriver'] = 'cookie'; //不能更改此项
$_ENV['pwdMethod'] = 'md5'; //密码加密 可选 md5, sha256, bcrypt, argon2i, argon2id(argon2i需要至少php7.2)
$_ENV['salt'] = ''; //推荐配合 md5/sha256, bcrypt/argon2i/argon2id 会忽略此项
$_ENV['sessionDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['cacheDriver'] = 'cookie'; //可选: cookie,redis
$_ENV['tokenDriver'] = 'db'; //可选: db,redis
$_ENV['jump_delay'] = '1200'; //跳转延时,单位ms,不建议太长
$_ENV['theme'] = 'material'; //主题
$_ENV['pacp_offset'] = '-20000'; //VPN 端口偏移
$_ENV['pacpp_offset'] = '-20000';
$_ENV['Speedtest_duration'] = '6'; //显示多长时间的测速记录
$_ENV['login_warn'] = 'false'; //异地登陆提示
$_ENV['timeZone'] = 'PRC'; //PRC 天朝时间 UTC 格林时间
$_ENV['db_charset'] = 'utf8';
$_ENV['db_collation'] = 'utf8_general_ci';
$_ENV['db_prefix'] = '';
$_ENV['muKeyList'] = [' ']; //多 key 列表
#aws
$System_Config['aws_access_key_id'] = '';
$System_Config['aws_secret_access_key'] = '';
$_ENV['aws_access_key_id'] = '';
$_ENV['aws_secret_access_key'] = '';
#redis
$System_Config['redis_scheme'] = 'tcp';
$System_Config['redis_host'] = '127.0.0.1';
$System_Config['redis_port'] = '6379';
$System_Config['redis_database'] = '0';
$System_Config['redis_password']= '';
$_ENV['redis_scheme'] = 'tcp';
$_ENV['redis_host'] = '127.0.0.1';
$_ENV['redis_port'] = '6379';
$_ENV['redis_database'] = '0';
$_ENV['redis_password'] = '';
#Radius设置
$System_Config['enable_radius']='false'; //是否开启Radius
$System_Config['radius_db_host']=''; //以下4项为Radius数据库设置
$System_Config['radius_db_database']='';
$System_Config['radius_db_user']='';
$System_Config['radius_db_password']='';
$System_Config['radius_secret']=''; //Radius连接密钥
$_ENV['enable_radius'] = 'false'; //是否开启Radius
$_ENV['radius_db_host'] = ''; //以下4项为Radius数据库设置
$_ENV['radius_db_database'] = '';
$_ENV['radius_db_user'] = '';
$_ENV['radius_db_password'] = '';
$_ENV['radius_secret'] = ''; //Radius连接密钥
#Cloudxns
$System_Config['enable_cloudxns']='false'; //是否开启Cloudxns
$System_Config['cloudxns_apikey']=''; //自己去 cloudxns.net 申请
$System_Config['cloudxns_apisecret']='';
$System_Config['cloudxns_domain']=''; //你的域名
$_ENV['enable_cloudxns'] = 'false'; //是否开启Cloudxns
$_ENV['cloudxns_apikey'] = ''; //自己去 cloudxns.net 申请
$_ENV['cloudxns_apisecret'] = '';
$_ENV['cloudxns_domain'] = ''; //你的域名
#Cloudflare
$System_Config['cloudflare_enable']='false'; //是否开启 Cloudflare 解析
$System_Config['cloudflare_email']='user@example.com'; //Cloudflare 邮箱地址
$System_Config['cloudflare_key']='c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$System_Config['cloudflare_name']='example.com'; //域名
$_ENV['cloudflare_enable'] = 'false'; //是否开启 Cloudflare 解析
$_ENV['cloudflare_email'] = 'user@example.com'; //Cloudflare 邮箱地址
$_ENV['cloudflare_key'] = 'c2547eb745079dac9320b638f5e225cf483cc5cfdda41'; //Cloudflare API Key
$_ENV['cloudflare_name'] = 'example.com'; //域名
#不安全中转模式,这个开启之后使用除了 auth_aes128_md5 或者 auth_aes128_sha1 以外的协议地用户也可以设置和使用中转
$System_Config['relay_insecure_mode']='false'; //强烈推荐不开启
$_ENV['relay_insecure_mode'] = 'false'; //强烈推荐不开启
#是否夹带统计代码,自己在 resources/views/{主题名} 下创建一个 analytics.tpl ,如果有必要就用 literal 界定符
$System_Config['enable_analytics_code']='false';
$System_Config['sspanelAnalysis'] = 'true';
#在套了CDN之后获取用户真实ip,如果您不知道这是什么,请不要乱动
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
$list = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
$_SERVER['REMOTE_ADDR'] = $list[0];
}
$_ENV['enable_analytics_code'] = 'false';
$_ENV['sspanelAnalysis'] = 'true';

Loading…
Cancel
Save