diff --git a/app/Http/Controllers/Server/CredentialsController.php b/app/Http/Controllers/Server/CredentialsController.php deleted file mode 100644 index 36e6489e..00000000 --- a/app/Http/Controllers/Server/CredentialsController.php +++ /dev/null @@ -1,48 +0,0 @@ -keyProviderService = $keyProviderService; - } - - /** - * Return a set of credentials that the currently authenticated user can use to access - * a given server with. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - * - * @throws \Pterodactyl\Exceptions\Model\DataValidationException - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException - */ - public function index(Request $request): JsonResponse - { - /** @var \Pterodactyl\Models\Server $server */ - $server = $request->attributes->get('server'); - $server->loadMissing('node'); - - return JsonResponse::create([ - 'node' => $server->getRelation('node')->getConnectionAddress(), - 'key' => $this->keyProviderService->handle($server, $request->user()), - ]); - } -} diff --git a/app/Http/Controllers/Server/FileController.php b/app/Http/Controllers/Server/FileController.php deleted file mode 100644 index 23bba17e..00000000 --- a/app/Http/Controllers/Server/FileController.php +++ /dev/null @@ -1,57 +0,0 @@ -fileRepository = $fileRepository; - } - - /** - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - * - * @throws \Illuminate\Auth\Access\AuthorizationException - * @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException - */ - public function index(Request $request): JsonResponse - { - $server = $request->attributes->get('server'); - $this->authorize('list-files', $server); - - $requestDirectory = '/' . trim(urldecode($request->route()->parameter('directory', '/')), '/'); - - try { - $contents = $this->fileRepository->setServer($server)->setToken( - $request->attributes->get('server_token') - )->getDirectory($requestDirectory); - } catch (TransferException $exception) { - throw new DaemonConnectionException($exception, true); - } - - return JsonResponse::create([ - 'contents' => $contents, - 'editable' => config('pterodactyl.files.editable'), - 'current_directory' => $requestDirectory, - ]); - } -} diff --git a/app/Http/Controllers/Server/Tasks/ActionController.php b/app/Http/Controllers/Server/Tasks/ActionController.php deleted file mode 100644 index e69de29b..00000000 diff --git a/routes/server.php b/routes/server.php index 4bcc2d83..fb8c1249 100644 --- a/routes/server.php +++ b/routes/server.php @@ -6,13 +6,5 @@ * This software is licensed under the terms of the MIT license. * https://opensource.org/licenses/MIT */ -Route::get('/credentials', 'CredentialsController@index')->name('server.credentials'); - -Route::group(['prefix' => '/files'], function () { - Route::get('/{directory?}', 'FileController@index') - ->name('server.files') - ->where('directory', '.*'); -}); - Route::get('/')->name('server.index'); Route::get('/console')->name('server.console');