Skip to content

Commit b725e45

Browse files
authored
Merge pull request pterodactyl#4 from pterodactyl/release/v1.0.1
Release/v1.0.1
2 parents edeaa69 + 59305f1 commit b725e45

File tree

187 files changed

+3722
-5826
lines changed

Some content is hidden

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

187 files changed

+3722
-5826
lines changed

CHANGELOG.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,49 @@ 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+
## v1.0.0
7+
Pterodactyl 1.0 represents the culmination of over two years of work, almost 2,000 commits, endless bug and feature requests, and a dream that
8+
has been in the making since 2013. 🎉
9+
10+
Due to the sheer size and timeline of this release I've massively truncated the listing below. There are numerous smaller
11+
bug fixes and changes that would simply be too difficult to keep track of here. Please feel free to browse through the releases
12+
tab for this repository to see more specific changes that have been made.
13+
14+
### Added
15+
* Adds a new client-facing API allowing a user to control all aspects of their individual servers, or servers
16+
which they have been granted access to as a subuser.
17+
* Adds the ability for backups to be created for a server both manually and via a scheduled task.
18+
* Adds the ability for users to modify their server allocations on the fly and include notes for each allocation.
19+
* Adds the ability for users to generate recovery tokens for 2FA protected logins which can be used in place of
20+
a code should their device be inaccessible.
21+
* Adds support for transfering servers between Nodes via the Panel.
22+
* Adds the ability to assign specific CPU cores to a server (CPU Pinning) process.
23+
* Server owners can now reinstall their assigned server egg automatically with a button on the frontend.
24+
25+
### Changed
26+
* The entire user frontend has been replaced with a responsive, React backed design implemented using Tailwind CSS.
27+
* Replaces a large amount of complex daemon authentication logic by funneling most API calls through the Panel, and using
28+
JSON Web Tokens where necessary to handle one-time direct authentication with Wings.
29+
* Frontend server listing now includes a toggle to show or hide servers which an administrator has access to, rather
30+
than always showing all servers on the system when logged into an admin account.
31+
* We've replaced Ace Editor on the frontend with a better solution to allow lighter builds and more end-user functionality.
32+
* Server permissions have been overhauled to be both easier to understand in the codebase, and allows plugins to better
33+
hook into the permission system.
34+
35+
### Removed
36+
* Removes large swaths of code complexity and confusing interface designs that caused a lot of pain to new developers
37+
trying to jump into the codebase. We've simplified this to stick to more established Laravel design standards to make
38+
it easy to parse through the project and make contributions.
39+
40+
## v0.7.19 (Derelict Dermodactylus)
41+
### Fixed
42+
* **[Security]** Fixes XSS in the admin area's server owner selection.
43+
44+
## v0.7.18 (Derelict Dermodactylus)
45+
### Fixed
46+
* **[Security]** Re-addressed missed endpoint that would not properly limit a user account to 5 API keys.
47+
* **[Security]** Addresses a Client API vulnerability that would allow a user to list all servers on the system ([`GHSA-6888-7f3w-92jx`](https://github.com/pterodactyl/panel/security/advisories/GHSA-6888-7f3w-92jx))
48+
649
## v0.7.17 (Derelict Dermodactylus)
750
### Fixed
851
* Limited accounts to 5 API keys at a time.
@@ -301,7 +344,7 @@ the response from the server `GET` endpoint.
301344
* Nest and Egg listings now show the associated ID in order to make API requests easier.
302345
* Added star indicators to user listing in Admin CP to indicate users who are set as a root admin.
303346
* Creating a new node will now requires a SSL connection if the Panel is configured to use SSL as well.
304-
* Connector error messages due to permissions are now rendered correctly in the UI rather than causing a silent failure.
347+
* Socketio error messages due to permissions are now rendered correctly in the UI rather than causing a silent failure.
305348
* File manager now supports mass deletion option for files and folders.
306349
* Support for CS:GO as a default service option selection.
307350
* Support for GMOD as a default service option selection.
@@ -431,7 +474,7 @@ the response from the server `GET` endpoint.
431474
* Changed 2FA login process to be more secure. Previously authentication checking happened on the 2FA post page, now it happens prior and is passed along to the 2FA page to avoid storing any credentials.
432475

433476
### Added
434-
* Connector error messages due to permissions are now rendered correctly in the UI rather than causing a silent failure.
477+
* Socketio error messages due to permissions are now rendered correctly in the UI rather than causing a silent failure.
435478

436479
## v0.7.0-beta.1 (Derelict Dermodactylus)
437480
### Added

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
[![Logo Image](https://cdn.pterodactyl.io/logos/new/pterodactyl_logo.png)](https://pterodactyl.io)
22

3-
[![Build status](https://img.shields.io/travis/pterodactyl/panel/develop.svg?style=flat-square)](https://travis-ci.org/pterodactyl/panel)
4-
[![Codecov](https://img.shields.io/codecov/c/github/pterodactyl/panel/develop.svg?style=flat-square)](https://codecov.io/gh/Pterodactyl/Panel)
5-
[![Discord](https://img.shields.io/discord/122900397965705216.svg?style=flat-square&label=Discord)](https://pterodactyl.io/discord)
3+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pterodactyl/panel/tests?label=Tests&style=for-the-badge)
4+
![Discord](https://img.shields.io/discord/122900397965705216?label=Discord&logo=Discord&logoColor=white&style=for-the-badge)
5+
![GitHub Releases](https://img.shields.io/github/downloads/pterodactyl/panel/latest/total?style=for-the-badge)
6+
![GitHub Pre-Releases](https://img.shields.io/github/downloads-pre/pterodactyl/panel/v1.0.0-rc.7/total?style=for-the-badge)
7+
![GitHub contributors](https://img.shields.io/github/contributors/pterodactyl/panel?style=for-the-badge)
68

79
# Pterodactyl Panel
810
Pterodactyl is an open-source game server management panel built with PHP 7, React, and Go. Designed with security
@@ -25,6 +27,7 @@ I would like to extend my sincere thanks to the following sponsors for helping f
2527
| [**DedicatedMC**](https://dedicatedmc.io/) | DedicatedMC provides Raw Power hosting at affordable pricing, making sure to never compromise on your performance and giving you the best performance money can buy. |
2628
| [**Skynode**](https://www.skynode.pro/) | Skynode provides blazing fast game servers along with a top-notch user experience. Whatever our clients are looking for, we're able to provide it! |
2729
| [**XCORE-SERVER.de**](https://xcore-server.de/) | XCORE-SERVER.de offers High-End Servers for hosting and gaming since 2012. Fast, excellent and well-known for eSports Gaming. |
30+
| [**RoyaleHosting**](https://royalehosting.net/) | Build your dreams and deploy them with RoyaleHosting’s reliable servers and network. Easy to use, provisioned in a couple of minutes. |
2831

2932
## Documentation
3033
* [Panel Documentation](https://pterodactyl.io/panel/1.0/getting_started.html)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Pterodactyl\Console\Commands\Overrides;
4+
5+
use Pterodactyl\Console\RequiresDatabaseMigrations;
6+
use Illuminate\Database\Console\Seeds\SeedCommand as BaseSeedCommand;
7+
8+
class SeedCommand extends BaseSeedCommand
9+
{
10+
use RequiresDatabaseMigrations;
11+
12+
/**
13+
* Block someone from running this seed command if they have not completed the migration
14+
* process.
15+
*
16+
* @return int
17+
*/
18+
public function handle()
19+
{
20+
if (!$this->hasCompletedMigrations()) {
21+
return $this->showMigrationWarning();
22+
}
23+
24+
return parent::handle();
25+
}
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Pterodactyl\Console\Commands\Overrides;
4+
5+
use Pterodactyl\Console\RequiresDatabaseMigrations;
6+
use Illuminate\Foundation\Console\UpCommand as BaseUpCommand;
7+
8+
class UpCommand extends BaseUpCommand
9+
{
10+
use RequiresDatabaseMigrations;
11+
12+
/**
13+
* @return bool|int
14+
*/
15+
public function handle()
16+
{
17+
if (!$this->hasCompletedMigrations()) {
18+
return $this->showMigrationWarning();
19+
}
20+
21+
return parent::handle();
22+
}
23+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
namespace Pterodactyl\Console;
4+
5+
/**
6+
* @mixin \Illuminate\Console\Command
7+
*/
8+
trait RequiresDatabaseMigrations
9+
{
10+
/**
11+
* Checks if the migrations have finished running by comparing the last migration file.
12+
*
13+
* @return bool
14+
*/
15+
protected function hasCompletedMigrations(): bool
16+
{
17+
/** @var \Illuminate\Database\Migrations\Migrator $migrator */
18+
$migrator = $this->getLaravel()->make('migrator');
19+
20+
$files = $migrator->getMigrationFiles(database_path('migrations'));
21+
22+
if (! $migrator->repositoryExists()) {
23+
return false;
24+
}
25+
26+
if (array_diff(array_keys($files), $migrator->getRepository()->getRan())) {
27+
return false;
28+
}
29+
30+
return true;
31+
}
32+
33+
/**
34+
* Throw a massive error into the console to hopefully catch the users attention and get
35+
* them to properly run the migrations rather than ignoring all of the other previous
36+
* errors...
37+
*
38+
* @return int
39+
*/
40+
protected function showMigrationWarning(): int
41+
{
42+
$this->getOutput()->writeln("<options=bold>
43+
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
44+
| |
45+
| Your database has not been properly migrated! |
46+
| |
47+
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |</>
48+
49+
You must run the following command to finish migrating your database:
50+
51+
<fg=green;options=bold>php artisan migrate --step --force</>
52+
53+
You will not be able to use Pterodactyl Panel as expected without fixing your
54+
database state by running the command above.
55+
");
56+
57+
$this->getOutput()->error("You must correct the error above before continuing.");
58+
59+
return 1;
60+
}
61+
}

app/Contracts/Repository/DatabaseRepositoryInterface.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ public function getDatabasesForServer(int $server): Collection;
4242
*/
4343
public function getDatabasesForHost(int $host, int $count = 25): LengthAwarePaginator;
4444

45-
/**
46-
* Create a new database if it does not already exist on the host with
47-
* the provided details.
48-
*
49-
* @param array $data
50-
* @return \Pterodactyl\Models\Database
51-
*
52-
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
53-
* @throws \Pterodactyl\Exceptions\Repository\DuplicateDatabaseNameException
54-
*/
55-
public function createIfNotExists(array $data): Database;
56-
5745
/**
5846
* Create a new database on a given connection.
5947
*

app/Contracts/Repository/NodeRepositoryInterface.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,4 @@ public function loadNodeAllocations(Node $node, bool $refresh = false): Node;
5454
* @return \Illuminate\Support\Collection
5555
*/
5656
public function getNodesForServerCreation(): Collection;
57-
58-
/**
59-
* Return the IDs of all nodes that exist in the provided locations and have the space
60-
* available to support the additional disk and memory provided.
61-
*
62-
* @param array $locations
63-
* @param int $disk
64-
* @param int $memory
65-
* @return \Illuminate\Support\LazyCollection
66-
*/
67-
public function getNodesWithResourceUse(array $locations, int $disk, int $memory): LazyCollection;
6857
}

app/Exceptions/Handler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\HttpKernel\Exception\HttpException;
1818
use Pterodactyl\Exceptions\Repository\RecordNotFoundException;
1919
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
20+
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
2021

2122
class Handler extends ExceptionHandler
2223
{
@@ -190,7 +191,7 @@ public function invalidJson($request, ValidationException $exception)
190191

191192
$converted = self::convertToArray($exception)['errors'][0];
192193
$converted['detail'] = $error;
193-
$converted['meta'] = is_array($converted['meta']) ? array_merge($converted['meta'], $meta) : $meta;
194+
$converted['meta'] = is_array($converted['meta'] ?? null) ? array_merge($converted['meta'], $meta) : $meta;
194195

195196
$response[] = $converted;
196197
}
@@ -217,7 +218,9 @@ public static function convertToArray(Throwable $exception, array $override = []
217218
'status' => method_exists($exception, 'getStatusCode')
218219
? strval($exception->getStatusCode())
219220
: ($exception instanceof ValidationException ? '422' : '500'),
220-
'detail' => 'An error was encountered while processing this request.',
221+
'detail' => $exception instanceof HttpExceptionInterface
222+
? $exception->getMessage()
223+
: 'An unexpected error was encountered while processing this request, please try again.',
221224
];
222225

223226
if ($exception instanceof ModelNotFoundException || $exception->getPrevious() instanceof ModelNotFoundException) {

0 commit comments

Comments
 (0)