From 2cabfeec15331ff82aff819989cacfa708d6175c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 15 Dec 2019 18:31:15 -0800 Subject: [PATCH] Daemon secret is not a thing anymore --- .../Servers/ServerCreationService.php | 2 -- .../Controllers/JavascriptInjection.php | 30 ------------------- 2 files changed, 32 deletions(-) diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index ca663262a..a76787933 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -4,7 +4,6 @@ namespace Pterodactyl\Services\Servers; use Ramsey\Uuid\Uuid; use Illuminate\Support\Arr; -use Illuminate\Support\Str; use Pterodactyl\Models\Node; use Pterodactyl\Models\User; use Pterodactyl\Models\Server; @@ -228,7 +227,6 @@ class ServerCreationService 'egg_id' => Arr::get($data, 'egg_id'), 'pack_id' => empty($data['pack_id']) ? null : $data['pack_id'], 'startup' => Arr::get($data, 'startup'), - 'daemonSecret' => Str::random(Node::DAEMON_SECRET_LENGTH), 'image' => Arr::get($data, 'image'), 'database_limit' => Arr::get($data, 'database_limit'), 'allocation_limit' => Arr::get($data, 'allocation_limit'), diff --git a/app/Traits/Controllers/JavascriptInjection.php b/app/Traits/Controllers/JavascriptInjection.php index 2f0e472e5..556c99550 100644 --- a/app/Traits/Controllers/JavascriptInjection.php +++ b/app/Traits/Controllers/JavascriptInjection.php @@ -32,36 +32,6 @@ trait JavascriptInjection return $this; } - /** - * Injects server javascript into the page to be used by other services. - * - * @param array $args - * @param bool $overwrite - * @return array - */ - public function injectJavascript($args = [], $overwrite = false) - { - $request = $this->request ?? app()->make(Request::class); - $server = $request->attributes->get('server'); - $token = $request->attributes->get('server_token'); - - $response = array_merge_recursive([ - 'server' => [ - 'uuid' => $server->uuid, - 'uuidShort' => $server->uuidShort, - 'daemonSecret' => $token, - ], - 'server_token' => $token, - 'node' => [ - 'fqdn' => $server->node->fqdn, - 'scheme' => $server->node->scheme, - 'daemonListen' => $server->node->daemonListen, - ], - ], $args); - - return Javascript::put($overwrite ? $args : $response); - } - /** * Injects the exact array passed in, nothing more. *