From f58db890df9fee3862409b0aaebad1dfb7a70f56 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 24 Feb 2021 20:44:08 -0800 Subject: [PATCH 01/10] Update SECURITY.md --- SECURITY.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index eae320353..7b99461de 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,8 +5,10 @@ The following versions of Pterodactyl are receiving active support and maintenan | Panel | Daemon | Supported | | ----- | ------------ | ------------------ | -| 1.0.x | wings@1.0.x | :white_check_mark: | -| 0.7.x | daemon@0.6.x | :white_check_mark: | +| 1.2.x | wings@1.2.x | :white_check_mark: | +| 1.1.x | wings@1.1.x | :white_check_mark: | +| 1.0.x | wings@1.0.x | :x: | +| 0.7.x | daemon@0.6.x | :x: | | 0.6.x | daemon@0.5.x | :x: | | 0.5.x | daemon@0.4.x | :x: | From d86bcb50af317b408832fa8c2545e3d6b4514c34 Mon Sep 17 00:00:00 2001 From: Samuel L <51273077+ssh-sysadmin@users.noreply.github.com> Date: Tue, 2 Mar 2021 07:14:35 -0500 Subject: [PATCH 02/10] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61660faba..4bf5389ae 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ I would like to extend my sincere thanks to the following sponsors for helping f | [**DeinServerHost**](https://deinserverhost.de/) | DeinServerHost offers Dedicated, vps and Gameservers for many popular Games like Minecraft and Rust in Germany since 2013. | | [**HostBend**](https://hostbend.com/) | HostBend offers a variety of solutions for developers, students, and others who have a tight budget but don't want to compromise quality and support. | | [**Capitol Hosting Solutions**](https://capitolsolutions.cloud/) | CHS is *the* budget friendly hosting company for Australian and American gamers, offering a variety of plans from Web Hosting to Game Servers; Custom Solutions too! | +| [**ByteAnia**](https://ByteAnia.com/) | ByteAnia offers the best performing and most affordable **Ryzen 5000 Series hosting** on the market for *unbeatable prices*! | ## Documentation * [Panel Documentation](https://pterodactyl.io/panel/1.0/getting_started.html) From bc87a9cf7d099869a33bb9daf134130a528de217 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 19:31:39 -0800 Subject: [PATCH 03/10] Don't break the entire server UI for a broken console, ref #3121 --- resources/scripts/components/server/ServerConsole.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/server/ServerConsole.tsx b/resources/scripts/components/server/ServerConsole.tsx index 7d34985e9..63c2aa268 100644 --- a/resources/scripts/components/server/ServerConsole.tsx +++ b/resources/scripts/components/server/ServerConsole.tsx @@ -9,6 +9,7 @@ import ServerDetailsBlock from '@/components/server/ServerDetailsBlock'; import isEqual from 'react-fast-compare'; import PowerControls from '@/components/server/PowerControls'; import { EulaModalFeature } from '@feature/index'; +import ErrorBoundary from '@/components/elements/ErrorBoundary'; export type PowerAction = 'start' | 'stop' | 'restart' | 'kill'; @@ -51,7 +52,9 @@ const ServerConsole = () => {
- + + + {eggFeatures.includes('eula') && From 68bc81f2f123437aad6f16652466c775db57d6fe Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 19:44:06 -0800 Subject: [PATCH 04/10] Try to handle terminal fit a bit better; closes #3121 I'm not sure how to fix this actually, but based on the light reading I did theoretically this should at least prevent it from trying to fit something that doesn't even exist? --- resources/scripts/components/server/Console.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/scripts/components/server/Console.tsx b/resources/scripts/components/server/Console.tsx index 4301cd974..281e81520 100644 --- a/resources/scripts/components/server/Console.tsx +++ b/resources/scripts/components/server/Console.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { ITerminalOptions, Terminal } from 'xterm'; import { FitAddon } from 'xterm-addon-fit'; import { SearchAddon } from 'xterm-addon-search'; @@ -135,11 +135,12 @@ export default () => { useEffect(() => { if (connected && ref.current && !terminal.element) { - terminal.open(ref.current); terminal.loadAddon(fitAddon); terminal.loadAddon(searchAddon); terminal.loadAddon(searchBar); terminal.loadAddon(webLinksAddon); + + terminal.open(ref.current); fitAddon.fit(); // Add support for capturing keys @@ -159,11 +160,11 @@ export default () => { } }, [ terminal, connected ]); - const fit = debounce(() => { - fitAddon.fit(); - }, 100); - - useEventListener('resize', () => fit()); + useEventListener('resize', debounce(() => { + if (terminal.element) { + fitAddon.fit(); + } + }, 100)); useEffect(() => { const listeners: Record void> = { From 9a10078008223223ced836f783baa048fe0c3892 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 20:18:24 -0800 Subject: [PATCH 05/10] Delete Vagrantfile --- Vagrantfile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 1eb62f5dc..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,17 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.box = "bento/ubuntu-16.04" - - config.vm.synced_folder "./", "/var/www/html/pterodactyl", - owner: "www-data", group: "www-data" - - config.vm.provision :shell, path: ".dev/vagrant/provision.sh" - - config.vm.network :private_network, ip: "192.168.50.2" - config.vm.network :forwarded_port, guest: 80, host: 50080 - config.vm.network :forwarded_port, guest: 8025, host: 58025 - config.vm.network :forwarded_port, guest: 3306, host: 53306 - - # Config for the vagrant-dns plugin (https://github.com/BerlinVagrant/vagrant-dns) - config.dns.tld = "test" - config.dns.patterns = [/^pterodactyl.test$/] -end From 19279644df5cf536d165883efbfcaad9ed114cf8 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 20:19:00 -0800 Subject: [PATCH 06/10] Show more user friendly error when allocation fails to parse; closes #3056 --- app/Services/Allocations/AssignmentService.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Services/Allocations/AssignmentService.php b/app/Services/Allocations/AssignmentService.php index 09313e4c9..878c7307a 100644 --- a/app/Services/Allocations/AssignmentService.php +++ b/app/Services/Allocations/AssignmentService.php @@ -2,9 +2,11 @@ namespace Pterodactyl\Services\Allocations; +use Exception; use IPTools\Network; use Pterodactyl\Models\Node; use Illuminate\Database\ConnectionInterface; +use Pterodactyl\Exceptions\DisplayException; use Pterodactyl\Contracts\Repository\AllocationRepositoryInterface; use Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException; use Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException; @@ -42,9 +44,10 @@ class AssignmentService /** * Insert allocations into the database and link them to a specific node. * + * @throws \Pterodactyl\Exceptions\DisplayException * @throws \Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException - * @throws \Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException * @throws \Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException + * @throws \Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException * @throws \Pterodactyl\Exceptions\Service\Allocation\TooManyPortsInRangeException */ public function handle(Node $node, array $data) @@ -56,8 +59,16 @@ class AssignmentService } } + try { + $underlying = gethostbyname($data['allocation_ip']); + $parsed = Network::parse($underlying); + } catch (Exception $exception) { + /* @noinspection PhpUndefinedVariableInspection */ + throw new DisplayException("Could not parse provided allocation IP address ({$underlying}): {$exception->getMessage()}", $exception); + } + $this->connection->beginTransaction(); - foreach (Network::parse(gethostbyname($data['allocation_ip'])) as $ip) { + foreach ($parsed as $ip) { foreach ($data['allocation_ports'] as $port) { if (!is_digit($port) && !preg_match(self::PORT_RANGE_REGEX, $port)) { throw new InvalidPortMappingException($port); From 0723e6e3c16ede1334875f8ee94724b10c6f6433 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 4 Mar 2021 06:41:10 +0200 Subject: [PATCH 07/10] Fix ark rcon startup --- .../source-engine/egg-ark--survival-evolved.json | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/database/Seeders/eggs/source-engine/egg-ark--survival-evolved.json b/database/Seeders/eggs/source-engine/egg-ark--survival-evolved.json index 627a384a8..03305ffa6 100644 --- a/database/Seeders/eggs/source-engine/egg-ark--survival-evolved.json +++ b/database/Seeders/eggs/source-engine/egg-ark--survival-evolved.json @@ -1,14 +1,18 @@ { "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", "meta": { - "version": "PTDL_v1" + "version": "PTDL_v1", + "update_url": null }, - "exported_at": "2020-10-19T23:29:06+00:00", + "exported_at": "2021-03-04T06:38:31+02:00", "name": "Ark: Survival Evolved", "author": "dev@shepper.fr", "description": "As a man or woman stranded, naked, freezing, and starving on the unforgiving shores of a mysterious island called ARK, use your skill and cunning to kill or tame and ride the plethora of leviathan dinosaurs and other primeval creatures roaming the land. Hunt, harvest resources, craft items, grow crops, research technologies, and build shelters to withstand the elements and store valuables, all while teaming up with (or preying upon) hundreds of other players to survive, dominate... and escape! \u2014 Gamepedia: ARK", - "image": "quay.io\/parkervcp\/pterodactyl-images:debian_source", - "startup": "rmv() { echo -e \"stoppping server\"; rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD} -c saveworld && rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD} -c DoExit; }; trap rmv 15; cd ShooterGame\/Binaries\/Linux && .\/ShooterGameServer {{SERVER_MAP}}?listen?SessionName=\"{{SESSION_NAME}}\"?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?RCONPort={{RCON_PORT}}?QueryPort={{QUERY_PORT}}?RCONEnabled={{ENABLE_RCON}}$( [ \"$BATTLE_EYE\" == \"0\" ] || printf %s '?-NoBattlEye' ) -server -log & until echo \"waiting for rcon connection...\"; rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD}; do sleep 5; done", + "features": null, + "images": [ + "quay.io\/parkervcp\/pterodactyl-images:debian_source" + ], + "startup": "rmv() { echo -e \"stoppping server\"; rcon -t rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD} -c saveworld && rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD} -c DoExit; }; trap rmv 15; cd ShooterGame\/Binaries\/Linux && .\/ShooterGameServer {{SERVER_MAP}}?listen?SessionName=\"{{SESSION_NAME}}\"?ServerPassword={{ARK_PASSWORD}}?ServerAdminPassword={{ARK_ADMIN_PASSWORD}}?Port={{SERVER_PORT}}?RCONPort={{RCON_PORT}}?QueryPort={{QUERY_PORT}}?RCONEnabled={{ENABLE_RCON}}$( [ \"$BATTLE_EYE\" == \"0\" ] || printf %s '?-NoBattlEye' ) -server -log & until echo \"waiting for rcon connection...\"; rcon -t rcon -a 127.0.0.1:${RCON_PORT} -p ${ARK_ADMIN_PASSWORD}; do sleep 5; done", "config": { "files": "{}", "startup": "{\r\n \"done\": \"Waiting commands for 127.0.0.1:\",\r\n \"userInteraction\": []\r\n}", @@ -105,7 +109,7 @@ "rules": "required|boolean" }, { - "name": "Ballte Eye", + "name": "Battle Eye", "description": "Enable BattleEye\r\n\r\n0 to disable\r\n1 to enable\r\n\r\ndefault=\"1\"", "env_variable": "BATTLE_EYE", "default_value": "1", @@ -114,4 +118,4 @@ "rules": "required|boolean" } ] -} \ No newline at end of file +} From 1943c7a98b9416473b65bc6b754a56df3fbe3644 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 21:02:11 -0800 Subject: [PATCH 08/10] Prevent catastrophic boot failure in wings when a server egg has bad data; closes #3055 --- app/Services/Eggs/EggConfigurationService.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Services/Eggs/EggConfigurationService.php b/app/Services/Eggs/EggConfigurationService.php index 3b3ca2d11..597f67611 100644 --- a/app/Services/Eggs/EggConfigurationService.php +++ b/app/Services/Eggs/EggConfigurationService.php @@ -98,6 +98,16 @@ class EggConfigurationService // Normalize the output of the configuration for the new Wings Daemon to more // easily ingest, as well as make things more flexible down the road. foreach ($configs as $file => $data) { + // Try to head off any errors relating to parsing a set of configuration files + // or other JSON data for the egg. This should probably be blocked at the time + // of egg creation/update, but it isn't so this check will at least prevent a + // 500 error which would crash the entire Wings boot process. + // + // @see https://github.com/pterodactyl/panel/issues/3055 + if (!is_object($data) || !isset($data->find)) { + continue; + } + $append = array_merge((array) $data, ['file' => $file, 'replace' => []]); foreach ($this->iterate($data->find, $structure) as $find => $replace) { From 9aa74a3a50f7c7dee03ac255ab9a7191fb68525d Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 21:04:11 -0800 Subject: [PATCH 09/10] appease the eslint gods --- resources/scripts/components/server/Console.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/scripts/components/server/Console.tsx b/resources/scripts/components/server/Console.tsx index 281e81520..6fd32a0ef 100644 --- a/resources/scripts/components/server/Console.tsx +++ b/resources/scripts/components/server/Console.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; import { ITerminalOptions, Terminal } from 'xterm'; import { FitAddon } from 'xterm-addon-fit'; import { SearchAddon } from 'xterm-addon-search'; From 4192bcab4b6e51594b16206328bd02f743081a96 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Wed, 3 Mar 2021 21:17:20 -0800 Subject: [PATCH 10/10] Update CHANGELOG.md --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e09ae67f2..bbbdd24f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,34 @@ 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.3.0 +### Fixed +* Fixes administrator "Other Servers" toggle being persisted wrongly when signing out and signing into a non-administrator account on the server dashboard. +* Fixes composer failing to run properly in local environments where there is no database connection available once configured. +* Fixes SQL exception caused by the Panel attempting to store null values in the database. +* Fixes validation errors caused by improper defaults when trying to edit system settings in the admin area. +* Fixes console overflow when using smaller-than-default font sizes in Firefox. +* Fixes console text input field having a white background when manually building new assets from the release build due to a missing `babel-macros` definition file. +* Fixes database improperly using a signed `smallint` field rather than an unsigned field which restricted SFTP ports to 32767 or less. +* Fixes server console resize handler to no longer encounter an exception at random that breaks the entire UI. +* Fixes unhandled error caused by entering an invalid IP address or FQDN when creating a new node allocation. +* Fixes unhandled error when Wings would fetch a server configuration from the Panel that uses an Egg with invalid JSON data for the configuration fields. + +### Added +* Adds support for automatically copying SFTP connection details when clicking into the text field. +* Messaging about a node not having any allocations available for deployment has been adjusted to be more understandable by users. +* Adds automated self-upgrade process for Pterodactyl Panel once this version is installed on servers. This allows users to update by using a single command. +* Adds support for specifying a month when creating or modifying a server schedule. +* Adds support for restoring backups (including those in S3 buckets) to a server and optionally deleting all existing files when doing so. +* Adds underlying support for audit logging on servers. Currently this is only used by some internal functionality but will be slowly expanded as time permits to allow more robust logging. +* Adds logic to automatically reset failed server states when Wings is rebooted. This will kick servers out of "installing" and "restoring from backup" states automatically. + +### Changed +* Updated to `Laravel 8` and bumped minimum PHP version from `7.3` to `7.4` with PHP `8.0` being the recommended. +* Server state is now stored in a single `status` column within the database rather than multiple different `tinyint` columns. + ## v1.2.2 +### Fixed * **[security]** Fixes authentication bypass allowing a user to take control of specific server actions such as executing schedules, rotating database passwords, and viewing or deleting a backup. ## v1.2.1