mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 11:20:53 +08:00
refactor: refactor subscription delivery logic, change payment return_url to origin_url concatenation
- Unify protocol filter configuration to client.type.field (dot-path, three-segment) format, support strict whitelist mode - Refactor AbstractProtocol and all protocol classes for more flexible and maintainable subscription delivery - Change payment callback logic: use origin_url concatenation instead of return_url for more accurate redirects
This commit is contained in:
@@ -5,10 +5,16 @@ namespace App\Protocols;
|
||||
use App\Utils\Helper;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use App\Support\AbstractProtocol;
|
||||
use App\Models\Server;
|
||||
|
||||
class Surfboard extends AbstractProtocol
|
||||
{
|
||||
public $flags = ['surfboard'];
|
||||
public $allowedProtocols = [
|
||||
Server::TYPE_SHADOWSOCKS,
|
||||
Server::TYPE_VMESS,
|
||||
Server::TYPE_TROJAN,
|
||||
];
|
||||
const CUSTOM_TEMPLATE_FILE = 'resources/rules/custom.surfboard.conf';
|
||||
const DEFAULT_TEMPLATE_FILE = 'resources/rules/default.surfboard.conf';
|
||||
|
||||
@@ -25,7 +31,7 @@ class Surfboard extends AbstractProtocol
|
||||
|
||||
foreach ($servers as $item) {
|
||||
if (
|
||||
$item['type'] === 'shadowsocks'
|
||||
$item['type'] === Server::TYPE_SHADOWSOCKS
|
||||
&& in_array(data_get($item, 'protocol_settings.cipher'), [
|
||||
'aes-128-gcm',
|
||||
'aes-192-gcm',
|
||||
@@ -38,13 +44,13 @@ class Surfboard extends AbstractProtocol
|
||||
// [Proxy Group]
|
||||
$proxyGroup .= $item['name'] . ', ';
|
||||
}
|
||||
if ($item['type'] === 'vmess') {
|
||||
if ($item['type'] === Server::TYPE_VMESS) {
|
||||
// [Proxy]
|
||||
$proxies .= self::buildVmess($item['password'], $item);
|
||||
// [Proxy Group]
|
||||
$proxyGroup .= $item['name'] . ', ';
|
||||
}
|
||||
if ($item['type'] === 'trojan') {
|
||||
if ($item['type'] === Server::TYPE_TROJAN) {
|
||||
// [Proxy]
|
||||
$proxies .= self::buildTrojan($item['password'], $item);
|
||||
// [Proxy Group]
|
||||
|
||||
Reference in New Issue
Block a user