mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-25 10:32:31 +01:00
Cleanup routing mechanisms
This commit is contained in:
parent
0a95d97d7f
commit
d80c59aad3
@ -1,71 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Pterodactyl - Panel
|
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Controllers\Base;
|
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use Session;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Pterodactyl\Models\User;
|
|
||||||
use Pterodactyl\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
class LanguageController extends Controller
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A list of supported languages on the panel.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $languages = [
|
|
||||||
'de' => 'German',
|
|
||||||
'en' => 'English',
|
|
||||||
'et' => 'Estonian',
|
|
||||||
'nb' => 'Norwegian',
|
|
||||||
'nl' => 'Dutch',
|
|
||||||
'pt' => 'Portuguese',
|
|
||||||
'ro' => 'Romanian',
|
|
||||||
'ru' => 'Russian',
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the language for a user.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param string $language
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
|
||||||
public function setLanguage(Request $request, $language)
|
|
||||||
{
|
|
||||||
if (array_key_exists($language, $this->languages)) {
|
|
||||||
if (Auth::check()) {
|
|
||||||
$user = User::findOrFail(Auth::user()->id);
|
|
||||||
$user->language = $language;
|
|
||||||
$user->save();
|
|
||||||
}
|
|
||||||
Session::set('applocale', $language);
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect()->back();
|
|
||||||
}
|
|
||||||
}
|
|
@ -15,10 +15,11 @@ class Kernel extends HttpKernel
|
|||||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||||
\Pterodactyl\Http\Middleware\EncryptCookies::class,
|
\Pterodactyl\Http\Middleware\EncryptCookies::class,
|
||||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||||
\Illuminate\Session\Middleware\StartSession::class,
|
\Pterodactyl\Http\Middleware\TrimStrings::class,
|
||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
|
||||||
|
|
||||||
\Pterodactyl\Http\Middleware\LanguageMiddleware::class,
|
/*
|
||||||
|
* Custom middleware applied to all routes.
|
||||||
|
*/
|
||||||
\Fideloper\Proxy\TrustProxies::class,
|
\Fideloper\Proxy\TrustProxies::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ class Kernel extends HttpKernel
|
|||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
\Pterodactyl\Http\Middleware\VerifyCsrfToken::class,
|
\Pterodactyl\Http\Middleware\VerifyCsrfToken::class,
|
||||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
|
\Pterodactyl\Http\Middleware\LanguageMiddleware::class,
|
||||||
],
|
],
|
||||||
'api' => [
|
'api' => [
|
||||||
'throttle:60,1',
|
'throttle:60,1',
|
||||||
|
18
app/Http/Middleware/TrimStrings.php
Normal file
18
app/Http/Middleware/TrimStrings.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
|
||||||
|
|
||||||
|
class TrimStrings extends BaseTrimmer
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The names of the attributes that should not be trimmed.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $except = [
|
||||||
|
'password',
|
||||||
|
'password_confirmation',
|
||||||
|
];
|
||||||
|
}
|
@ -1,484 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Pterodactyl - Panel
|
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
|
|
||||||
* Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com>.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
|
||||||
|
|
||||||
use Illuminate\Routing\Router;
|
|
||||||
|
|
||||||
class AdminRoutes
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Admin routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Admin Index
|
|
||||||
$router->get('admin', [
|
|
||||||
'as' => 'admin.index',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
'uses' => 'Admin\BaseController@getIndex',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/databases',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.databases',
|
|
||||||
'uses' => 'Admin\DatabaseController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/', 'Admin\DatabaseController@create');
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.databases.view',
|
|
||||||
'uses' => 'Admin\DatabaseController@view',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}', 'Admin\DatabaseController@update');
|
|
||||||
});
|
|
||||||
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/locations',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.locations',
|
|
||||||
'uses' => 'Admin\LocationController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/', 'Admin\LocationController@create');
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.locations.view',
|
|
||||||
'uses' => 'Admin\LocationController@view',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}', 'Admin\LocationController@update');
|
|
||||||
});
|
|
||||||
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/settings',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.settings',
|
|
||||||
'uses' => 'Admin\BaseController@getSettings',
|
|
||||||
]);
|
|
||||||
$router->post('/', [
|
|
||||||
'uses' => 'Admin\BaseController@postSettings',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/users',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
|
|
||||||
// View All Accounts on System
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.users',
|
|
||||||
'uses' => 'Admin\UserController@getIndex',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/accounts.json', [
|
|
||||||
'as' => 'admin.users.json',
|
|
||||||
'uses' => 'Admin\UserController@getJson',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// View Specific Account
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.users.view',
|
|
||||||
'uses' => 'Admin\UserController@getView',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// View Specific Account
|
|
||||||
$router->post('/view/{id}', [
|
|
||||||
'uses' => 'Admin\UserController@updateUser',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Delete an Account Matching an ID
|
|
||||||
$router->delete('/view/{id}', [
|
|
||||||
'uses' => 'Admin\UserController@deleteUser',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Show Create Account Page
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'admin.users.new',
|
|
||||||
'uses' => 'Admin\UserController@getNew',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle Creating New Account
|
|
||||||
$router->post('/new', [
|
|
||||||
'uses' => 'Admin\UserController@postNew',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Server Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/servers',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
|
|
||||||
// View All Servers
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.servers',
|
|
||||||
'uses' => 'Admin\ServersController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// View Create Server Page
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'admin.servers.new',
|
|
||||||
'uses' => 'Admin\ServersController@new',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle POST Request for Creating Server
|
|
||||||
$router->post('/new', [
|
|
||||||
'uses' => 'Admin\ServersController@create',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Assorted Page Helpers
|
|
||||||
$router->post('/new/nodes', [
|
|
||||||
'as' => 'admin.servers.new.nodes',
|
|
||||||
'uses' => 'Admin\ServersController@newServerNodes',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.servers.view',
|
|
||||||
'uses' => 'Admin\ServersController@viewIndex',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/details', [
|
|
||||||
'as' => 'admin.servers.view.details',
|
|
||||||
'uses' => 'Admin\ServersController@viewDetails',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/details', [
|
|
||||||
'uses' => 'Admin\ServersController@setDetails',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/details/container', [
|
|
||||||
'as' => 'admin.servers.view.details.container',
|
|
||||||
'uses' => 'Admin\ServersController@setContainer',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/build', [
|
|
||||||
'as' => 'admin.servers.view.build',
|
|
||||||
'uses' => 'Admin\ServersController@viewBuild',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/build', [
|
|
||||||
'uses' => 'Admin\ServersController@updateBuild',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/startup', [
|
|
||||||
'as' => 'admin.servers.view.startup',
|
|
||||||
'uses' => 'Admin\ServersController@viewStartup',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/startup', [
|
|
||||||
'uses' => 'Admin\ServersController@saveStartup',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/database', [
|
|
||||||
'as' => 'admin.servers.view.database',
|
|
||||||
'uses' => 'Admin\ServersController@viewDatabase',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/database', [
|
|
||||||
'uses' => 'Admin\ServersController@newDatabase',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->patch('/view/{id}/database', [
|
|
||||||
'uses' => 'Admin\ServersController@resetDatabasePassword',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->delete('/view/{id}/database/{database}/delete', [
|
|
||||||
'as' => 'admin.servers.view.database.delete',
|
|
||||||
'uses' => 'Admin\ServersController@deleteDatabase',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/manage', [
|
|
||||||
'as' => 'admin.servers.view.manage',
|
|
||||||
'uses' => 'Admin\ServersController@viewManage',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/manage/toggle', [
|
|
||||||
'as' => 'admin.servers.view.manage.toggle',
|
|
||||||
'uses' => 'Admin\ServersController@toggleInstall',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/manage/rebuild', [
|
|
||||||
'as' => 'admin.servers.view.manage.rebuild',
|
|
||||||
'uses' => 'Admin\ServersController@rebuildContainer',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/manage/suspension', [
|
|
||||||
'as' => 'admin.servers.view.manage.suspension',
|
|
||||||
'uses' => 'Admin\ServersController@manageSuspension',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/delete', [
|
|
||||||
'as' => 'admin.servers.view.delete',
|
|
||||||
'uses' => 'Admin\ServersController@viewDelete',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/delete', [
|
|
||||||
'uses' => 'Admin\ServersController@delete',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/delete/continue/{force?}', [
|
|
||||||
'as' => 'admin.servers.view.delete.continue',
|
|
||||||
'uses' => 'Admin\ServersController@continueDeletion',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/delete/cancel', [
|
|
||||||
'as' => 'admin.servers.view.delete.cancel',
|
|
||||||
'uses' => 'Admin\ServersController@cancelDeletion',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Node Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/nodes',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
|
|
||||||
// View All Nodes
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.nodes',
|
|
||||||
'uses' => 'Admin\NodesController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Add New Node
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'admin.nodes.new',
|
|
||||||
'uses' => 'Admin\NodesController@new',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/new', [
|
|
||||||
'uses' => 'Admin\NodesController@create',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.nodes.view',
|
|
||||||
'uses' => 'Admin\NodesController@viewIndex',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/settings', [
|
|
||||||
'as' => 'admin.nodes.view.settings',
|
|
||||||
'uses' => 'Admin\NodesController@viewSettings',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/settings', [
|
|
||||||
'uses' => 'Admin\NodesController@updateSettings',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/configuration', [
|
|
||||||
'as' => 'admin.nodes.view.configuration',
|
|
||||||
'uses' => 'Admin\NodesController@viewConfiguration',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/allocation', [
|
|
||||||
'as' => 'admin.nodes.view.allocation',
|
|
||||||
'uses' => 'Admin\NodesController@viewAllocation',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/allocation', [
|
|
||||||
'uses' => 'Admin\NodesController@createAllocation',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/servers', [
|
|
||||||
'as' => 'admin.nodes.view.servers',
|
|
||||||
'uses' => 'Admin\NodesController@viewServers',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->delete('/view/{id}/delete', [
|
|
||||||
'as' => 'admin.nodes.view.delete',
|
|
||||||
'uses' => 'Admin\NodesController@delete',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->delete('/view/{id}/allocation/remove/{allocation}', [
|
|
||||||
'as' => 'admin.nodes.view.allocation.removeSingle',
|
|
||||||
'uses' => 'Admin\NodesController@allocationRemoveSingle',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/allocation/remove', [
|
|
||||||
'as' => 'admin.nodes.view.allocation.removeBlock',
|
|
||||||
'uses' => 'Admin\NodesController@allocationRemoveBlock',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}/allocation/alias', [
|
|
||||||
'as' => 'admin.nodes.view.allocation.setAlias',
|
|
||||||
'uses' => 'Admin\NodesController@allocationSetAlias',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}/settings/token', [
|
|
||||||
'as' => 'admin.nodes.view.configuration.token',
|
|
||||||
'uses' => 'Admin\NodesController@setToken',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Service Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/services',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.services',
|
|
||||||
'uses' => 'Admin\ServiceController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'admin.services.new',
|
|
||||||
'uses' => 'Admin\ServiceController@new',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/new', [
|
|
||||||
'uses' => 'Admin\ServiceController@create',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.services.view',
|
|
||||||
'uses' => 'Admin\ServiceController@view',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$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}', [
|
|
||||||
'uses' => 'Admin\ServiceController@delete',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// ---------------------
|
|
||||||
// Service Option Routes
|
|
||||||
// ---------------------
|
|
||||||
$router->get('/option/new', [
|
|
||||||
'as' => 'admin.services.option.new',
|
|
||||||
'uses' => 'Admin\OptionController@new',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/option/new', 'Admin\OptionController@create');
|
|
||||||
|
|
||||||
$router->get('/option/{id}', [
|
|
||||||
'as' => 'admin.services.option.view',
|
|
||||||
'uses' => 'Admin\OptionController@viewConfiguration',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/option/{id}', 'Admin\OptionController@editConfiguration');
|
|
||||||
|
|
||||||
$router->get('/option/{id}/variables', [
|
|
||||||
'as' => 'admin.services.option.variables',
|
|
||||||
'uses' => 'Admin\OptionController@viewVariables',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/option/{id}/variables', 'Admin\OptionController@createVariable');
|
|
||||||
|
|
||||||
$router->post('/option/{id}/variables/{variable}', [
|
|
||||||
'as' => 'admin.services.option.variables.edit',
|
|
||||||
'uses' => 'Admin\OptionController@editVariable',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Service Packs
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'admin/packs',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'admin',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'admin.packs',
|
|
||||||
'uses' => 'Admin\PackController@index',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'admin.packs.new',
|
|
||||||
'uses' => 'Admin\PackController@new',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/new', 'Admin\PackController@create');
|
|
||||||
|
|
||||||
$router->get('/new/template', [
|
|
||||||
'as' => 'admin.packs.new.template',
|
|
||||||
'uses' => 'Admin\PackController@newTemplate',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('/view/{id}', [
|
|
||||||
'as' => 'admin.packs.view',
|
|
||||||
'uses' => 'Admin\PackController@view',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('/view/{id}', 'Admin\PackController@update');
|
|
||||||
|
|
||||||
$router->post('/view/{id}/export/{files?}', [
|
|
||||||
'as' => 'admin.packs.view.export',
|
|
||||||
'uses' => 'Admin\PackController@export',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,103 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Pterodactyl - Panel
|
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
|
|
||||||
* Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com>.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
|
||||||
|
|
||||||
use Auth;
|
|
||||||
use Illuminate\Routing\Router;
|
|
||||||
|
|
||||||
class AuthRoutes
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Authentication routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'auth',
|
|
||||||
'middleware' => [
|
|
||||||
'guest',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
|
|
||||||
// Display Login Page
|
|
||||||
$router->get('login', [
|
|
||||||
'as' => 'auth.login',
|
|
||||||
'uses' => 'Auth\LoginController@showLoginForm',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle Login
|
|
||||||
$router->post('login', [
|
|
||||||
'uses' => 'Auth\LoginController@login',
|
|
||||||
'middleware' => 'recaptcha',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('login/totp', [
|
|
||||||
'as' => 'auth.totp',
|
|
||||||
'uses' => 'Auth\LoginController@totp',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('login/totp', [
|
|
||||||
'uses' => 'Auth\LoginController@totpCheckpoint',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Show Password Reset Form
|
|
||||||
$router->get('password', [
|
|
||||||
'as' => 'auth.password',
|
|
||||||
'uses' => 'Auth\ForgotPasswordController@showLinkRequestForm',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle Password Reset
|
|
||||||
$router->post('password', [
|
|
||||||
'uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail',
|
|
||||||
'middleware' => 'recaptcha',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Show Verification Checkpoint
|
|
||||||
$router->get('password/reset/{token}', [
|
|
||||||
'as' => 'auth.reset',
|
|
||||||
'uses' => 'Auth\ResetPasswordController@showResetForm',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle Verification
|
|
||||||
$router->post('password/reset', [
|
|
||||||
'as' => 'auth.reset.post',
|
|
||||||
'uses' => 'Auth\ResetPasswordController@reset',
|
|
||||||
'middleware' => 'recaptcha',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Not included above because we don't want the guest middleware
|
|
||||||
$router->get('auth/logout', [
|
|
||||||
'as' => 'auth.logout',
|
|
||||||
'middleware' => 'auth',
|
|
||||||
'uses' => 'Auth\LoginController@logout',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,131 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Pterodactyl - Panel
|
|
||||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>
|
|
||||||
* Some Modifications (c) 2015 Dylan Seidt <dylan.seidt@gmail.com>.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
|
||||||
|
|
||||||
use Illuminate\Routing\Router;
|
|
||||||
|
|
||||||
class BaseRoutes
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Base routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
|
|
||||||
// Index of Panel
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'index',
|
|
||||||
'middleware' => 'auth',
|
|
||||||
'uses' => 'Base\IndexController@getIndex',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Handle Index. Redirect /index to /
|
|
||||||
$router->get('/index', function () {
|
|
||||||
return redirect()->route('index');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Password Generation
|
|
||||||
$router->get('/password-gen/{length}', [
|
|
||||||
'as' => 'password-gen',
|
|
||||||
'middleware' => 'auth',
|
|
||||||
'uses' => 'Base\IndexController@getPassword',
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Account Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'account',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'account',
|
|
||||||
'uses' => 'Base\AccountController@index',
|
|
||||||
]);
|
|
||||||
$router->post('/', [
|
|
||||||
'uses' => 'Base\AccountController@update',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// API Management Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'account/api',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'account.api',
|
|
||||||
'uses' => 'Base\APIController@index',
|
|
||||||
]);
|
|
||||||
$router->get('/new', [
|
|
||||||
'as' => 'account.api.new',
|
|
||||||
'uses' => 'Base\APIController@create',
|
|
||||||
]);
|
|
||||||
$router->post('/new', [
|
|
||||||
'uses' => 'Base\APIController@save',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->delete('/revoke/{key}', [
|
|
||||||
'as' => 'account.api.revoke',
|
|
||||||
'uses' => 'Base\APIController@revoke',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
// TOTP Routes
|
|
||||||
$router->group([
|
|
||||||
'prefix' => 'account/security',
|
|
||||||
'middleware' => [
|
|
||||||
'auth',
|
|
||||||
'csrf',
|
|
||||||
],
|
|
||||||
], function () use ($router) {
|
|
||||||
$router->get('/', [
|
|
||||||
'as' => 'account.security',
|
|
||||||
'uses' => 'Base\SecurityController@index',
|
|
||||||
]);
|
|
||||||
$router->get('/revoke/{id}', [
|
|
||||||
'as' => 'account.security.revoke',
|
|
||||||
'uses' => 'Base\SecurityController@revoke',
|
|
||||||
]);
|
|
||||||
$router->put('/totp', [
|
|
||||||
'as' => 'account.security.totp',
|
|
||||||
'uses' => 'Base\SecurityController@generateTotp',
|
|
||||||
]);
|
|
||||||
$router->post('/totp', [
|
|
||||||
'uses' => 'Base\SecurityController@setTotp',
|
|
||||||
]);
|
|
||||||
$router->delete('/totp', [
|
|
||||||
'uses' => 'Base\SecurityController@disableTotp',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -33,10 +33,43 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function map()
|
public function map()
|
||||||
{
|
{
|
||||||
|
$this->mapper();
|
||||||
|
|
||||||
Route::group(['namespace' => $this->namespace], function ($router) {
|
Route::group(['namespace' => $this->namespace], function ($router) {
|
||||||
foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
|
foreach (glob(app_path('Http//Routes') . '/*.php') as $file) {
|
||||||
$this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
|
$this->app->make('Pterodactyl\\Http\\Routes\\' . basename($file, '.php'))->map($router);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure all routes used by the application.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function mapper() {
|
||||||
|
Route::middleware(['web', 'auth', 'csrf'])
|
||||||
|
->namespace($this->namespace . '\Base')
|
||||||
|
->group(base_path('routes/base.php'));
|
||||||
|
|
||||||
|
Route::middleware(['web', 'auth', 'admin', 'csrf'])->prefix('/admin')
|
||||||
|
->namespace($this->namespace . '\Admin')
|
||||||
|
->group(base_path('routes/admin.php'));
|
||||||
|
|
||||||
|
Route::middleware(['web', 'guest', 'csrf'])->prefix('/auth')
|
||||||
|
->namespace($this->namespace . '\Auth')
|
||||||
|
->group(base_path('routes/auth.php'));
|
||||||
|
|
||||||
|
Route::middleware(['web', 'auth', 'server', 'csrf'])->prefix('/server/{server}')
|
||||||
|
->namespace($this->namespace . '\Server')
|
||||||
|
->group(base_path('routes/server.php'));
|
||||||
|
|
||||||
|
Route::middleware(['web'])->prefix('/remote')
|
||||||
|
->namespace($this->namespace . '\Remote')
|
||||||
|
->group(base_path('routes/remote.php'));
|
||||||
|
|
||||||
|
Route::middleware(['web', 'daemon'])->prefix('/daemon')
|
||||||
|
->namespace($this->namespace . '\Daemon')
|
||||||
|
->group(base_path('routes/daemon.php'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
201
routes/admin.php
Normal file
201
routes/admin.php
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Pterodactyl - Panel
|
||||||
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::get('/', 'BaseController@getIndex')->name('admin.index');
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Location Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/locations
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'locations'], function () {
|
||||||
|
Route::get('/', 'LocationController@index')->name('admin.locations');
|
||||||
|
Route::get('/view/{id}', 'LocationController@view')->name('admin.locations.view');
|
||||||
|
|
||||||
|
Route::post('/', 'LocationController@create');
|
||||||
|
Route::post('/view/{id}', 'LocationController@update');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Database Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/databases
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'databases'], function () {
|
||||||
|
Route::get('/', 'DatabaseController@index')->name('admin.databases');
|
||||||
|
Route::get('/view/{id}', 'DatabaseController@view')->name('admin.databases.view');
|
||||||
|
|
||||||
|
Route::post('/', 'DatabaseController@create');
|
||||||
|
Route::post('/view/{id}', 'DatabaseController@update');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Settings Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/settings
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'settings'], function () {
|
||||||
|
Route::get('/', 'BaseController@getSettings')->name('admin.settings');
|
||||||
|
|
||||||
|
Route::post('/', 'BaseController@postSettings');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| User Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/users
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'users'], function () {
|
||||||
|
Route::get('/', 'UserController@getIndex')->name('admin.users');
|
||||||
|
Route::get('/accounts.json', 'UserController@getJson')->name('admin.users.json');
|
||||||
|
Route::get('/new', 'UserController@getNew')->name('admin.users.new');
|
||||||
|
Route::get('/view/{id}', 'UserController@getView')->name('admin.users.view');
|
||||||
|
|
||||||
|
Route::post('/new', 'UserController@postNew');
|
||||||
|
Route::post('/view/{id}', 'UserController@updateUser');
|
||||||
|
|
||||||
|
Route::delete('/view/{id}', 'UserController@deleteUser');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/servers
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'servers'], function () {
|
||||||
|
Route::get('/', 'ServersController@index')->name('admin.servers');
|
||||||
|
Route::get('/new', 'ServersController@new')->name('admin.servers.new');
|
||||||
|
Route::get('/new/nodes', 'ServersController@newServerNodes')->name('admin.servers.new.nodes');
|
||||||
|
Route::get('/view/{id}', 'ServersController@viewIndex')->name('admin.servers.view');
|
||||||
|
Route::get('/view/{id}/details', 'ServersController@viewDetails')->name('admin.servers.view.details');
|
||||||
|
Route::get('/view/{id}/build', 'ServersController@viewBuild')->name('admin.servers.view.build');
|
||||||
|
Route::get('/view/{id}/startup', 'ServersController@viewStartup')->name('admin.servers.view.startup');
|
||||||
|
Route::get('/view/{id}/startup', 'ServersController@viewDatabase')->name('admin.servers.view.database');
|
||||||
|
Route::get('/view/{id}/manage', 'ServersController@viewManage')->name('admin.servers.view.manage');
|
||||||
|
Route::get('/view/{id}/delete', 'ServersController@viewDelete')->name('admin.servers.view.delete');
|
||||||
|
|
||||||
|
Route::post('/new', 'ServersController@create');
|
||||||
|
Route::post('/view/{id}/details', 'ServersController@setDetails');
|
||||||
|
Route::post('/view/{id}/details/container', 'ServersController@setContainer')->name('admin.servers.view.details.container');
|
||||||
|
Route::post('/view/{id}/build', 'ServersController@updateBuild');
|
||||||
|
Route::post('/view/{id}/build', 'ServersController@saveStartup');
|
||||||
|
Route::post('/view/{id}/database', 'ServersController@newDatabase');
|
||||||
|
Route::post('/view/{id}/manage/toggle', 'ServersController@toggleInstall')->name('admin.servers.view.manage.toggle');
|
||||||
|
Route::post('/view/{id}/manage/rebuild', 'ServersController@rebuildContainer')->name('admin.servers.view.manage.rebuild');
|
||||||
|
Route::post('/view/{id}/manage/suspension', 'ServersController@manageSuspension')->name('admin.servers.view.manage.suspension');
|
||||||
|
Route::post('/view/{id}/delete', 'ServersController@delete');
|
||||||
|
|
||||||
|
Route::patch('/view/{id}/database', 'ServersController@resetDatabasePassword');
|
||||||
|
|
||||||
|
Route::delete('/view/{id}/database/{database}/delete', 'ServersController@deleteDatabase')->name('admin.servers.view.database.delete');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Node Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/nodes
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'nodes'], function () {
|
||||||
|
Route::get('/', 'NodesController@index')->name('admin.nodes');
|
||||||
|
Route::get('/new', 'NodesController@new')->name('admin.nodes.new');
|
||||||
|
Route::get('/view/{id}', 'NodesController@viewIndex')->name('admin.nodes.view');
|
||||||
|
Route::get('/view/{id}/settings', 'NodesController@viewSettings')->name('admin.nodes.view.settings');
|
||||||
|
Route::get('/view/{id}/configuration', 'NodesController@viewConfiguration')->name('admin.nodes.view.configuration');
|
||||||
|
Route::get('/view/{id}/allocation', 'NodesController@viewAllocation')->name('admin.nodes.view.allocation');
|
||||||
|
Route::get('/view/{id}/servers', 'NodesController@viewServers')->name('admin.nodes.view.servers');
|
||||||
|
Route::get('/view/{id}/settings/token', 'NodesController@setToken')->name('admin.nodes.view.configuration.token');
|
||||||
|
|
||||||
|
Route::post('/new', 'NodesController@create');
|
||||||
|
Route::post('/view/{id}/settings', 'NodesController@updateSettings');
|
||||||
|
Route::post('/view/{id}/allocation', 'NodesController@createAllocation');
|
||||||
|
Route::post('/view/{id}/allocation/remove', 'NodesController@allocationRemoveBlock')->name('admin.nodes.view.allocation.removeBlock');
|
||||||
|
Route::post('/view/{id}/allocation/alias', 'NodesController@allocationSetAlias')->name('admin.nodes.view.allocation.setAlias');
|
||||||
|
|
||||||
|
Route::delete('/view/{id}/delete', 'NodesController@delete')->name('admin.nodes.view.delete');
|
||||||
|
Route::delete('/view/{id}/allocation/remove/{allocation}', 'NodesController@allocationRemoveSingle')->name('admin.nodes.view.allocation.removeSingle');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Service Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/services
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'services'], function () {
|
||||||
|
Route::get('/', 'ServiceController@index')->name('admin.services');
|
||||||
|
Route::get('/new', 'ServiceController@new')->name('admin.services.new');
|
||||||
|
Route::get('/view/{id}', 'ServiceController@view')->name('admin.services.view');
|
||||||
|
Route::get('/view/{id}/functions', 'ServiceController@viewFunctions')->name('admin.services.view.functions');
|
||||||
|
Route::get('/option/new', 'OptionController@new')->name('admin.services.option.new');
|
||||||
|
Route::get('/option/{id}', 'OptionController@viewConfiguration')->name('admin.services.option.view');
|
||||||
|
Route::get('/option/{id}/variables', 'OptionController@viewVariables')->name('admin.services.option.variables');
|
||||||
|
|
||||||
|
Route::post('/new', 'ServiceController@create');
|
||||||
|
Route::post('/view/{id}', 'ServiceController@edit');
|
||||||
|
Route::post('/option/new', 'OptionController@new');
|
||||||
|
Route::post('/option/{id}', 'OptionController@editConfiguration');
|
||||||
|
Route::post('/option/{id}/variables', 'OptionController@createVariable');
|
||||||
|
Route::post('/option/{id}/variables/{variable}', 'OptionController@editVariable')->name('admin.services.option.variables.edit');
|
||||||
|
|
||||||
|
Route::delete('/view/{id}', 'ServiceController@delete');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Pack Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /admin/packs
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'packs'], function () {
|
||||||
|
Route::get('/', 'PackController@index')->name('admin.packs');
|
||||||
|
Route::get('/new', 'PackController@new')->name('admin.packs.new');
|
||||||
|
Route::get('/new/template', 'PackController@newTemplate')->name('admin.packs.new.template');
|
||||||
|
Route::get('/view/{id}', 'PackController@view')->name('admin.packs.view');
|
||||||
|
|
||||||
|
Route::post('/new', 'PackController@create');
|
||||||
|
Route::post('/view/{id}', 'PackController@update');
|
||||||
|
Route::post('/view/{id}/export/{files?}', 'PackController@export')->name('admin.packs.view.export');
|
||||||
|
});
|
@ -22,36 +22,13 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
Route::get('/logout', 'LoginController@logout')->name('auth.logout');
|
||||||
|
Route::get('/login', 'LoginController@showLoginForm')->name('auth.login');
|
||||||
|
Route::get('/login/totp', 'LoginController@totp')->name('auth.totp');
|
||||||
|
Route::get('/password', 'ForgotPasswordController@showLinkRequestForm')->name('auth.password');
|
||||||
|
Route::get('/password/reset/{token}', 'ForgotPasswordController@showResetForm')->name('auth.reset');
|
||||||
|
|
||||||
use Illuminate\Routing\Router;
|
Route::post('/login', 'LoginController@login')->middleware('recaptcha');
|
||||||
|
Route::post('/login', 'LoginController@totpCheckpoint');
|
||||||
class RemoteRoutes
|
Route::post('/password/reset', 'ResetPasswordController@reset')->name('auth.reset.post')->middleware('recaptcha');
|
||||||
{
|
Route::post('/password/reset/{token}', 'ForgotPasswordController@sendResetLinkEmail')->middleware('recaptcha');
|
||||||
/**
|
|
||||||
* Remote daemon routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
$router->group(['prefix' => 'remote'], function () use ($router) {
|
|
||||||
// Handles Remote Download Authentication Requests
|
|
||||||
$router->post('download', [
|
|
||||||
'as' => 'remote.download',
|
|
||||||
'uses' => 'Remote\RemoteController@postDownload',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->post('install', [
|
|
||||||
'as' => 'remote.install',
|
|
||||||
'uses' => 'Remote\RemoteController@postInstall',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('configuration/{token}', [
|
|
||||||
'as' => 'remote.configuration',
|
|
||||||
'uses' => 'Remote\RemoteController@getConfiguration',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
78
routes/base.php
Normal file
78
routes/base.php
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Pterodactyl - Panel
|
||||||
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::get('/', 'IndexController@getIndex')->name('index');
|
||||||
|
Route::get('/index', function () {
|
||||||
|
redirect()->route('index');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Account Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /account
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'account'], function () {
|
||||||
|
Route::get('/', 'AccountController@index')->name('account');
|
||||||
|
|
||||||
|
Route::post('/', 'AccountController@update');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Account API Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /account/api
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'account/api'], function () {
|
||||||
|
Route::get('/', 'APIController@index')->name('account.api');
|
||||||
|
Route::get('/new', 'APIController@new')->name('account.api.new');
|
||||||
|
|
||||||
|
Route::post('/new', 'APIController@save');
|
||||||
|
|
||||||
|
Route::delete('/revoke/{key}', 'APIController@revoke')->name('account.api.revoke');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Account Security Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /account/security
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'account/security'], function () {
|
||||||
|
Route::get('/', 'SecurityController@index')->name('account.security');
|
||||||
|
Route::get('/revoke/{id}', 'SecurityController@revoke')->name('account.security.revoke');
|
||||||
|
|
||||||
|
Route::put('/totp', 'SecurityController@generateTotp')->name('account.security.totp');
|
||||||
|
|
||||||
|
Route::post('/totp', 'SecurityController@setTotp');
|
||||||
|
|
||||||
|
Route::delete('/api/security/totp', 'SecurityController@disableTotp');
|
||||||
|
});
|
@ -22,39 +22,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
Route::get('/services', 'ServiceController@list')->name('daemon.services');
|
||||||
|
Route::get('/services/pull/{service}/{file}', 'ServiceController@pull')->name('daemon.pull');
|
||||||
use Illuminate\Routing\Router;
|
Route::get('/packs/pull/{uuid}', 'PackController@pull')->name('daemon.pack.pull');
|
||||||
|
Route::get('/packs/pull/{uuid}/hash', 'PackController@hash')->name('daemon.pack.hash');
|
||||||
class DaemonRoutes
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Daemon routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
$router->group(['prefix' => 'daemon', 'middleware' => 'daemon'], function () use ($router) {
|
|
||||||
$router->get('services', [
|
|
||||||
'as' => 'daemon.services',
|
|
||||||
'uses' => 'Daemon\ServiceController@list',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('services/pull/{service}/{file}', [
|
|
||||||
'as' => 'remote.install',
|
|
||||||
'uses' => 'Daemon\ServiceController@pull',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$router->get('packs/pull/{uuid}', [
|
|
||||||
'as' => 'daemon.pack.pull',
|
|
||||||
'uses' => 'Daemon\PackController@pull',
|
|
||||||
]);
|
|
||||||
$router->get('packs/pull/{uuid}/hash', [
|
|
||||||
'as' => 'daemon.pack.hash',
|
|
||||||
'uses' => 'Daemon\PackController@hash',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,23 +22,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Pterodactyl\Http\Routes;
|
Route::get('/configuration/{token}', 'RemoteController@getConfiguration')->name('remote.configuration');
|
||||||
|
|
||||||
use Illuminate\Routing\Router;
|
Route::post('/download', 'RemoteController@postDownload')->name('remote.download');
|
||||||
|
Route::post('/install', 'RemoteController@postInstall')->name('remote.install');
|
||||||
class LanguageRoutes
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Language controller routes.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Routing\Router $router
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function map(Router $router)
|
|
||||||
{
|
|
||||||
$router->get('language/{lang}', [
|
|
||||||
'as' => 'langauge.set',
|
|
||||||
'uses' => 'Base\LanguageController@setLanguage',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
117
routes/server.php
Normal file
117
routes/server.php
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Pterodactyl - Panel
|
||||||
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Route::get('/', 'ServerController@getIndex')->name('server.index');
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server Settings Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /server/{server}/settings
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'settings'], function () {
|
||||||
|
Route::get('/databases', 'ServerController@getDatabases')->name('server.settings.databases');
|
||||||
|
Route::get('/sftp', 'ServerController@getSFTP')->name('server.settings.sftp');
|
||||||
|
Route::get('/startup', 'ServerController@getStartup')->name('server.settings.startup');
|
||||||
|
Route::get('/allocation', 'ServerController@getAllocation')->name('server.settings.allocation');
|
||||||
|
|
||||||
|
Route::post('/sftp', 'ServerController@postSettingsSFTP');
|
||||||
|
Route::post('/startup', 'ServerController@postSettingsStartup');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server File Manager Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /server/{server}/files
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'files'], function () {
|
||||||
|
Route::get('/', 'ServerController@getFiles')->name('server.files.index');
|
||||||
|
Route::get('/add', 'ServerController@getAddFile')->name('server.files.add');
|
||||||
|
Route::get('/edit/{file}', 'ServerController@getEditFile')->name('server.files.edit');
|
||||||
|
Route::get('/download/{file}', 'ServerController@getDownloadFile')
|
||||||
|
->name('server.files.edit')
|
||||||
|
->where('file', '.*');
|
||||||
|
|
||||||
|
Route::post('/directory-list', 'AjaxController@postDirectoryList')->name('server.files.directory-list');
|
||||||
|
Route::post('/save', 'AjaxController@postSaveFile')->name('server.files.save');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server Subuser Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /server/{server}/users
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'users'], function () {
|
||||||
|
Route::get('/', 'SubuserController@getIndex')->name('server.subusers');
|
||||||
|
Route::get('/new', 'SubuserController@getNew')->name('server.subusers.new');
|
||||||
|
Route::get('/view/{id}', 'SubuserController@getView')->name('server.subusers.view');
|
||||||
|
|
||||||
|
Route::post('/new', 'SubuserController@postNew');
|
||||||
|
Route::post('/view/{id}', 'SubuserController@postView');
|
||||||
|
|
||||||
|
Route::delete('/delete/{id}', 'SubuserController@deleteSubuser')->name('server.subusers.delete');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server Task Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /server/{server}/tasks
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'tasks'], function () {
|
||||||
|
Route::get('/', 'TaskController@getIndex')->name('server.tasks');
|
||||||
|
Route::get('/new', 'TaskController@getNew')->name('server.tasks.new');
|
||||||
|
Route::get('/view/{id}', 'TaskController@getView')->name('server.tasks.view');
|
||||||
|
|
||||||
|
Route::post('/new', 'TaskController@postNew');
|
||||||
|
Route::post('/view/{id}', 'SubuserController@postView');
|
||||||
|
Route::post('/toggle/{id}', 'TaskController@toggleTask')->name('server.tasks.toggle');
|
||||||
|
|
||||||
|
Route::delete('/delete/{id}', 'TaskController@deleteTask')->name('server.tasks.delete');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Server Ajax Controller Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Endpoint: /server/{server}/ajax
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
Route::group(['prefix' => 'ajax'], function () {
|
||||||
|
Route::get('/status', 'Server\AjaxController@getStatus')->name('server.ajax.status');
|
||||||
|
|
||||||
|
Route::post('/set-primary', 'AjaxController@postSetPrimary')->name('server.ajax.set-primary');
|
||||||
|
Route::post('/settings/reset-database-password', 'AjaxController@postResetDatabasePassword')->name('server.ajax.reset-database-password');
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user