Skip to content

Commit 665a4dd

Browse files
authored
Merge branch 'develop' into develop
2 parents ea778e9 + 7fd49dd commit 665a4dd

File tree

115 files changed

+3426
-1962
lines changed

Some content is hidden

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

115 files changed

+3426
-1962
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
public
2+
resources/views

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

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: 🤷 Installation Help
4+
url: https://discord.gg/pterodactyl
5+
about: Please visit our Discord for help with your installation.
6+
- name: ❓ General Question
7+
url: https://discord.gg/pterodactyl
8+
about: Please visit our Discord for general questions about Pterodactyl.

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,56 @@ 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.3
7+
### Fixed
8+
* Fixes bug causing subusers to not be creatable or editable via the frontend for servers.
9+
* Fixes system timezone not being passed along properly to the MySQL connection causing scheduled tasks to run every minute when the MySQL instance and Panel timezone did not line up.
10+
* Fixes listing servers owned by a user in the admin area to actually list their servers.
11+
12+
### Changed
13+
* Adds SameSite `lax` attribute for cookies generated by the Panel.
14+
* Adds better filtering for searching servers in the admin area to better key off name, uuid, or owner username/email.
15+
16+
## v1.0.2
17+
### Added
18+
* Adds support for searching inside the file editor.
19+
* Adds support for manually executing a schedule regardless of if it is currently queued or not.
20+
* Adds an indicator to the schedule UI to show when a schedule is currently processing.
21+
* Adds support for setting the `backup_limit` of a server via the API.
22+
* **[Security]** Adds login throttling to the 2FA verification endpoint.
23+
24+
### Fixed
25+
* Fixes subuser page title missing server name.
26+
* Fixes schedule task `sequence_id` not properly being reset when a schedule's task is deleted.
27+
* Fixes misc. UI bugs throughout the frontend when long text overflows its bounds.
28+
* Fixes user deletion command to properly handle email & ID searching.
29+
* Fixes color issues in the terminal causing certain text & background combinations to be illegible.
30+
* Fixes reCAPTCHA not properly resetting on login failure.
31+
* Fixes error messages not properly resetting between login screens.
32+
* Fixes a UI crash when attempting to create or view a directory or file that contained the `%` somewhere in the name.
33+
34+
### Changed
35+
* Updated the search modal to close itself when the ESC key is pressed.
36+
* Updates the schedule view and editing UI to better display information to users.
37+
* Changed logic powering server searching on the frontend to return more accurate results and return all servers when executing the query as an admin.
38+
* Admin CP link no longer opens in a new tab.
39+
* Mounts will no longer allow a user to mount certain directory combinations. This blocks mounting one server's files into another server, and blocks using the server data directory as a mount destination.
40+
* Cleaned up assorted server build modification code.
41+
* Updates default eggs to have improved install scripts and more consistent container usage.
42+
43+
## v1.0.1
44+
### Fixed
45+
* Fixes 500 error when mounting a mount to a server, and other related errors when handling mounts.
46+
* Ensures that `server_transfers` database is deleted if it already exists to avoid unnecessary error.
47+
* Fixes servers getting marked as "not installed" when modifying their startup arguments.
48+
* Fixes filemanager breadcrumbs being set incorrectly when navigating between files and folders.
49+
50+
### Changed
51+
* Change the requests per minute from 240 to 720 for the client API to avoid unecessarily displaying
52+
"Too Many Requests" errors.
53+
* Added error output to certain commands that will output and terminate the command execution if the database
54+
migrations have not been run correctly for the instance.
55+
656
## v1.0.0
757
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
858
has been in the making since 2013. 🎉

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pterodactyl/panel/tests?label=Tests&style=for-the-badge)
44
![Discord](https://img.shields.io/discord/122900397965705216?label=Discord&logo=Discord&logoColor=white&style=for-the-badge)
55
![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)
76
![GitHub contributors](https://img.shields.io/github/contributors/pterodactyl/panel?style=for-the-badge)
87

98
# Pterodactyl Panel
@@ -16,18 +15,21 @@ Stop settling for less. Make game servers a first class citizen on your platform
1615
![Image](https://cdn.pterodactyl.io/site-assets/pterodactyl_v1_demo.gif)
1716

1817
## Sponsors
19-
I would like to extend my sincere thanks to the following sponsors for helping find Pterodactyl's developement.
18+
I would like to extend my sincere thanks to the following sponsors for helping fund Pterodactyl's developement.
2019
[Interested in becoming a sponsor?](https://github.com/sponsors/DaneEveritt)
2120

2221
| Company | About |
2322
| ------- | ----- |
23+
| [**WISP**](https://wisp.gg) | Extra features. |
2424
| [**Bloom.host**](https://bloom.host) | Bloom.host offers dedicated core VPS and Minecraft hosting with Ryzen 9 processors. With owned-hardware, we offer truly unbeatable prices on high-performance hosting. |
25-
| [**VersatileNode**](https://versatilenode.com/) | Looking to host a minecraft server, vps, or a website? VersatileNode is one of the most affordable hosting providers to provide quality yet cheap services with incredible support. |
2625
| [**MineStrator**](https://minestrator.com/) | Looking for a French highend hosting company for you minecraft server? More than 14,000 members on our discord, trust us. |
2726
| [**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. |
2827
| [**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! |
2928
| [**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. |
29+
| [**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. |
30+
| [**Spill Hosting**](https://spillhosting.no/) | Spill Hosting is a Norwegian hosting service, which aims to cheap services on quality servers. Premium i9-9900K processors will run your game like a dream. |
31+
| [**DeinServerHost**](https://deinserverhost.de/) | DeinServerHost offers Dedicated, vps and Gameservers for many popular Games like Minecraft and Rust in Germany since 2013. |
32+
| [**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. |
3133

3234
## Documentation
3335
* [Panel Documentation](https://pterodactyl.io/panel/1.0/getting_started.html)

app/Console/Commands/Environment/AppSettingsCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ public function handle()
144144
$this->variables['APP_ENVIRONMENT_ONLY'] = $this->confirm(trans('command/messages.environment.app.settings'), true) ? 'false' : 'true';
145145
}
146146

147+
// Make sure session cookies are set as "secure" when using HTTPS
148+
if (strpos($this->variables['APP_URL'], 'https://') === 0) {
149+
$this->variables['SESSION_SECURE_COOKIE'] = 'true';
150+
}
151+
147152
$this->checkForRedis();
148153
$this->writeToEnvironment($this->variables);
149154

Lines changed: 44 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,79 @@
11
<?php
2-
/**
3-
* Pterodactyl - Panel
4-
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
5-
*
6-
* This software is licensed under the terms of the MIT license.
7-
* https://opensource.org/licenses/MIT
8-
*/
92

103
namespace Pterodactyl\Console\Commands\Schedule;
114

12-
use Cake\Chronos\Chronos;
5+
use Throwable;
6+
use Exception;
137
use Illuminate\Console\Command;
14-
use Illuminate\Support\Collection;
8+
use Pterodactyl\Models\Schedule;
9+
use Illuminate\Support\Facades\Log;
1510
use Pterodactyl\Services\Schedules\ProcessScheduleService;
16-
use Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface;
1711

1812
class ProcessRunnableCommand extends Command
1913
{
20-
/**
21-
* @var string
22-
*/
23-
protected $description = 'Process schedules in the database and determine which are ready to run.';
24-
25-
/**
26-
* @var \Pterodactyl\Services\Schedules\ProcessScheduleService
27-
*/
28-
protected $processScheduleService;
29-
30-
/**
31-
* @var \Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface
32-
*/
33-
protected $repository;
34-
3514
/**
3615
* @var string
3716
*/
3817
protected $signature = 'p:schedule:process';
3918

4019
/**
41-
* ProcessRunnableCommand constructor.
42-
*
43-
* @param \Pterodactyl\Services\Schedules\ProcessScheduleService $processScheduleService
44-
* @param \Pterodactyl\Contracts\Repository\ScheduleRepositoryInterface $repository
20+
* @var string
4521
*/
46-
public function __construct(ProcessScheduleService $processScheduleService, ScheduleRepositoryInterface $repository)
47-
{
48-
parent::__construct();
49-
50-
$this->processScheduleService = $processScheduleService;
51-
$this->repository = $repository;
52-
}
22+
protected $description = 'Process schedules in the database and determine which are ready to run.';
5323

5424
/**
5525
* Handle command execution.
5626
*/
5727
public function handle()
5828
{
59-
$schedules = $this->repository->getSchedulesToProcess(Chronos::now()->toAtomString());
29+
$schedules = Schedule::query()->with('tasks')
30+
->where('is_active', true)
31+
->where('is_processing', false)
32+
->whereRaw('next_run_at <= NOW()')
33+
->get();
34+
6035
if ($schedules->count() < 1) {
6136
$this->line('There are no scheduled tasks for servers that need to be run.');
6237

6338
return;
6439
}
6540

6641
$bar = $this->output->createProgressBar(count($schedules));
67-
$schedules->each(function ($schedule) use ($bar) {
68-
if ($schedule->tasks instanceof Collection && count($schedule->tasks) > 0) {
69-
$this->processScheduleService->handle($schedule);
70-
71-
if ($this->input->isInteractive()) {
72-
$bar->clear();
73-
$this->line(trans('command/messages.schedule.output_line', [
74-
'schedule' => $schedule->name,
75-
'hash' => $schedule->hashid,
76-
]));
77-
}
78-
}
79-
42+
foreach ($schedules as $schedule) {
43+
$bar->clear();
44+
$this->processSchedule($schedule);
8045
$bar->advance();
8146
$bar->display();
82-
});
47+
}
8348

8449
$this->line('');
8550
}
51+
52+
/**
53+
* Processes a given schedule and logs and errors encountered the console output. This should
54+
* never throw an exception out, otherwise you'll end up killing the entire run group causing
55+
* any other schedules to not process correctly.
56+
*
57+
* @param \Pterodactyl\Models\Schedule $schedule
58+
* @see https://github.com/pterodactyl/panel/issues/2609
59+
*/
60+
protected function processSchedule(Schedule $schedule)
61+
{
62+
if ($schedule->tasks->isEmpty()) {
63+
return;
64+
}
65+
66+
try {
67+
$this->getLaravel()->make(ProcessScheduleService::class)->handle($schedule);
68+
69+
$this->line(trans('command/messages.schedule.output_line', [
70+
'schedule' => $schedule->name,
71+
'hash' => $schedule->hashid,
72+
]));
73+
} catch (Throwable | Exception $exception) {
74+
Log::error($exception, ['schedule_id' => $schedule->id]);
75+
76+
$this->error("An error was encountered while processing Schedule #{$schedule->id}: " . $exception->getMessage());
77+
}
78+
}
8679
}

app/Console/Commands/User/DeleteUserCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ public function handle()
5858
Assert::notEmpty($search, 'Search term should be an email address, got: %s.');
5959

6060
$results = User::query()
61-
->where('email', 'LIKE', "$search%")
62-
->where('username', 'LIKE', "$search%")
61+
->where('id', 'LIKE', "$search%")
62+
->orWhere('username', 'LIKE', "$search%")
63+
->orWhere('email', 'LIKE', "$search%")
6364
->get();
6465

6566
if (count($results) < 1) {

app/Contracts/Repository/ScheduleRepositoryInterface.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ interface ScheduleRepositoryInterface extends RepositoryInterface
1515
*/
1616
public function findServerSchedules(int $server): Collection;
1717

18-
/**
19-
* Load the tasks relationship onto the Schedule module if they are not
20-
* already present.
21-
*
22-
* @param \Pterodactyl\Models\Schedule $schedule
23-
* @param bool $refresh
24-
* @return \Pterodactyl\Models\Schedule
25-
*/
26-
public function loadTasks(Schedule $schedule, bool $refresh = false): Schedule;
27-
2818
/**
2919
* Return a schedule model with all of the associated tasks as a relationship.
3020
*
@@ -34,12 +24,4 @@ public function loadTasks(Schedule $schedule, bool $refresh = false): Schedule;
3424
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
3525
*/
3626
public function getScheduleWithTasks(int $schedule): Schedule;
37-
38-
/**
39-
* Return all of the schedules that should be processed.
40-
*
41-
* @param string $timestamp
42-
* @return \Illuminate\Support\Collection
43-
*/
44-
public function getSchedulesToProcess(string $timestamp): Collection;
4527
}

0 commit comments

Comments
 (0)