Skip to content

Commit a66d7a3

Browse files
committed
Merge branch 'develop' into feature/vuejs
2 parents d34c737 + 6b3f8af commit a66d7a3

File tree

73 files changed

+1867
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1867
-558
lines changed

.github/ISSUE_TEMPLATE/---bug-report.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
---
22
name: "\U0001F41B Bug Report"
3-
about: Create a report to help us resolve a bug or error
3+
about: For reporting code or design bugs with the software. DO NOT REPORT APACHE/NGINX/PHP CONFIGURATION ISSUES.
44

55
---
66

7+
DO NOT REPORT ISSUES CONFIGURING: SSL, PHP, APACHE, NGINX, YOUR MACHINE, SSH, SFTP, ETC. ON THIS GITHUB TRACKER.
8+
9+
For assistance installating this software, as well as debugging issues with dependencies, please use our discord server: https://discord.gg/pterodactyl
10+
11+
You MUST complete all of the below information when reporting a bug, failure to do so will result in closure of your issue. PLEASE stop spamming our tracker with "bugs" that are not related to this project.
12+
13+
**STOP: READ FIRST, AND THEN DELETE THE ABOVE LINES**
14+
715
**Background (please complete the following information):**
816
* Panel or Daemon:
917
* Version of Panel/Daemon:

.github/ISSUE_TEMPLATE/--installation-help.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ about: 'Visit our Discord for installation help: https://pterodactyl.io/discord'
66

77
We use GitHub issues only to discuss about Pterodactyl bugs and new features. For
88
this kind of questions about using Pterodactyl, please visit our Discord for assistance: https://pterodactyl.io/discord
9+
10+
DO NOT REPORT ISSUES CONFIGURING: SSL, PHP, APACHE, NGINX, YOUR MACHINE, SSH, SFTP, ETC. ON THIS GITHUB TRACKER.
11+
12+
For assistance installating this software, as well as debugging issues with dependencies, please use our discord server: https://discord.gg/pterodactyl
13+
14+
PLEASE stop spamming our tracker with "bugs" that are not related to this project.

CHANGELOG.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,45 @@ This file is a running track of new features and fixes to each version of the pa
33

44
This project follows [Semantic Versioning](http://semver.org) guidelines.
55

6+
## v0.7.13 (Derelict Dermodactylus)
7+
### Fixed
8+
* Fixes a bug with the location update API endpoint throwing an error due to an unexected response value.
9+
* Fixes bug where node creation API endpoint was not correctly requiring the `disk_overallocate` key.
10+
* Prevents an exception from being thrown when a database with the same name is created on two different hosts.
11+
* Fixes the redis password not saving correctly when setting up the environment from the command line.
12+
* Fixes a bug with transaction handling in many areas of the application that would cause validation error messages
13+
and other session data to not be persisted properly when using the database as the session driver.
14+
* Fix a bug introduced at some point in the past that causes internal data integrity exceptions to not bubble up to
15+
the user correctly, leading to extraneous and confusing exception messages.
16+
* Fixes a bug causing servers to not be marked as having failed installation in some cases.
17+
18+
### Changed
19+
* `allocation_limit` for servers now defaults to a null value, and is not required in PATCH/POST requests when adding
20+
a server through the API.
21+
* The `PATCH` endpoint for `/api/applications/servers/{server}/build` now accepts an array called `limits` to match
22+
the response from the server `GET` endpoint.
23+
24+
### Added
25+
* The server listing for a node is now paginated to 25 servers per page to improve performance on large nodes.
26+
627
## v0.7.12 (Derelict Dermodactylus)
728
### Fixed
829
* Fixes an issue with the locations API endpoint referencing an invalid namespace.
930
* Fixes the `store()` function on the locations API not working due to an incorrect return typehint.
1031
* Fixes daemon secrets not being able to be reset on a Node.
11-
32+
* Fixes an issue where files were not editable due to missing URL encoding in the file manager.
33+
* Fixed checking of language changes
34+
* Fixed Spigot egg not building versions other than `latest`.
35+
* Fixed the Forge egg install script.
36+
* Fixes a bug that would ignore the `skip_scripts` setting when creating or editing a server.
37+
1238
### Updated
1339
* Upgraded core to use Laravel `5.7.14`.
40+
* Updated Simplified Chinese translation pack.
1441

1542
### Added
1643
* Added support for opening and editing Python files through the web editor.
44+
* Adds Russian translation.
1745

1846
## v0.7.11 (Derelict Dermodactylus)
1947
### Fixed

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ private function checkForRedis()
178178
if ($askForRedisPassword) {
179179
$this->output->comment(trans('command/messages.environment.app.redis_pass_help'));
180180
$this->variables['REDIS_PASSWORD'] = $this->option('redis-pass') ?? $this->output->askHidden(
181-
trans('command/messages.environment.app.redis_password'), function () {
182-
return '';
183-
}
181+
trans('command/messages.environment.app.redis_password')
184182
);
185183
}
186184

app/Contracts/Repository/NodeRepositoryInterface.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ public function loadLocationAndServerCount(Node $node, bool $refresh = false): N
5555
*/
5656
public function loadNodeAllocations(Node $node, bool $refresh = false): Node;
5757

58-
/**
59-
* Return a node with all of the servers attached to that node.
60-
*
61-
* @param int $id
62-
* @return \Pterodactyl\Models\Node
63-
*
64-
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
65-
*/
66-
public function getNodeServers(int $id): Node;
67-
6858
/**
6959
* Return a collection of nodes for all locations to use in server creation UI.
7060
*

app/Contracts/Repository/ServerRepositoryInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,14 @@ public function isUniqueUuidCombo(string $uuid, string $short): bool;
152152
* @return int
153153
*/
154154
public function getSuspendedServersCount(): int;
155+
156+
/**
157+
* Returns all of the servers that exist for a given node in a paginated response.
158+
*
159+
* @param int $node
160+
* @param int $limit
161+
*
162+
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
163+
*/
164+
public function loadAllServersForNode(int $node, int $limit): LengthAwarePaginator;
155165
}

