Merge branch 'develop' into feature/react-admin

This commit is contained in:
Matthew Penner 2021-03-05 08:45:39 -07:00
commit d57060dad9
9 changed files with 76 additions and 34 deletions

View file

@ -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

View file

@ -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)

View file

@ -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: |

17
Vagrantfile vendored
View file

@ -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

View file

@ -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);

View file

@ -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) {

View file

@ -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",

View file

@ -136,11 +136,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
@ -160,11 +161,11 @@ export default () => {
}
}, [ terminal, connected ]);
const fit = debounce(() => {
useEventListener('resize', debounce(() => {
if (terminal.element) {
fitAddon.fit();
}, 100);
useEventListener('resize', () => fit());
}
}, 100));
useEffect(() => {
const listeners: Record<string, (s: string) => void> = {

View file

@ -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 = () => {
</div>
<div css={tw`w-full lg:w-3/4 mt-4 lg:mt-0 lg:pl-4`}>
<SuspenseSpinner>
<ErrorBoundary>
<ChunkedConsole/>
</ErrorBoundary>
<ChunkedStatGraphs/>
</SuspenseSpinner>
{eggFeatures.includes('eula') &&