From 9d6f4e00d7129f821fd795d60c33d22a6e4f6cec Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Wed, 9 Dec 2020 00:42:56 -0500 Subject: [PATCH 1/6] Properly copy database-password --- resources/scripts/components/server/databases/DatabaseRow.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/scripts/components/server/databases/DatabaseRow.tsx b/resources/scripts/components/server/databases/DatabaseRow.tsx index caf4a702e..148415a13 100644 --- a/resources/scripts/components/server/databases/DatabaseRow.tsx +++ b/resources/scripts/components/server/databases/DatabaseRow.tsx @@ -127,7 +127,7 @@ export default ({ database, className }: Props) => {
- +
From e34d31a58c10b0545387e420f6396478d18aaf0e Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Wed, 16 Dec 2020 14:15:07 -0700 Subject: [PATCH 2/6] Allow changing the prune age for backups --- app/Console/Kernel.php | 12 +++++++----- .../Remote/Backups/BackupRemoteUploadController.php | 2 +- config/backups.php | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 1f83ddf93..a052ae39e 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -25,11 +25,13 @@ class Kernel extends ConsoleKernel // Execute scheduled commands for servers every minute, as if there was a normal cron running. $schedule->command('p:schedule:process')->everyMinute()->withoutOverlapping(); - // Every 30 minutes, run the backup pruning command so that any abandoned backups can be removed - // from the UI view for the server. - $schedule->command('p:maintenance:prune-backups', [ - '--since-minutes' => '30', - ])->everyThirtyMinutes(); + // Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted. + $pruneAge = config('backups.prune_age', 60); + if ($pruneAge > 0) { + $schedule->command('p:maintenance:prune-backups', [ + '--since-minutes' => $pruneAge, + ])->everyThirtyMinutes(); + } // Every day cleanup any internal backups of service files. $schedule->command('p:maintenance:clean-service-backups')->daily(); diff --git a/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php b/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php index 497d12904..6d50ad64d 100644 --- a/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php +++ b/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php @@ -52,7 +52,7 @@ class BackupRemoteUploadController extends Controller public function __invoke(Request $request, string $backup) { // Get the size query parameter. - $size = (int)$request->query('size'); + $size = (int) $request->query('size'); if (empty($size)) { throw new BadRequestHttpException('A non-empty "size" query parameter must be provided.'); } diff --git a/config/backups.php b/config/backups.php index 32ee1aa8a..b2c16f1a1 100644 --- a/config/backups.php +++ b/config/backups.php @@ -12,6 +12,10 @@ return [ // uses to upload backups to S3 storage. Value is in minutes, so this would default to an hour. 'presigned_url_lifespan' => env('BACKUP_PRESIGNED_URL_LIFESPAN', 60), + // The time in which to wait before automatically marking a backup as failed. + // To disable this feature, set the value to `0`. + 'prune_age' => env('BACKUP_PRUNE_AGE', 60), + 'disks' => [ // There is no configuration for the local disk for Wings. That configuration // is determined by the Daemon configuration, and not the Panel. From fd93a4cda14c86fbe6b8665a408cb66d596721ac Mon Sep 17 00:00:00 2001 From: Jakob Date: Fri, 18 Dec 2020 00:08:01 +0100 Subject: [PATCH 3/6] remove mailtrap.io from example env config --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 9062de215..67d496d47 100644 --- a/.env.example +++ b/.env.example @@ -19,8 +19,8 @@ HASHIDS_SALT= HASHIDS_LENGTH=8 MAIL_DRIVER=smtp -MAIL_HOST=mailtrap.io -MAIL_PORT=2525 +MAIL_HOST=smtp.example.com +MAIL_PORT=25 MAIL_USERNAME= MAIL_PASSWORD= MAIL_ENCRYPTION=tls From 17ca3659c55b96ce348ad90da3b27eab85ac2509 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sat, 19 Dec 2020 11:50:35 -0700 Subject: [PATCH 4/6] Change 'backups.prune_age' default to 6 hours --- app/Console/Kernel.php | 2 +- config/backups.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a052ae39e..4fa0845e5 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -26,7 +26,7 @@ class Kernel extends ConsoleKernel $schedule->command('p:schedule:process')->everyMinute()->withoutOverlapping(); // Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted. - $pruneAge = config('backups.prune_age', 60); + $pruneAge = config('backups.prune_age', 360); // Defaults to 6 hours (time is in minuteS) if ($pruneAge > 0) { $schedule->command('p:maintenance:prune-backups', [ '--since-minutes' => $pruneAge, diff --git a/config/backups.php b/config/backups.php index b2c16f1a1..a309a9ee6 100644 --- a/config/backups.php +++ b/config/backups.php @@ -12,9 +12,9 @@ return [ // uses to upload backups to S3 storage. Value is in minutes, so this would default to an hour. 'presigned_url_lifespan' => env('BACKUP_PRESIGNED_URL_LIFESPAN', 60), - // The time in which to wait before automatically marking a backup as failed. - // To disable this feature, set the value to `0`. - 'prune_age' => env('BACKUP_PRUNE_AGE', 60), + // The time to wait before automatically failing a backup, time is in minutes and defaults + // to 6 hours. To disable this feature, set the value to `0`. + 'prune_age' => env('BACKUP_PRUNE_AGE', 360), 'disks' => [ // There is no configuration for the local disk for Wings. That configuration From 2e6bb4e7ba2fef76d446ac3539e74005bc9e3d72 Mon Sep 17 00:00:00 2001 From: Vilhelm Prytz Date: Tue, 22 Dec 2020 17:48:28 +0100 Subject: [PATCH 5/6] eggs: SpongeVanilla: update default version * replaced 1.11.2-6.1.0-BETA-21 with 1.12.2-7.3.0 since it is the stable and recommended build --- database/seeds/eggs/minecraft/egg-sponge--sponge-vanilla.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/eggs/minecraft/egg-sponge--sponge-vanilla.json b/database/seeds/eggs/minecraft/egg-sponge--sponge-vanilla.json index 0a695ac2e..db3f7fc94 100644 --- a/database/seeds/eggs/minecraft/egg-sponge--sponge-vanilla.json +++ b/database/seeds/eggs/minecraft/egg-sponge--sponge-vanilla.json @@ -28,7 +28,7 @@ "name": "Sponge Version", "description": "The version of SpongeVanilla to download and use.", "env_variable": "SPONGE_VERSION", - "default_value": "1.11.2-6.1.0-BETA-21", + "default_value": "1.12.2-7.3.0", "user_viewable": true, "user_editable": false, "rules": "required|regex:\/^([a-zA-Z0-9.\\-_]+)$\/" From 4b9eab89509ad4205d24f34dba9508b38b83990b Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Tue, 22 Dec 2020 19:31:52 -0700 Subject: [PATCH 6/6] Send ignored_files as a string to wings --- app/Repositories/Wings/DaemonBackupRepository.php | 3 ++- app/Services/Backups/InitiateBackupService.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Repositories/Wings/DaemonBackupRepository.php b/app/Repositories/Wings/DaemonBackupRepository.php index 6506ac8a2..0eb9d4792 100644 --- a/app/Repositories/Wings/DaemonBackupRepository.php +++ b/app/Repositories/Wings/DaemonBackupRepository.php @@ -2,6 +2,7 @@ namespace Pterodactyl\Repositories\Wings; +use Illuminate\Support\Arr; use Webmozart\Assert\Assert; use Pterodactyl\Models\Backup; use Pterodactyl\Models\Server; @@ -48,7 +49,7 @@ class DaemonBackupRepository extends DaemonRepository 'json' => [ 'adapter' => $this->adapter ?? config('backups.default'), 'uuid' => $backup->uuid, - 'ignored_files' => $backup->ignored_files, + 'ignore' => implode('\n', $backup->ignored_files), ], ] ); diff --git a/app/Services/Backups/InitiateBackupService.php b/app/Services/Backups/InitiateBackupService.php index 0857478ba..615f357ce 100644 --- a/app/Services/Backups/InitiateBackupService.php +++ b/app/Services/Backups/InitiateBackupService.php @@ -117,9 +117,9 @@ class InitiateBackupService } // Check if the server has reached or exceeded it's backup limit - if (!$server->backup_limit || $server->backups()->where('is_successful', true)->count() >= $server->backup_limit) { + if (! $server->backup_limit || $server->backups()->where('is_successful', true)->count() >= $server->backup_limit) { // Do not allow the user to continue if this server is already at its limit and can't override. - if (!$override || $server->backup_limit <= 0) { + if (! $override || $server->backup_limit <= 0) { throw new TooManyBackupsException($server->backup_limit); }