app/Exceptions/Handler.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PDOException;
77
use Psr\Log\LoggerInterface;
88
use Illuminate\Container\Container;
9+
use Illuminate\Database\Connection;
910
use Illuminate\Auth\AuthenticationException;
1011
use Illuminate\Session\TokenMismatchException;
1112
use Illuminate\Validation\ValidationException;
@@ -14,6 +15,7 @@
1415
use Symfony\Component\HttpKernel\Exception\HttpException;
1516
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
1617
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
18+
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
1719

1820
class Handler extends ExceptionHandler
1921
{
@@ -137,6 +139,41 @@ class_basename($exception),
137139
*/
138140
public function render($request, Exception $exception)
139141
{
142+
$connections = Container::getInstance()->make(Connection::class);
143+
144+
// If we are currently wrapped up inside a transaction, we will roll all the way
145+
// back to the beginning. This needs to happen, otherwise session data does not
146+
// get properly persisted.
147+
//
148+
// This is kind of a hack, and ideally things like this should be handled as
149+
// much as possible at the code level, but there are a lot of spots that do a
150+
// ton of actions and were written before this bug discovery was made.
151+
//
152+
// @see https://github.com/pterodactyl/panel/pull/1468
153+
if ($connections->transactionLevel()) {
154+
$connections->rollBack(0);
155+
}
156+
157+
// Because of some breaking change snuck into a Laravel update that didn't get caught
158+
// by any of the tests, exceptions implementing the HttpExceptionInterface get marked
159+
// as being HttpExceptions, but aren't actually implementing the HttpException abstract.
160+
//
161+
// This is incredibly annoying because we can't just temporarily override the handler to
162+
// allow these (at least without taking on a high maintenance cost). Laravel 5.8 fixes this,
163+
// so when we update (or have updated) this code can be removed.
164+
//
165+
// @see https://github.com/laravel/framework/pull/25975
166+
// @todo remove this code when upgrading to Laravel 5.8
167+
if ($exception instanceof HttpExceptionInterface && ! $exception instanceof HttpException) {
168+
$exception = new HttpException(
169+
$exception->getStatusCode(),
170+
$exception->getMessage(),
171+
$exception,
172+
$exception->getHeaders(),
173+
$exception->getCode()
174+
);
175+
}
176+
140177
return parent::render($request, $exception);
141178
}
142179

app/Exceptions/Repository/RecordNotFoundException.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22

33
namespace Pterodactyl\Exceptions\Repository;
44

5-
class RecordNotFoundException extends RepositoryException
5+
use Illuminate\Http\Response;
6+
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
7+
8+
class RecordNotFoundException extends RepositoryException implements HttpExceptionInterface
69
{
710
/**
8-
* Handle request to render this exception to a user. Returns the default
9-
* 404 page view.
11+
* Returns the status code.
12+
*
13+
* @return int
14+
*/
15+
public function getStatusCode()
16+
{
17+
return Response::HTTP_NOT_FOUND;
18+
}
19+
20+
/**
21+
* Returns response headers.
1022
*
11-
* @param \Illuminate\Http\Request $request
12-
* @return \Illuminate\Http\Response
23+
* @return array
1324
*/
14-
public function render($request)
25+
public function getHeaders()
1526
{
16-
if (! config('app.debug')) {
17-
return response()->view('errors.404', [], 404);
18-
}
27+
return [];
1928
}
2029
}

app/Http/Controllers/Admin/NodesController.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Pterodactyl\Services\Helpers\SoftwareVersionService;
2525
use Pterodactyl\Http\Requests\Admin\Node\NodeFormRequest;
2626
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface;
27+
use Pterodactyl\Contracts\Repository\ServerRepositoryInterface;
2728
use Pterodactyl\Http\Requests\Admin\Node\AllocationFormRequest;
2829
use Pterodactyl\Services\Allocations\AllocationDeletionService;
2930
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
@@ -32,6 +33,11 @@
3233

3334
class NodesController extends Controller
3435
{
36+
/**
37+
* @var \Pterodactyl\Services\Allocations\AllocationDeletionService
38+
*/
39+
protected $allocationDeletionService;
40+
3541
/**
3642
* @var \Prologue\Alerts\AlertsMessageBag
3743
*/
@@ -72,6 +78,11 @@ class NodesController extends Controller
7278
*/
7379
protected $repository;
7480

81+
/**
82+
* @var \Pterodactyl\Contracts\Repository\ServerRepositoryInterface
83+
*/
84+
protected $serverRepository;
85+
7586
/**
7687
* @var \Pterodactyl\Services\Nodes\NodeUpdateService
7788
*/
@@ -81,10 +92,6 @@ class NodesController extends Controller
8192
* @var \Pterodactyl\Services\Helpers\SoftwareVersionService
8293
*/
8394
protected $versionService;
84-
/**
85-
* @var \Pterodactyl\Services\Allocations\AllocationDeletionService
86-
*/
87-
private $allocationDeletionService;
8895

8996
/**
9097
* NodesController constructor.
@@ -98,6 +105,7 @@ class NodesController extends Controller
98105
* @param \Pterodactyl\Services\Nodes\NodeDeletionService $deletionService
99106
* @param \Pterodactyl\Contracts\Repository\LocationRepositoryInterface $locationRepository
100107
* @param \Pterodactyl\Contracts\Repository\NodeRepositoryInterface $repository
108+
* @param \Pterodactyl\Contracts\Repository\ServerRepositoryInterface $serverRepository
101109
* @param \Pterodactyl\Services\Nodes\NodeUpdateService $updateService
102110
* @param \Pterodactyl\Services\Helpers\SoftwareVersionService $versionService
103111
*/
@@ -111,6 +119,7 @@ public function __construct(
111119
NodeDeletionService $deletionService,
112120
LocationRepositoryInterface $locationRepository,
113121
NodeRepositoryInterface $repository,
122+
ServerRepositoryInterface $serverRepository,
114123
NodeUpdateService $updateService,
115124
SoftwareVersionService $versionService
116125
) {
@@ -123,6 +132,7 @@ public function __construct(
123132
$this->deletionService = $deletionService;
124133
$this->locationRepository = $locationRepository;
125134
$this->repository = $repository;
135+
$this->serverRepository = $serverRepository;
126136
$this->updateService = $updateService;
127137
$this->versionService = $versionService;
128138
}
@@ -178,8 +188,6 @@ public function store(NodeFormRequest $request)
178188
*
179189
* @param \Pterodactyl\Models\Node $node
180190
* @return \Illuminate\View\View
181-
*
182-
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
183191
*/
184192
public function viewIndex(Node $node)
185193
{
@@ -235,19 +243,17 @@ public function viewAllocation(Node $node)
235243
/**
236244
* Shows the server listing page for a specific node.
237245
*
238-
* @param int $node
246+
* @param \Pterodactyl\Models\Node $node
239247
* @return \Illuminate\View\View
240-
*
241-
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
242248
*/
243-
public function viewServers($node)
249+
public function viewServers(Node $node)
244250
{
245-
$node = $this->repository->getNodeServers($node);
251+
$servers = $this->serverRepository->loadAllServersForNode($node->id, 25);
246252
Javascript::put([
247253
'node' => collect($node->makeVisible('daemonSecret'))->only(['scheme', 'fqdn', 'daemonListen', 'daemonSecret']),
248254
]);
249255

250-
return view('admin.nodes.view.servers', ['node' => $node]);
256+
return view('admin.nodes.view.servers', ['node' => $node, 'servers' => $servers]);
251257
}
252258

253259
/**

app/Http/Controllers/Api/Application/Locations/LocationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
1414
use Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationRequest;
1515
use Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationsRequest;
16-
use Pterodactyl\Http\Requests\Api\Application\Locations\DeleteLocationRequest;
1716
use Pterodactyl\Http\Requests\Api\Application\Locations\StoreLocationRequest;
17+
use Pterodactyl\Http\Requests\Api\Application\Locations\DeleteLocationRequest;
1818
use Pterodactyl\Http\Requests\Api\Application\Locations\UpdateLocationRequest;
1919

2020
class LocationController extends ApplicationApiController

0 commit comments

Comments
 (0)