Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
danny6167 authored Sep 20, 2024
2 parents 8e2dc72 + 64c7897 commit 7149bc5
Show file tree
Hide file tree
Showing 44 changed files with 1,541 additions and 1,587 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ body:
Run the following command to collect logs on your system.
Wings: `sudo wings diagnostics`
Panel: `tail -n 100 /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log | nc bin.ptdl.co 99`
placeholder: "https://bin.ptdl.co/a1h6z"
Panel: `tail -n 150 /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log | nc pteropaste.com 99`
placeholder: "https://pteropaste.com/a1h6z"
render: bash
validations:
required: false
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: "github.event_name != 'pull_request'"
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -54,7 +55,7 @@ jobs:
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:1}',/" config/app.php
- name: Build and Push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: ./Containerfile
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@ This file is a running track of new features and fixes to each version of the pa

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

## v1.11.7

### Added

* Java 21 to Minecraft eggs

### Changed

* Updated Minecraft EULA link

### Fixed

* Fixed backups not ever being marked as completed (#5088)
* Fixed `.7z` files not being detected as a compressed file (#5016)

## v1.11.6

### Changed

* Better node ownership checks for internal backup endpoints
* Improved validation rules on `docker_image` fields to prevent invalid inputs

### Fixed

* Multiple XSS vulnerabilities in the admin area ([GHSA-384w-wffr-x63q](https://github.com/pterodactyl/panel/security/advisories/GHSA-384w-wffr-x63q))

## v1.11.5
### Fixed
* Rust egg using the wrong Docker image, breaking Rust modding frameworks.

## v1.11.4
### Added
* Added support for the `server.queryport` option on the Rust egg.
* Added support for the Carbon modding framework to the Rust egg.

### Changed
* Upgraded to Laravel 10.
* Sensitive data is no longer shown in the CopyOnClick toast notification.

### Fixed
* Allow SVGs to be edited in the server's file manager.
* Properly validate the request body when creating a backup.
* Fixed issue with schedules running at the wrong time when the panel utilized a timezone with non-hour offsets (such as `Australia/Darwin`).
* Fixes the log directory when running the Panel in a container.
* Fixes the permission name used to check if a user has permission to read files/folders.
* Fixes the ability to unset a server's description through the client API.
* Fixed the MassActionBar on the server's file manager blocking elements below it, preventing them from being interacted with.

## v1.11.3
### Changed
* When updating a server's description through the client API, if no value is specified, the description will now remain unchanged.
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Pterodactyl Panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security
Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security
in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive
UI to end users.

Expand All @@ -24,19 +24,18 @@ Stop settling for less. Make game servers a first class citizen on your platform

## Sponsors

I would like to extend my sincere thanks to the following sponsors for helping fund Pterodactyl's developement.
I would like to extend my sincere thanks to the following sponsors for helping fund Pterodactyl's development.
[Interested in becoming a sponsor?](https://github.com/sponsors/matthewpi)

| Company | About |
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [**WISP**](https://wisp.gg) | Extra features. |
| [**Aussie Server Hosts**](https://aussieserverhosts.com/) | No frills Australian Owned and operated High Performance Server hosting for some of the most demanding games serving Australia and New Zealand. |
| [**BisectHosting**](https://www.bisecthosting.com/) | BisectHosting provides Minecraft, Valheim and other server hosting services with the highest reliability and lightning fast support since 2012. |
| [**MineStrator**](https://minestrator.com/) | Looking for the most highend French hosting company for your minecraft server? More than 24,000 members on our discord trust us. Give us a try! |
| [**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! |
| [**VibeGAMES**](https://vibegames.net/) | VibeGAMES is a game server provider that specializes in DDOS protection for the games we offer. We have multiple locations in the US, Brazil, France, Germany, Singapore, Australia and South Africa. |
| [**Pterodactyl Market**](https://pterodactylmarket.com/) | Pterodactyl Market is a one-and-stop shop for Pterodactyl. In our market, you can find Add-ons, Themes, Eggs, and more for Pterodactyl. |
| [**DutchIS**](https://dutchis.net?ref=pterodactyl) | DutchIS provides instant infrastructure such as pay per use VPS hosting. Start your game hosting journey on DutchIS. |
| Company | About |
|--------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [**Aussie Server Hosts**](https://aussieserverhosts.com/) | No frills Australian Owned and operated High Performance Server hosting for some of the most demanding games serving Australia and New Zealand. |
| [**CodeNode LLC**](https://codenode.gg/) | Looking for simplicity? Well, look no further! CodeNode has got you covered with everything you need at the rock-bottom price of $1.75 per GB, including dedicated IPs in Dallas, Texas, and Amsterdam, Netherlands. We're not just good, we're the best in the game! |
| [**BisectHosting**](https://www.bisecthosting.com/) | BisectHosting provides Minecraft, Valheim and other server hosting services with the highest reliability and lightning fast support since 2012. |
| [**MineStrator**](https://minestrator.com/) | Looking for the most highend French hosting company for your minecraft server? More than 24,000 members on our discord trust us. Give us a try! |
| [**HostEZ**](https://hostez.io) | US & EU Rust & Minecraft Hosting. DDoS Protected bare metal, VPS and colocation with low latency, high uptime and maximum availability. EZ! |
| [**Blueprint**](https://blueprint.zip/?pterodactyl=true) | Create and install Pterodactyl addons and themes with the growing Blueprint framework - the package-manager for Pterodactyl. Use multiple modifications at once without worrying about conflicts and make use of the large extension ecosystem. |
| [**indifferent broccoli**](https://indifferentbroccoli.com/) | indifferent broccoli is a game server hosting and rental company. With us, you get top-notch computer power for your gaming sessions. We destroy lag, latency, and complexity--letting you focus on the fun stuff. |

### Supported Games

Expand Down
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The following versions of Pterodactyl are receiving active support and maintenan

| Panel | Daemon | Supported |
|--------|--------------|--------------------|
| 1.10.x | wings@1.7.x | :white_check_mark: |
| 1.11.x | wings@1.11.x | :white_check_mark: |
| 0.7.x | daemon@0.6.x | :x: |

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Environment/EmailSettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function handle()
trans('command/messages.environment.mail.ask_driver'),
[
'smtp' => 'SMTP Server',
'mail' => 'PHP\'s Internal Mail Function',
'sendmail' => 'sendmail Binary',
'mailgun' => 'Mailgun Transactional Email',
'mandrill' => 'Mandrill Transactional Email',
'postmark' => 'Postmark Transactional Email',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PruneOrphanedBackupsCommand extends Command
{
protected $signature = 'p:maintenance:prune-backups {--prune-age=}';

protected $description = 'Marks all backups that have not completed in the last "n" minutes as being failed.';
protected $description = 'Marks all backups older than "n" minutes that have not yet completed as being failed.';

/**
* PruneOrphanedBackupsCommand constructor.
Expand Down Expand Up @@ -38,7 +38,7 @@ public function handle()
return;
}

$this->warn("Marking $count backups that have not been marked as completed in the last $since minutes as failed.");
$this->warn("Marking $count uncompleted backups that are older than $since minutes as failed.");

$query->update([
'is_successful' => false,
Expand Down
4 changes: 1 addition & 3 deletions app/Helpers/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ final class Time
*/
public static function getMySQLTimezoneOffset(string $timezone): string
{
$offset = round(CarbonImmutable::now($timezone)->getTimezone()->getOffset(CarbonImmutable::now('UTC')) / 3600);

return sprintf('%s%s:00', $offset > 0 ? '+' : '-', str_pad((string) abs($offset), 2, '0', STR_PAD_LEFT));
return CarbonImmutable::now($timezone)->getTimezone()->toOffsetName();
}
}
14 changes: 0 additions & 14 deletions app/Http/Controllers/Admin/BaseController.php

This file was deleted.

2 changes: 0 additions & 2 deletions app/Http/Controllers/Api/Application/Eggs/EggController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class EggController extends ApplicationApiController
public function __construct(private EggExporterService $eggExporterService)
{
parent::__construct();

$this->eggExporterService = $eggExporterService;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
public function rename(RenameServerRequest $request, Server $server): JsonResponse
{
$name = $request->input('name');
$description = $request->input('description') ?? $server->description;
$description = $request->has('description') ? (string) $request->input('description') : $server->description;
$this->repository->update($server->id, [
'name' => $name,
'description' => $description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,32 @@ public function __construct(private BackupManager $backupManager)
*/
public function __invoke(Request $request, string $backup): JsonResponse
{
// Get the node associated with the request.
/** @var \Pterodactyl\Models\Node $node */
$node = $request->attributes->get('node');

// Get the size query parameter.
$size = (int) $request->query('size');
if (empty($size)) {
throw new BadRequestHttpException('A non-empty "size" query parameter must be provided.');
}

/** @var \Pterodactyl\Models\Backup $backup */
$backup = Backup::query()->where('uuid', $backup)->firstOrFail();
/** @var \Pterodactyl\Models\Backup $model */
$model = Backup::query()
->where('uuid', $backup)
->firstOrFail();

// Check that the backup is "owned" by the node making the request. This avoids other nodes
// from messing with backups that they don't own.
/** @var \Pterodactyl\Models\Server $server */
$server = $model->server;
if ($server->node_id !== $node->id) {
throw new HttpForbiddenException('You do not have permission to access that backup.');

Check failure on line 55 in app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Instantiated class Pterodactyl\Http\Controllers\Api\Remote\Backups\HttpForbiddenException not found.

Check failure on line 55 in app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php

View workflow job for this annotation

GitHub Actions / Static Analysis

Throwing object of an unknown class Pterodactyl\Http\Controllers\Api\Remote\Backups\HttpForbiddenException.
}

// Prevent backups that have already been completed from trying to
// be uploaded again.
if (!is_null($backup->completed_at)) {
if (!is_null($model->completed_at)) {
throw new ConflictHttpException('This backup is already in a completed state.');
}

Expand All @@ -54,7 +68,7 @@ public function __invoke(Request $request, string $backup): JsonResponse
}

// The path where backup will be uploaded to
$path = sprintf('%s/%s.tar.gz', $backup->server->uuid, $backup->uuid);
$path = sprintf('%s/%s.tar.gz', $model->server->uuid, $model->uuid);

// Get the S3 client
$client = $adapter->getClient();
Expand Down Expand Up @@ -92,7 +106,7 @@ public function __invoke(Request $request, string $backup): JsonResponse
}

// Set the upload_id on the backup in the database.
$backup->update(['upload_id' => $params['UploadId']]);
$model->update(['upload_id' => $params['UploadId']]);

return new JsonResponse([
'parts' => $parts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Extensions\Backups\BackupManager;
use Pterodactyl\Extensions\Filesystem\S3Filesystem;
use Pterodactyl\Exceptions\Http\HttpForbiddenException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Pterodactyl\Http\Requests\Api\Remote\ReportBackupCompleteRequest;

Expand All @@ -30,8 +31,22 @@ public function __construct(private BackupManager $backupManager)
*/
public function index(ReportBackupCompleteRequest $request, string $backup): JsonResponse
{
// Get the node associated with the request.
/** @var \Pterodactyl\Models\Node $node */
$node = $request->attributes->get('node');

/** @var \Pterodactyl\Models\Backup $model */
$model = Backup::query()->where('uuid', $backup)->firstOrFail();
$model = Backup::query()
->where('uuid', $backup)
->firstOrFail();

// Check that the backup is "owned" by the node making the request. This avoids other nodes
// from messing with backups that they don't own.
/** @var \Pterodactyl\Models\Server $server */
$server = $model->server;
if ($server->node_id !== $node->id) {
throw new HttpForbiddenException('You do not have permission to access that backup.');
}

if ($model->is_successful) {
throw new BadRequestHttpException('Cannot update the status of a backup that is already marked as completed.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function rules(): array
Assert::isInstanceOf($server, Server::class);

return [
'docker_image' => ['required', 'string', Rule::in(array_values($server->egg->docker_images))],
'docker_image' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|?~?[\w\.\/\-:@ ]*$/', Rule::in(array_values($server->egg->docker_images))],
];
}
}
5 changes: 4 additions & 1 deletion app/Models/Egg.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class Egg extends Model
* Fields that are not mass assignable.
*/
protected $fillable = [
'nest_id',
'author',
'uuid',
'name',
'description',
'features',
Expand Down Expand Up @@ -120,7 +123,7 @@ class Egg extends Model
'file_denylist' => 'array|nullable',
'file_denylist.*' => 'string',
'docker_images' => 'required|array|min:1',
'docker_images.*' => 'required|string',
'docker_images.*' => ['required', 'string', 'max:191', 'regex:/^[\w#\.\/\- ]*\|?~?[\w\.\/\-:@ ]*$/'],
'startup' => 'required|nullable|string',
'config_from' => 'sometimes|bail|nullable|numeric|exists:eggs,id',
'config_stop' => 'required_without:config_from|nullable|string|max:191',
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ class Server extends Model
'allocation_id' => 'required|bail|unique:servers|exists:allocations,id',
'nest_id' => 'required|exists:nests,id',
'egg_id' => 'required|exists:eggs,id',
'startup' => 'required|string',
'startup' => 'nullable|string',
'skip_scripts' => 'sometimes|boolean',
'image' => 'required|string|max:191',
'image' => ['required', 'string', 'max:191', 'regex:/^~?[\w\.\/\-:@ ]*$/'],
'database_limit' => 'present|nullable|integer|min:0',
'allocation_limit' => 'sometimes|nullable|integer|min:0',
'backup_limit' => 'present|nullable|integer|min:0',
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Allocations/AssignmentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class AssignmentService
{
public const CIDR_MAX_BITS = 27;
public const CIDR_MAX_BITS = 25;
public const CIDR_MIN_BITS = 32;
public const PORT_FLOOR = 1024;
public const PORT_CEIL = 65535;
Expand Down
6 changes: 0 additions & 6 deletions app/Services/Eggs/EggConfigurationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ protected function convertStopToNewFormat(string $stop): array
}

$signal = substr($stop, 1);
if (strtoupper($signal) === 'C') {
return [
'type' => 'stop',
'value' => null,
];
}

return [
'type' => 'signal',
Expand Down
5 changes: 3 additions & 2 deletions database/Seeders/eggs/minecraft/egg-bungeecord.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2022-06-17T08:10:44+03:00",
"exported_at": "2024-05-07T12:55:57+00:00",
"name": "Bungeecord",
"author": "support@pterodactyl.io",
"description": "For a long time, Minecraft server owners have had a dream that encompasses a free, easy, and reliable way to connect multiple Minecraft servers together. BungeeCord is the answer to said dream. Whether you are a small server wishing to string multiple game-modes together, or the owner of the ShotBow Network, BungeeCord is the ideal solution for you. With the help of BungeeCord, you will be able to unlock your community's full potential.",
Expand All @@ -14,6 +14,7 @@
"pid_limit"
],
"docker_images": {
"Java 21": "ghcr.io\/pterodactyl\/yolks:java_21",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
Expand Down Expand Up @@ -56,4 +57,4 @@
"field_type": "text"
}
]
}
}
Loading

0 comments on commit 7149bc5

Please sign in to comment.