mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
Merge branch 'dev' of https://github.com/v2board/v2board into dev
This commit is contained in:
commit
6d9ab7dfe2
@ -135,7 +135,7 @@ class UserController extends Controller
|
|||||||
$subscribeUrl = $baseUrl . '/api/v1/client/subscribe?token=' . $user['token'];
|
$subscribeUrl = $baseUrl . '/api/v1/client/subscribe?token=' . $user['token'];
|
||||||
$data .= "{$user['email']},{$balance},{$commissionBalance},{$transferEnable},{$notUseFlow},{$expireDate},{$planName},{$subscribeUrl}\r\n";
|
$data .= "{$user['email']},{$balance},{$commissionBalance},{$transferEnable},{$notUseFlow},{$expireDate},{$planName},{$subscribeUrl}\r\n";
|
||||||
}
|
}
|
||||||
echo $data;
|
echo "\xEF\xBB\xBF" . $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generate(UserGenerate $request)
|
public function generate(UserGenerate $request)
|
||||||
|
@ -9,7 +9,6 @@ use App\Utils\CacheKey;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\ServerTrojan;
|
|
||||||
use App\Models\ServerLog;
|
use App\Models\ServerLog;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
@ -91,7 +90,7 @@ class ShadowsocksTidalabController extends Controller
|
|||||||
$item['u'],
|
$item['u'],
|
||||||
$item['d'],
|
$item['d'],
|
||||||
$server->rate,
|
$server->rate,
|
||||||
'trojan'
|
'shadowsocks'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
@ -32,8 +32,8 @@ class Clash
|
|||||||
if ($server->tls) {
|
if ($server->tls) {
|
||||||
$tlsSettings = json_decode($server->tlsSettings);
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
$array['tls'] = true;
|
$array['tls'] = true;
|
||||||
if (isset($tlsSettings->allowInsecure)) $array['skip-cert-verify'] = ($tlsSettings->allowInsecure ? true : false );
|
if (!empty($tlsSettings->allowInsecure)) $array['skip-cert-verify'] = ($tlsSettings->allowInsecure ? true : false );
|
||||||
if (isset($tlsSettings->serverName)) $array['servername'] = $tlsSettings->serverName;
|
if (!empty($tlsSettings->serverName)) $array['servername'] = $tlsSettings->serverName;
|
||||||
}
|
}
|
||||||
if ($server->network == 'ws') {
|
if ($server->network == 'ws') {
|
||||||
$array['network'] = $server->network;
|
$array['network'] = $server->network;
|
||||||
@ -57,12 +57,8 @@ class Clash
|
|||||||
$array['port'] = $server->port;
|
$array['port'] = $server->port;
|
||||||
$array['password'] = $password;
|
$array['password'] = $password;
|
||||||
$array['udp'] = true;
|
$array['udp'] = true;
|
||||||
$array['sni'] = $server->server_name;
|
if (!empty($server->server_name)) $array['sni'] = $server->server_name;
|
||||||
if ($server->allow_insecure) {
|
if (!empty($server->allow_insecure)) $array['skip-cert-verify'] = ($server->allow_insecure ? true : false );
|
||||||
$array['skip-cert-verify'] = true;
|
|
||||||
} else {
|
|
||||||
$array['skip-cert-verify'] = false;
|
|
||||||
}
|
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@ class QuantumultX
|
|||||||
"shadowsocks={$server->host}:{$server->port}",
|
"shadowsocks={$server->host}:{$server->port}",
|
||||||
"method={$server->cipher}",
|
"method={$server->cipher}",
|
||||||
"password={$password}",
|
"password={$password}",
|
||||||
"fast-open=true",
|
'fast-open=true',
|
||||||
"udp-relay=true",
|
'udp-relay=true',
|
||||||
"tag={$server->name}"
|
"tag={$server->name}"
|
||||||
];
|
];
|
||||||
$config = array_filter($config);
|
$config = array_filter($config);
|
||||||
@ -25,8 +25,10 @@ class QuantumultX
|
|||||||
{
|
{
|
||||||
$config = [
|
$config = [
|
||||||
"vmess={$server->host}:{$server->port}",
|
"vmess={$server->host}:{$server->port}",
|
||||||
"method=chacha20-poly1305",
|
'method=chacha20-poly1305',
|
||||||
"password={$uuid}",
|
"password={$uuid}",
|
||||||
|
'fast-open=true',
|
||||||
|
'udp-relay=true',
|
||||||
"tag={$server->name}"
|
"tag={$server->name}"
|
||||||
];
|
];
|
||||||
if ($server->network === 'tcp') {
|
if ($server->network === 'tcp') {
|
||||||
@ -37,7 +39,7 @@ class QuantumultX
|
|||||||
// Tips: allowInsecure=false = tls-verification=true
|
// Tips: allowInsecure=false = tls-verification=true
|
||||||
array_push($config, $tlsSettings->allowInsecure ? 'tls-verification=false' : 'tls-verification=true');
|
array_push($config, $tlsSettings->allowInsecure ? 'tls-verification=false' : 'tls-verification=true');
|
||||||
}
|
}
|
||||||
if (isset($tlsSettings->serverName)) {
|
if (!empty($tlsSettings->serverName)) {
|
||||||
array_push($config, "obfs-host={$tlsSettings->serverName}");
|
array_push($config, "obfs-host={$tlsSettings->serverName}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,12 +72,12 @@ class QuantumultX
|
|||||||
$config = [
|
$config = [
|
||||||
"trojan={$server->host}:{$server->port}",
|
"trojan={$server->host}:{$server->port}",
|
||||||
"password={$password}",
|
"password={$password}",
|
||||||
"over-tls=true",
|
'over-tls=true',
|
||||||
$server->server_name ? "tls-host={$server->server_name}" : "",
|
$server->server_name ? "tls-host={$server->server_name}" : "",
|
||||||
// Tips: allowInsecure=false = tls-verification=true
|
// Tips: allowInsecure=false = tls-verification=true
|
||||||
$server->allow_insecure ? 'tls-verification=false' : 'tls-verification=true',
|
$server->allow_insecure ? 'tls-verification=false' : 'tls-verification=true',
|
||||||
"fast-open=false",
|
'fast-open=true',
|
||||||
"udp-relay=false",
|
'udp-relay=true',
|
||||||
"tag={$server->name}"
|
"tag={$server->name}"
|
||||||
];
|
];
|
||||||
$config = array_filter($config);
|
$config = array_filter($config);
|
||||||
|
@ -12,10 +12,10 @@ class Surfboard
|
|||||||
"{$server->host}",
|
"{$server->host}",
|
||||||
"{$server->port}",
|
"{$server->port}",
|
||||||
"{$server->cipher}",
|
"{$server->cipher}",
|
||||||
"password={$password}",
|
"{$password}",
|
||||||
"https://raw.githubusercontent.com/Hackl0us/proxy-tool-backup/master/SSEncrypt.module",
|
'https://raw.githubusercontent.com/Hackl0us/proxy-tool-backup/master/SSEncrypt.module',
|
||||||
"tfo=true",
|
'tfo=true',
|
||||||
"udp-relay=true"
|
'udp-relay=true'
|
||||||
];
|
];
|
||||||
$config = array_filter($config);
|
$config = array_filter($config);
|
||||||
$uri = implode(',', $config);
|
$uri = implode(',', $config);
|
||||||
@ -30,19 +30,16 @@ class Surfboard
|
|||||||
"{$server->host}",
|
"{$server->host}",
|
||||||
"{$server->port}",
|
"{$server->port}",
|
||||||
"username={$uuid}",
|
"username={$uuid}",
|
||||||
"tfo=true",
|
'tfo=true',
|
||||||
"udp-relay=false"
|
'udp-relay=true'
|
||||||
];
|
];
|
||||||
if ($server->network === 'tcp') {
|
if ($server->network === 'tcp') {
|
||||||
if ($server->tls) {
|
if ($server->tls) {
|
||||||
$tlsSettings = json_decode($server->tlsSettings);
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
||||||
if (isset($tlsSettings->allowInsecure)) {
|
if (!empty($tlsSettings->allowInsecure)) {
|
||||||
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
||||||
}
|
}
|
||||||
if (isset($tlsSettings->serverName)) {
|
|
||||||
array_push($config, "obfs-host={$tlsSettings->serverName}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +48,7 @@ class Surfboard
|
|||||||
if ($server->tls) {
|
if ($server->tls) {
|
||||||
$tlsSettings = json_decode($server->tlsSettings);
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
||||||
if (isset($tlsSettings->allowInsecure)) {
|
if (!empty($tlsSettings->allowInsecure)) {
|
||||||
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ class Surge
|
|||||||
"{$server->port}",
|
"{$server->port}",
|
||||||
"encrypt-method={$server->cipher}",
|
"encrypt-method={$server->cipher}",
|
||||||
"password={$password}",
|
"password={$password}",
|
||||||
"tfo=true",
|
'tfo=true',
|
||||||
"udp-relay=true"
|
'udp-relay=true'
|
||||||
];
|
];
|
||||||
$config = array_filter($config);
|
$config = array_filter($config);
|
||||||
$uri = implode(',', $config);
|
$uri = implode(',', $config);
|
||||||
@ -24,24 +24,46 @@ class Surge
|
|||||||
|
|
||||||
public static function buildVmess($uuid, $server)
|
public static function buildVmess($uuid, $server)
|
||||||
{
|
{
|
||||||
$proxies = $server->name . ' = vmess, ' . $server->host . ', ' . $server->port . ', username=' . $uuid . ', tfo=true';
|
$config = [
|
||||||
|
"{$server->name}=vmess",
|
||||||
|
"{$server->host}",
|
||||||
|
"{$server->port}",
|
||||||
|
"username={$uuid}",
|
||||||
|
'tfo=true',
|
||||||
|
'udp-relay=true'
|
||||||
|
];
|
||||||
|
if ($server->network === 'tcp') {
|
||||||
if ($server->tls) {
|
if ($server->tls) {
|
||||||
$tlsSettings = json_decode($server->tlsSettings);
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
$proxies .= ', tls=' . ($server->tls ? "true" : "false");
|
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
||||||
if (isset($tlsSettings->allowInsecure)) {
|
if (!empty($tlsSettings->allowInsecure)) {
|
||||||
$proxies .= ', skip-cert-verify=' . ($tlsSettings->allowInsecure ? "true" : "false");
|
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
||||||
|
}
|
||||||
|
if (!empty($tlsSettings->serverName)) {
|
||||||
|
array_push($config, "sni={$tlsSettings->serverName}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($server->network === 'ws') {
|
||||||
|
array_push($config, 'ws=true');
|
||||||
|
if ($server->tls) {
|
||||||
|
$tlsSettings = json_decode($server->tlsSettings);
|
||||||
|
array_push($config, $server->tls ? 'tls=true' : 'tls=false');
|
||||||
|
if (!empty($tlsSettings->allowInsecure)) {
|
||||||
|
array_push($config, $tlsSettings->allowInsecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($server->network == 'ws') {
|
|
||||||
$proxies .= ', ws=true';
|
|
||||||
if ($server->networkSettings) {
|
if ($server->networkSettings) {
|
||||||
$wsSettings = json_decode($server->networkSettings);
|
$wsSettings = json_decode($server->networkSettings);
|
||||||
if (isset($wsSettings->path)) $proxies .= ', ws-path=' . $wsSettings->path;
|
if (isset($wsSettings->path)) array_push($config, "ws-path={$wsSettings->path}");
|
||||||
if (isset($wsSettings->headers->Host)) $proxies .= ', ws-headers=host:' . $wsSettings->headers->Host;
|
if (isset($wsSettings->headers->Host)) array_push($config, "ws-headers=host:{$wsSettings->headers->Host}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$proxies .= "\r\n";
|
|
||||||
return $proxies;
|
$uri = implode(',', $config);
|
||||||
|
$uri .= "\r\n";
|
||||||
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function buildTrojan($password, $server)
|
public static function buildTrojan($password, $server)
|
||||||
@ -51,10 +73,13 @@ class Surge
|
|||||||
"{$server->host}",
|
"{$server->host}",
|
||||||
"{$server->port}",
|
"{$server->port}",
|
||||||
"password={$password}",
|
"password={$password}",
|
||||||
$server->allow_insecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false',
|
|
||||||
$server->server_name ? "sni={$server->server_name}" : "",
|
$server->server_name ? "sni={$server->server_name}" : "",
|
||||||
"tfo=true"
|
'tfo=true',
|
||||||
|
'udp-relay=true'
|
||||||
];
|
];
|
||||||
|
if (!empty($server->allow_insecure)) {
|
||||||
|
array_push($config, $server->allow_insecure ? 'skip-cert-verify=true' : 'skip-cert-verify=false');
|
||||||
|
}
|
||||||
$config = array_filter($config);
|
$config = array_filter($config);
|
||||||
$uri = implode(',', $config);
|
$uri = implode(',', $config);
|
||||||
$uri .= "\r\n";
|
$uri .= "\r\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user