mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update tls path
This commit is contained in:
parent
a905a5ad27
commit
971637ffd6
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin\Server;
|
||||
use App\Http\Requests\Admin\ServerTrojanSave;
|
||||
use App\Http\Requests\Admin\ServerTrojanSort;
|
||||
use App\Http\Requests\Admin\ServerTrojanUpdate;
|
||||
use App\Services\ServerService;
|
||||
use App\Utils\CacheKey;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
@ -131,4 +132,13 @@ class TrojanController extends Controller
|
||||
'data' => true
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewConfig(Request $request)
|
||||
{
|
||||
$serverService = new ServerService();
|
||||
$config = $serverService->getTrojanConfig($request->input('node_id'), 23333);
|
||||
return response([
|
||||
'data' => $config
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ class AdminRoute
|
||||
$router->post('update', 'Admin\\Server\\TrojanController@update');
|
||||
$router->post('copy', 'Admin\\Server\\TrojanController@copy');
|
||||
$router->post('sort', 'Admin\\Server\\TrojanController@sort');
|
||||
$router->post('viewConfig', 'Admin\\Server\\TrojanController@viewConfig');
|
||||
});
|
||||
$router->group([
|
||||
'prefix' => 'server/v2ray'
|
||||
|
@ -120,8 +120,8 @@ class ServerService
|
||||
$json = json_decode(self::TROJAN_CONFIG);
|
||||
$json->local_port = $server->server_port;
|
||||
$json->ssl->sni = $server->server_name ? $server->server_name : $server->host;
|
||||
$json->ssl->cert = "/root/.cert/{$server->host}.crt";
|
||||
$json->ssl->key = "/root/.cert/{$server->host}.key";
|
||||
$json->ssl->cert = "/root/.cert/server.crt";
|
||||
$json->ssl->key = "/root/.cert/server.key";
|
||||
$json->api->api_port = $localPort;
|
||||
return $json;
|
||||
}
|
||||
@ -196,8 +196,8 @@ class ServerService
|
||||
$tlsSettings = json_decode($server->tlsSettings);
|
||||
$json->inbound->streamSettings->security = 'tls';
|
||||
$tls = (object)[
|
||||
'certificateFile' => '/home/v2ray.crt',
|
||||
'keyFile' => '/home/v2ray.key'
|
||||
'certificateFile' => '/root/.cert/server.crt',
|
||||
'keyFile' => '/root/.cert/server.key'
|
||||
];
|
||||
$json->inbound->streamSettings->tlsSettings = new \StdClass();
|
||||
if (isset($tlsSettings->serverName)) {
|
||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user