From 419031e0cd469364f56f6f045c274f3d83ac0234 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 12 Mar 2017 15:59:17 -0400 Subject: [PATCH] Add function file editing, and move all service file items into database --- .../Controllers/Admin/ServiceController.php | 217 +++--------------- app/Http/Routes/AdminRoutes.php | 7 +- app/Models/Service.php | 45 +++- app/Repositories/ServiceRepository.php | 51 +--- ...150648_MoveFunctionsFromFileToDatabase.php | 120 ++++++++++ .../admin/services/functions.blade.php | 88 +++++++ .../pterodactyl/admin/services/view.blade.php | 12 +- storage/app/services/.templates/index.js | 31 --- storage/app/services/minecraft/index.js | 38 --- storage/app/services/srcds/index.js | 31 --- storage/app/services/terraria/index.js | 31 --- storage/app/services/voice/index.js | 31 --- 12 files changed, 298 insertions(+), 404 deletions(-) create mode 100644 database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php create mode 100644 resources/themes/pterodactyl/admin/services/functions.blade.php delete mode 100644 storage/app/services/.templates/index.js delete mode 100644 storage/app/services/minecraft/index.js delete mode 100644 storage/app/services/srcds/index.js delete mode 100644 storage/app/services/terraria/index.js delete mode 100644 storage/app/services/voice/index.js diff --git a/app/Http/Controllers/Admin/ServiceController.php b/app/Http/Controllers/Admin/ServiceController.php index 60450ab2..523e6bb1 100644 --- a/app/Http/Controllers/Admin/ServiceController.php +++ b/app/Http/Controllers/Admin/ServiceController.php @@ -26,7 +26,6 @@ namespace Pterodactyl\Http\Controllers\Admin; use Log; use Alert; -use Storage; use Pterodactyl\Models; use Illuminate\Http\Request; use Pterodactyl\Exceptions\DisplayException; @@ -74,6 +73,18 @@ class ServiceController extends Controller ]); } + /** + * Return function editing view for a service. + * + * @param Request $request + * @param int $id + * @return \Illuminate\View\View + */ + public function viewFunctions(Request $request, $id) + { + return view('admin.services.functions', ['service' => Models\Service::findOrFail($id)]); + } + /** * Handle post action for new service. * @@ -113,11 +124,12 @@ class ServiceController extends Controller public function edit(Request $request, $id) { $repo = new ServiceRepository; + $redirectTo = ($request->input('redirect_to')) ? 'admin.services.view.functions' : 'admin.services.view'; try { if ($request->input('action') !== 'delete') { $repo->update($id, $request->intersect([ - 'name', 'description', 'folder', 'startup', + 'name', 'description', 'folder', 'startup', 'index_file', ])); Alert::success('Service has been updated successfully.')->flash(); } else { @@ -127,7 +139,7 @@ class ServiceController extends Controller return redirect()->route('admin.services'); } } catch (DisplayValidationException $ex) { - return redirect()->route('admin.services.view', $id)->withErrors(json_decode($ex->getMessage()))->withInput(); + return redirect()->route($redirectTo, $id)->withErrors(json_decode($ex->getMessage()))->withInput(); } catch (DisplayException $ex) { Alert::danger($ex->getMessage())->flash(); } catch (\Exception $ex) { @@ -135,193 +147,18 @@ class ServiceController extends Controller Alert::danger('An error occurred while attempting to update this service. This error has been logged.')->flash(); } - return redirect()->route('admin.services.view', $id); + return redirect()->route($redirectTo, $id); } - // public function getOption(Request $request, $service, $option) - // { - // $option = Models\ServiceOption::with('service', 'variables')->findOrFail($option); - // $option->setRelation('servers', $option->servers()->with('user')->paginate(25)); - // - // return view('admin.services.options.view', ['option' => $option]); - // } - // - // public function postOption(Request $request, $service, $option) - // { - // try { - // $repo = new ServiceRepository\Option; - // $repo->update($option, $request->only([ - // 'name', 'description', 'tag', - // 'executable', 'docker_image', 'startup', - // ])); - // Alert::success('Option settings successfully updated.')->flash(); - // } catch (DisplayValidationException $ex) { - // return redirect()->route('admin.services.option', [$service, $option])->withErrors(json_decode($ex->getMessage()))->withInput(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error occured while attempting to modify this option.')->flash(); - // } - // - // return redirect()->route('admin.services.option', [$service, $option])->withInput(); - // } - // - // public function deleteOption(Request $request, $service, $option) - // { - // try { - // $repo = new ServiceRepository\Option; - // $repo->delete($option); - // - // Alert::success('Successfully deleted that option.')->flash(); - // - // return redirect()->route('admin.services.service', $service); - // } catch (DisplayException $ex) { - // Alert::danger($ex->getMessage())->flash(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error was encountered while attempting to delete this option.')->flash(); - // } - // - // return redirect()->route('admin.services.option', [$service, $option]); - // } - // - // public function postOptionVariable(Request $request, $service, $option, $variable) - // { - // try { - // $repo = new ServiceRepository\Variable; - // - // // Because of the way old() works on the display side we prefix all of the variables with thier ID - // // We need to remove that prefix here since the repo doesn't want it. - // $data = [ - // 'user_viewable' => '0', - // 'user_editable' => '0', - // 'required' => '0', - // ]; - // foreach ($request->except(['_token']) as $id => $val) { - // $data[str_replace($variable . '_', '', $id)] = $val; - // } - // $repo->update($variable, $data); - // Alert::success('Successfully updated variable.')->flash(); - // } catch (DisplayValidationException $ex) { - // $data = []; - // foreach (json_decode($ex->getMessage(), true) as $id => $val) { - // $data[$variable . '_' . $id] = $val; - // } - // - // return redirect()->route('admin.services.option', [$service, $option])->withErrors((object) $data)->withInput(); - // } catch (DisplayException $ex) { - // Alert::danger($ex->getMessage())->flash(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error occurred while attempting to update this service.')->flash(); - // } - // - // return redirect()->route('admin.services.option', [$service, $option])->withInput(); - // } - // - // public function getNewVariable(Request $request, $service, $option) - // { - // return view('admin.services.options.variable', [ - // 'option' => Models\ServiceOption::with('service')->findOrFail($option), - // ]); - // } - // - // public function postNewVariable(Request $request, $service, $option) - // { - // try { - // $repo = new ServiceRepository\Variable; - // $repo->create($option, $request->only([ - // 'name', 'description', 'env_variable', - // 'default_value', 'user_viewable', - // 'user_editable', 'required', 'regex', - // ])); - // Alert::success('Successfully added new variable to this option.')->flash(); - // - // return redirect()->route('admin.services.option', [$service, $option]); - // } catch (DisplayValidationException $ex) { - // return redirect()->route('admin.services.option.variable.new', [$service, $option])->withErrors(json_decode($ex->getMessage()))->withInput(); - // } catch (DisplayException $ex) { - // Alert::danger($ex->getMessage())->flash(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error occurred while attempting to add this variable.')->flash(); - // } - // - // return redirect()->route('admin.services.option.variable.new', [$service, $option])->withInput(); - // } - // - // public function newOption(Request $request, $service) - // { - // return view('admin.services.options.new', [ - // 'service' => Models\Service::findOrFail($service), - // ]); - // } - // - // public function postNewOption(Request $request, $service) - // { - // try { - // $repo = new ServiceRepository\Option; - // $id = $repo->create($service, $request->except([ - // '_token', - // ])); - // Alert::success('Successfully created new service option.')->flash(); - // - // return redirect()->route('admin.services.option', [$service, $id]); - // } catch (DisplayValidationException $ex) { - // return redirect()->route('admin.services.option.new', $service)->withErrors(json_decode($ex->getMessage()))->withInput(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error occured while attempting to add this service option.')->flash(); - // } - // - // return redirect()->route('admin.services.option.new', $service)->withInput(); - // } - // - // public function deleteVariable(Request $request, $service, $option, $variable) - // { - // try { - // $repo = new ServiceRepository\Variable; - // $repo->delete($variable); - // Alert::success('Deleted variable.')->flash(); - // } catch (DisplayException $ex) { - // Alert::danger($ex->getMessage())->flash(); - // } catch (\Exception $ex) { - // Log::error($ex); - // Alert::danger('An error occured while attempting to delete that variable.')->flash(); - // } - // - // return redirect()->route('admin.services.option', [$service, $option]); - // } - // - // public function getConfiguration(Request $request, $serviceId) - // { - // $service = Models\Service::findOrFail($serviceId); - // - // return view('admin.services.config', [ - // 'service' => $service, - // 'contents' => [ - // 'json' => Storage::get('services/' . $service->file . '/main.json'), - // 'index' => Storage::get('services/' . $service->file . '/index.js'), - // ], - // ]); - // } - // - // public function postConfiguration(Request $request, $serviceId) - // { - // try { - // $repo = new ServiceRepository\Service; - // $repo->updateFile($serviceId, $request->only(['file', 'contents'])); - // - // return response('', 204); - // } catch (DisplayException $ex) { - // return response()->json([ - // 'error' => $ex->getMessage(), - // ], 503); - // } catch (\Exception $ex) { - // Log::error($ex); - // - // return response()->json([ - // 'error' => 'An error occured while attempting to save the file.', - // ], 503); - // } - // } + /** + * Edits function file for a service. + * + * @param Request $request + * @param int $id + * @return \Illuminate\Response\RedirectResponse + */ + public function editFunctions(Request $request, $id) + { + + } } diff --git a/app/Http/Routes/AdminRoutes.php b/app/Http/Routes/AdminRoutes.php index 5cec94b5..60a6cb8e 100644 --- a/app/Http/Routes/AdminRoutes.php +++ b/app/Http/Routes/AdminRoutes.php @@ -403,8 +403,11 @@ class AdminRoutes 'uses' => 'Admin\ServiceController@view', ]); - $router->post('/view/{id}', [ - 'uses' => 'Admin\ServiceController@edit', + $router->post('/view/{id}', 'Admin\ServiceController@edit'); + + $router->get('/view/{id}/functions', [ + 'as' => 'admin.services.view.functions', + 'uses' => 'Admin\ServiceController@viewFunctions', ]); $router->delete('/view/{id}', [ diff --git a/app/Models/Service.php b/app/Models/Service.php index 50679633..c521b803 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -41,9 +41,52 @@ class Service extends Model * @var array */ protected $fillable = [ - 'name', 'description', 'folder', 'startup', + 'name', 'description', 'folder', 'startup', 'index_file', ]; + /** + * Returns the default contents of the index.js file for a service. + * + * @return string + */ + public function defaultIndexFile() + { + return << + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const rfr = require('rfr'); +const _ = require('lodash'); + +const Core = rfr('src/services/index.js'); + +class Service extends Core {} + +module.exports = Service; +EOF; + } + /** * Gets all service options associated with this service. * diff --git a/app/Repositories/ServiceRepository.php b/app/Repositories/ServiceRepository.php index a82c80b3..801a29de 100644 --- a/app/Repositories/ServiceRepository.php +++ b/app/Repositories/ServiceRepository.php @@ -26,7 +26,6 @@ namespace Pterodactyl\Repositories; use DB; use Uuid; -use Storage; use Validator; use Pterodactyl\Models\Service; use Pterodactyl\Models\ServiceVariable; @@ -55,7 +54,7 @@ class ServiceRepository throw new DisplayValidationException($validator->errors()); } - $service = DB::transaction(function () use ($data) { + return DB::transaction(function () use ($data) { $service = new Service; $service->author = config('pterodactyl.service.author'); $service->fill([ @@ -63,6 +62,7 @@ class ServiceRepository 'description' => (isset($data['description'])) ? $data['description'] : null, 'folder' => $data['folder'], 'startup' => (isset($data['startup'])) ? $data['startup'] : null, + 'index_file' => $service->defaultIndexFile(), ])->save(); // It is possible for an event to return false or throw an exception @@ -73,12 +73,8 @@ class ServiceRepository throw new \Exception('Service model was created however the response appears to be invalid. Did an event fire wrongly?'); } - Storage::copy('services/.templates/index.js', 'services/' . $service->folder . '/index.js'); - return $service; }); - - return $service; } /** @@ -97,6 +93,7 @@ class ServiceRepository 'description' => 'sometimes|required|nullable|string', 'folder' => 'sometimes|required|regex:/^[\w.-]{1,50}$/', 'startup' => 'sometimes|required|nullable|string', + 'index_file' => 'sometimes|required|string', ]); if ($validator->fails()) { @@ -104,15 +101,8 @@ class ServiceRepository } return DB::transaction(function () use ($data, $service) { - $moveFiles = (isset($data['folder']) && $data['folder'] !== $service->folder); - $oldFolder = $service->folder; - $service->fill($data)->save(); - if ($moveFiles) { - Storage::move(sprintf('services/%s/index.js', $oldFolder), sprintf('services/%s/index.js', $service->folder)); - } - return $service; }); } @@ -137,41 +127,6 @@ class ServiceRepository } $service->delete(); - Storage::deleteDirectory('services/' . $service->folder); }); } - - /** - * Updates a service file on the system. - * - * @param int $id - * @param array $data - * @return void - * - * @deprecated - */ - // public function updateFile($id, array $data) - // { - // $service = Service::findOrFail($id); - // - // $validator = Validator::make($data, [ - // 'file' => 'required|in:index', - // 'contents' => 'required|string', - // ]); - // - // if ($validator->fails()) { - // throw new DisplayValidationException($validator->errors()); - // } - // - // $filepath = 'services/' . $service->folder . '/' . $filename; - // $backup = 'services/.bak/' . str_random(12) . '.bak'; - // - // try { - // Storage::move($filepath, $backup); - // Storage::put($filepath, $data['contents']); - // } catch (\Exception $ex) { - // Storage::move($backup, $filepath); - // throw $ex; - // } - // } } diff --git a/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php b/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php new file mode 100644 index 00000000..bb37afd9 --- /dev/null +++ b/database/migrations/2017_03_12_150648_MoveFunctionsFromFileToDatabase.php @@ -0,0 +1,120 @@ + + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const rfr = require('rfr'); +const _ = require('lodash'); + +const Core = rfr('src/services/index.js'); + +class Service extends Core {} + +module.exports = Service; +EOF; + + private $default_mc = << + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +const rfr = require('rfr'); +const _ = require('lodash'); + +const Core = rfr('src/services/index.js'); + +class Service extends Core { + onConsole(data) { + // Hide the output spam from Bungeecord getting pinged. + if (_.endsWith(data, '<-> InitialHandler has connected')) return; + return super.onConsole(data); + } +} + +module.exports = Service; +EOF; + + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('services', function (Blueprint $table) { + $table->text('index_file')->after('startup'); + }); + + DB::transaction(function () { + Service::where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('folder', '!=', 'minecraft')->update([ + 'index_file' => $this->default, + ]); + + Service::where('author', 'ptrdctyl-v040-11e6-8b77-86f30ca893d3')->where('folder', 'minecraft')->update([ + 'index_file' => $this->default_mc, + ]); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('services', function (Blueprint $table) { + $table->dropColumn('index_file'); + }); + } +} diff --git a/resources/themes/pterodactyl/admin/services/functions.blade.php b/resources/themes/pterodactyl/admin/services/functions.blade.php new file mode 100644 index 00000000..634f38b7 --- /dev/null +++ b/resources/themes/pterodactyl/admin/services/functions.blade.php @@ -0,0 +1,88 @@ +{{-- Copyright (c) 2015 - 2017 Dane Everitt --}} + +{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} +{{-- of this software and associated documentation files (the "Software"), to deal --}} +{{-- in the Software without restriction, including without limitation the rights --}} +{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} +{{-- copies of the Software, and to permit persons to whom the Software is --}} +{{-- furnished to do so, subject to the following conditions: --}} + +{{-- The above copyright notice and this permission notice shall be included in all --}} +{{-- copies or substantial portions of the Software. --}} + +{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} +{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} +{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} +{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} +{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} +{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} +{{-- SOFTWARE. --}} +@extends('layouts.admin') + +@section('title') + Services → {{ $service->name }} → Functions +@endsection + +@section('content-header') +

{{ $service->name }}Extend the default daemon functions using this service file.

+ +@endsection + +@section('content') +
+
+ +
+
+
+
+
+
+

Functions Control

+
+
+
+
{{ $service->index_file }}
+ +
+ +
+
+
+
+@endsection + +@section('footer-scripts') + @parent + {!! Theme::js('js/vendor/ace/ace.js') !!} + {!! Theme::js('js/vendor/ace/ext-modelist.js') !!} + +@endsection diff --git a/resources/themes/pterodactyl/admin/services/view.blade.php b/resources/themes/pterodactyl/admin/services/view.blade.php index 49d6b727..ab31abe0 100644 --- a/resources/themes/pterodactyl/admin/services/view.blade.php +++ b/resources/themes/pterodactyl/admin/services/view.blade.php @@ -20,7 +20,7 @@ @extends('layouts.admin') @section('title') - Services: {{ $service->name }} + Services → {{ $service->name }} @endsection @section('content-header') @@ -33,6 +33,16 @@ @endsection @section('content') +
+
+ +
+
diff --git a/storage/app/services/.templates/index.js b/storage/app/services/.templates/index.js deleted file mode 100644 index f6b6695d..00000000 --- a/storage/app/services/.templates/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -/** - * Pterodactyl - Daemon - * Copyright (c) 2015 - 2017 Dane Everitt - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -const rfr = require('rfr'); - -const Core = rfr('src/services/index.js'); - -class Service extends Core {} - -module.exports = Service; diff --git a/storage/app/services/minecraft/index.js b/storage/app/services/minecraft/index.js deleted file mode 100644 index b53364be..00000000 --- a/storage/app/services/minecraft/index.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -/** - * Pterodactyl - Daemon - * Copyright (c) 2015 - 2017 Dane Everitt - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -const rfr = require('rfr'); -const _ = require('lodash'); - -const Core = rfr('src/services/index.js'); - -class Service extends Core { - onConsole(data) { - // Hide the output spam from Bungeecord getting pinged. - if (_.endsWith(data, '<-> InitialHandler has connected')) return; - return super.onConsole(data); - } -} - -module.exports = Service; diff --git a/storage/app/services/srcds/index.js b/storage/app/services/srcds/index.js deleted file mode 100644 index f6b6695d..00000000 --- a/storage/app/services/srcds/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -/** - * Pterodactyl - Daemon - * Copyright (c) 2015 - 2017 Dane Everitt - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -const rfr = require('rfr'); - -const Core = rfr('src/services/index.js'); - -class Service extends Core {} - -module.exports = Service; diff --git a/storage/app/services/terraria/index.js b/storage/app/services/terraria/index.js deleted file mode 100644 index f6b6695d..00000000 --- a/storage/app/services/terraria/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -/** - * Pterodactyl - Daemon - * Copyright (c) 2015 - 2017 Dane Everitt - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -const rfr = require('rfr'); - -const Core = rfr('src/services/index.js'); - -class Service extends Core {} - -module.exports = Service; diff --git a/storage/app/services/voice/index.js b/storage/app/services/voice/index.js deleted file mode 100644 index f6b6695d..00000000 --- a/storage/app/services/voice/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -/** - * Pterodactyl - Daemon - * Copyright (c) 2015 - 2017 Dane Everitt - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -const rfr = require('rfr'); - -const Core = rfr('src/services/index.js'); - -class Service extends Core {} - -module.exports = Service;